summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.gitignore28
-rw-r--r--.travis.yml9
-rw-r--r--AUTHORS.md17
-rw-r--r--COPYRIGHT.txt52
-rw-r--r--SConstruct9
-rw-r--r--core/SCsub27
-rw-r--r--core/bind/core_bind.cpp30
-rw-r--r--core/bind/core_bind.h10
-rw-r--r--core/class_db.cpp14
-rw-r--r--core/class_db.h3
-rw-r--r--core/command_queue_mt.h127
-rw-r--r--core/core_string_names.cpp3
-rw-r--r--core/core_string_names.h3
-rw-r--r--core/dvector.h25
-rw-r--r--core/error_macros.h54
-rw-r--r--core/global_config.cpp8
-rw-r--r--core/hash_map.h3
-rw-r--r--core/helper/math_fieldwise.cpp10
-rw-r--r--core/image.cpp301
-rw-r--r--core/image.h31
-rw-r--r--core/io/compression.cpp20
-rw-r--r--core/io/compression.h9
-rw-r--r--core/io/file_access_compressed.cpp2
-rw-r--r--core/io/file_access_compressed.h2
-rw-r--r--core/io/http_client.cpp14
-rw-r--r--core/io/marshalls.cpp20
-rw-r--r--core/io/resource_format_binary.cpp27
-rw-r--r--core/io/resource_format_binary.h2
-rw-r--r--core/io/resource_import.h1
-rw-r--r--core/io/resource_loader.cpp159
-rw-r--r--core/io/resource_loader.h14
-rw-r--r--core/list.h14
-rw-r--r--core/map.h6
-rw-r--r--core/math/a_star.cpp2
-rw-r--r--core/math/bsp_tree.cpp6
-rw-r--r--core/math/camera_matrix.cpp8
-rw-r--r--core/math/face3.cpp36
-rw-r--r--core/math/face3.h54
-rw-r--r--core/math/geometry.cpp6
-rw-r--r--core/math/math_2d.cpp2
-rw-r--r--core/math/math_2d.h229
-rw-r--r--core/math/math_funcs.h21
-rw-r--r--core/math/matrix3.cpp7
-rw-r--r--core/math/matrix3.h6
-rw-r--r--core/math/octree.h26
-rw-r--r--core/math/quick_hull.cpp4
-rw-r--r--core/math/rect3.cpp92
-rw-r--r--core/math/rect3.h118
-rw-r--r--core/math/transform.cpp13
-rw-r--r--core/math/transform.h48
-rw-r--r--core/math/triangle_mesh.cpp8
-rw-r--r--core/math/vector3.cpp10
-rw-r--r--core/math/vector3.h4
-rw-r--r--core/method_bind.h2
-rw-r--r--core/object.cpp70
-rw-r--r--core/object.h29
-rw-r--r--core/os/input_event.cpp106
-rw-r--r--core/os/input_event.h20
-rw-r--r--core/reference.h2
-rw-r--r--core/resource.cpp32
-rw-r--r--core/resource.h7
-rw-r--r--core/script_language.h2
-rw-r--r--core/sort.h10
-rw-r--r--core/translation.cpp6
-rw-r--r--core/translation.h2
-rw-r--r--core/ustring.cpp14
-rw-r--r--core/variant.cpp10
-rw-r--r--core/variant_call.cpp45
-rw-r--r--core/variant_op.cpp94
-rw-r--r--core/variant_parser.cpp12
-rw-r--r--core/vector.h11
-rw-r--r--core/version.h2
-rw-r--r--core/vmap.h6
-rw-r--r--doc/base/classes.xml4924
-rw-r--r--doc/tools/makemd.py6
-rw-r--r--doc/tools/makerst.py6
-rw-r--r--drivers/gles2/rasterizer_gles2.cpp6
-rw-r--r--drivers/gles2/rasterizer_gles2.h4
-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.cpp764
-rw-r--r--drivers/gles3/rasterizer_canvas_gles3.h30
-rw-r--r--drivers/gles3/rasterizer_gles3.cpp14
-rw-r--r--drivers/gles3/rasterizer_scene_gles3.cpp853
-rw-r--r--drivers/gles3/rasterizer_scene_gles3.h137
-rw-r--r--drivers/gles3/rasterizer_storage_gles3.cpp896
-rw-r--r--drivers/gles3/rasterizer_storage_gles3.h108
-rw-r--r--drivers/gles3/shader_compiler_gles3.cpp46
-rw-r--r--drivers/gles3/shader_gles3.cpp54
-rw-r--r--drivers/gles3/shaders/SCsub38
-rw-r--r--drivers/gles3/shaders/canvas.glsl244
-rw-r--r--drivers/gles3/shaders/copy.glsl53
-rw-r--r--drivers/gles3/shaders/cubemap_filter.glsl59
-rw-r--r--drivers/gles3/shaders/effect_blur.glsl15
-rw-r--r--drivers/gles3/shaders/particles.glsl23
-rw-r--r--drivers/gles3/shaders/resolve.glsl2
-rw-r--r--drivers/gles3/shaders/scene.glsl399
-rw-r--r--drivers/gles3/shaders/screen_space_reflection.glsl47
-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.glsl32
-rw-r--r--drivers/png/image_loader_png.cpp1
-rw-r--r--drivers/png/resource_saver_png.cpp35
-rw-r--r--drivers/unix/SCsub2
-rw-r--r--editor/SCsub228
-rw-r--r--editor/animation_editor.cpp38
-rw-r--r--editor/editor_asset_installer.cpp4
-rw-r--r--editor/editor_audio_buses.cpp13
-rw-r--r--editor/editor_data.cpp7
-rw-r--r--editor/editor_export.cpp13
-rw-r--r--editor/editor_export.h1
-rw-r--r--editor/editor_file_dialog.cpp5
-rw-r--r--editor/editor_file_system.cpp7
-rw-r--r--editor/editor_file_system.h2
-rw-r--r--editor/editor_fonts.cpp6
-rw-r--r--editor/editor_help.cpp13
-rw-r--r--editor/editor_help.h2
-rw-r--r--editor/editor_initialize_ssl.cpp2
-rw-r--r--editor/editor_name_dialog.cpp1
-rw-r--r--editor/editor_node.cpp730
-rw-r--r--editor/editor_node.h24
-rw-r--r--editor/editor_plugin.cpp16
-rw-r--r--editor/editor_plugin.h6
-rw-r--r--editor/editor_plugin_settings.cpp2
-rw-r--r--editor/editor_profiler.cpp2
-rw-r--r--editor/editor_resource_preview.cpp16
-rw-r--r--editor/editor_run.cpp23
-rw-r--r--editor/editor_run_native.cpp2
-rw-r--r--editor/editor_settings.cpp52
-rw-r--r--editor/editor_settings.h2
-rw-r--r--editor/editor_themes.cpp57
-rw-r--r--editor/icons/SCsub4
-rw-r--r--editor/icons/icon_audio_player.pngbin443 -> 0 bytes
-rw-r--r--editor/icons/icon_h_button_array.pngbin163 -> 0 bytes
-rw-r--r--editor/icons/icon_v_button_array.pngbin147 -> 0 bytes
-rw-r--r--editor/import/editor_import_collada.cpp24
-rw-r--r--editor/import/editor_import_plugin.cpp2
-rw-r--r--editor/import/editor_import_plugin.h2
-rw-r--r--editor/import/resource_importer_csv_translation.cpp2
-rw-r--r--editor/import/resource_importer_obj.cpp11
-rw-r--r--editor/import/resource_importer_scene.cpp34
-rw-r--r--editor/import/resource_importer_scene.h5
-rw-r--r--editor/import/resource_importer_texture.cpp81
-rw-r--r--editor/import/resource_importer_texture.h6
-rw-r--r--editor/import/resource_importer_wav.cpp15
-rw-r--r--editor/io_plugins/editor_font_import_plugin.cpp14
-rw-r--r--editor/io_plugins/editor_mesh_import_plugin.cpp2
-rw-r--r--editor/io_plugins/editor_sample_import_plugin.cpp6
-rw-r--r--editor/io_plugins/editor_texture_import_plugin.cpp8
-rw-r--r--editor/io_plugins/editor_translation_import_plugin.cpp2
-rw-r--r--editor/pane_drag.h2
-rw-r--r--editor/plugins/animation_player_editor_plugin.cpp19
-rw-r--r--editor/plugins/animation_tree_editor_plugin.cpp12
-rw-r--r--editor/plugins/canvas_item_editor_plugin.cpp248
-rw-r--r--editor/plugins/canvas_item_editor_plugin.h1
-rw-r--r--editor/plugins/collision_polygon_2d_editor_plugin.cpp14
-rw-r--r--editor/plugins/collision_shape_2d_editor_plugin.cpp4
-rw-r--r--editor/plugins/curve_editor_plugin.cpp1126
-rw-r--r--editor/plugins/curve_editor_plugin.h134
-rw-r--r--editor/plugins/editor_preview_plugins.cpp542
-rw-r--r--editor/plugins/editor_preview_plugins.h60
-rw-r--r--editor/plugins/gradient_editor_plugin.cpp (renamed from editor/plugins/color_ramp_editor_plugin.cpp)51
-rw-r--r--editor/plugins/gradient_editor_plugin.h (renamed from editor/plugins/color_ramp_editor_plugin.h)17
-rw-r--r--editor/plugins/gradient_texture_editor_plugin.cpp539
-rw-r--r--editor/plugins/gradient_texture_editor_plugin.h98
-rw-r--r--editor/plugins/item_list_editor_plugin.cpp40
-rw-r--r--editor/plugins/item_list_editor_plugin.h29
-rw-r--r--editor/plugins/light_occluder_2d_editor_plugin.cpp16
-rw-r--r--editor/plugins/line_2d_editor_plugin.cpp8
-rw-r--r--editor/plugins/navigation_polygon_editor_plugin.cpp14
-rw-r--r--editor/plugins/particles_2d_editor_plugin.cpp303
-rw-r--r--editor/plugins/particles_2d_editor_plugin.h18
-rw-r--r--editor/plugins/particles_editor_plugin.cpp4
-rw-r--r--editor/plugins/path_2d_editor_plugin.cpp4
-rw-r--r--editor/plugins/path_editor_plugin.cpp4
-rw-r--r--editor/plugins/polygon_2d_editor_plugin.cpp28
-rw-r--r--editor/plugins/script_editor_plugin.cpp103
-rw-r--r--editor/plugins/script_editor_plugin.h13
-rw-r--r--editor/plugins/script_text_editor.cpp14
-rw-r--r--editor/plugins/script_text_editor.h4
-rw-r--r--editor/plugins/shader_editor_plugin.cpp5
-rw-r--r--editor/plugins/shader_graph_editor_plugin.cpp2
-rw-r--r--editor/plugins/spatial_editor_plugin.cpp612
-rw-r--r--editor/plugins/spatial_editor_plugin.h59
-rw-r--r--editor/plugins/texture_editor_plugin.cpp12
-rw-r--r--editor/plugins/texture_region_editor_plugin.cpp103
-rw-r--r--editor/plugins/tile_map_editor_plugin.cpp102
-rw-r--r--editor/plugins/tile_set_editor_plugin.cpp41
-rw-r--r--editor/project_export.cpp2
-rw-r--r--editor/project_manager.cpp5
-rw-r--r--editor/project_settings.cpp130
-rw-r--r--editor/project_settings.h5
-rw-r--r--editor/property_editor.cpp123
-rw-r--r--editor/property_editor.h7
-rw-r--r--editor/property_selector.cpp2
-rw-r--r--editor/scene_tree_dock.cpp194
-rw-r--r--editor/scene_tree_dock.h19
-rw-r--r--editor/scene_tree_editor.cpp167
-rw-r--r--editor/scene_tree_editor.h14
-rw-r--r--editor/script_create_dialog.cpp87
-rw-r--r--editor/script_create_dialog.h5
-rw-r--r--editor/script_editor_debugger.cpp38
-rw-r--r--editor/script_editor_debugger.h7
-rw-r--r--editor/settings_config_dialog.cpp4
-rw-r--r--editor/spatial_editor_gizmos.cpp82
-rw-r--r--editor/spatial_editor_gizmos.h20
-rw-r--r--editor/translations/ar.po594
-rw-r--r--editor/translations/bg.po632
-rw-r--r--editor/translations/bn.po793
-rw-r--r--editor/translations/ca.po677
-rw-r--r--editor/translations/cs.po638
-rw-r--r--editor/translations/da.po626
-rw-r--r--editor/translations/de.po849
-rw-r--r--editor/translations/de_CH.po636
-rw-r--r--editor/translations/editor.pot588
-rw-r--r--editor/translations/el.po2850
-rw-r--r--editor/translations/es.po797
-rw-r--r--editor/translations/es_AR.po1044
-rw-r--r--editor/translations/fa.po641
-rw-r--r--editor/translations/fi.po7260
-rw-r--r--editor/translations/fr.po904
-rw-r--r--editor/translations/hu.po591
-rw-r--r--editor/translations/id.po634
-rw-r--r--editor/translations/it.po1028
-rw-r--r--editor/translations/ja.po641
-rw-r--r--editor/translations/ko.po796
-rw-r--r--editor/translations/nb.po654
-rw-r--r--editor/translations/nl.po664
-rw-r--r--editor/translations/pl.po1408
-rw-r--r--editor/translations/pr.po604
-rw-r--r--editor/translations/pt_BR.po795
-rw-r--r--editor/translations/pt_PT.po604
-rw-r--r--editor/translations/ru.po1159
-rw-r--r--editor/translations/sk.po600
-rw-r--r--editor/translations/sl.po604
-rw-r--r--editor/translations/th.po1500
-rw-r--r--editor/translations/tr.po795
-rw-r--r--editor/translations/ur_PK.po596
-rw-r--r--editor/translations/zh_CN.po1006
-rw-r--r--editor/translations/zh_HK.po655
-rw-r--r--editor/translations/zh_TW.po937
-rw-r--r--main/SCsub8
-rw-r--r--main/input_default.cpp12
-rw-r--r--main/main.cpp10
-rw-r--r--main/performance.cpp2
-rw-r--r--main/tests/test_gui.cpp9
-rw-r--r--main/tests/test_physics_2d.cpp4
-rw-r--r--methods.py51
-rw-r--r--modules/SCsub2
-rw-r--r--modules/enet/networked_multiplayer_enet.cpp11
-rw-r--r--modules/enet/networked_multiplayer_enet.h3
-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)2
-rw-r--r--modules/etc/register_types.cpp (renamed from modules/etc1/register_types.cpp)6
-rw-r--r--modules/etc/register_types.h (renamed from modules/etc1/register_types.h)4
-rw-r--r--modules/etc/texture_loader_pkm.cpp (renamed from modules/etc1/texture_loader_pkm.cpp)0
-rw-r--r--modules/etc/texture_loader_pkm.h (renamed from modules/etc1/texture_loader_pkm.h)0
-rw-r--r--modules/etc1/SCsub20
-rw-r--r--modules/etc1/image_etc.cpp183
-rw-r--r--modules/freetype/SCsub6
-rw-r--r--modules/gdnative/gdnative.cpp8
-rw-r--r--modules/gdnative/gdnative.h2
-rw-r--r--modules/gdnative/godot.h7
-rw-r--r--modules/gdnative/godot/godot_array.cpp256
-rw-r--r--modules/gdnative/godot/godot_array.h72
-rw-r--r--modules/gdnative/godot/godot_color.cpp57
-rw-r--r--modules/gdnative/godot/godot_color.h16
-rw-r--r--modules/gdnative/godot/godot_dictionary.cpp32
-rw-r--r--modules/gdnative/godot/godot_dictionary.h9
-rw-r--r--modules/gdnative/godot/godot_node_path.cpp6
-rw-r--r--modules/gdnative/godot/godot_node_path.h1
-rw-r--r--modules/gdnative/godot/godot_pool_arrays.cpp588
-rw-r--r--modules/gdnative/godot/godot_pool_arrays.h196
-rw-r--r--modules/gdnative/godot/godot_quat.cpp40
-rw-r--r--modules/gdnative/godot/godot_quat.h12
-rw-r--r--modules/gdnative/godot/godot_rect2.cpp16
-rw-r--r--modules/gdnative/godot/godot_rect2.h6
-rw-r--r--modules/gdnative/godot/godot_rect3.cpp28
-rw-r--r--modules/gdnative/godot/godot_rect3.h6
-rw-r--r--modules/gdnative/godot/godot_string.cpp98
-rw-r--r--modules/gdnative/godot/godot_string.h25
-rw-r--r--modules/gdnative/godot/godot_transform.cpp26
-rw-r--r--modules/gdnative/godot/godot_transform.h6
-rw-r--r--modules/gdnative/godot/godot_variant.cpp4
-rw-r--r--modules/gdnative/godot/godot_variant.h3
-rw-r--r--modules/gdnative/godot/godot_vector3.cpp5
-rw-r--r--modules/gdnative/godot/godot_vector3.h2
-rw-r--r--modules/gdscript/gd_editor.cpp19
-rw-r--r--modules/gdscript/gd_function.cpp34
-rw-r--r--modules/gdscript/gd_parser.cpp4
-rw-r--r--modules/gdscript/gd_script.cpp5
-rw-r--r--modules/gdscript/gd_script.h3
-rw-r--r--modules/gridmap/grid_map.cpp16
-rw-r--r--modules/gridmap/grid_map_editor_plugin.cpp8
-rw-r--r--modules/hdr/image_loader_hdr.cpp2
-rw-r--r--modules/hdr/image_loader_hdr.h4
-rw-r--r--modules/regex/regex.cpp28
-rw-r--r--modules/squish/image_compress_squish.cpp14
-rw-r--r--modules/squish/image_compress_squish.h2
-rw-r--r--modules/stb_vorbis/audio_stream_ogg_vorbis.h2
-rw-r--r--modules/stb_vorbis/resource_importer_ogg_vorbis.cpp4
-rw-r--r--modules/tga/SCsub9
-rw-r--r--modules/tga/config.py (renamed from modules/etc1/config.py)0
-rw-r--r--modules/tga/image_loader_tga.cpp314
-rw-r--r--modules/tga/image_loader_tga.h (renamed from scene/3d/test_cube.h)58
-rw-r--r--modules/tga/register_types.cpp (renamed from scene/3d/test_cube.cpp)23
-rw-r--r--modules/tga/register_types.h31
-rw-r--r--modules/tinyexr/config.py6
-rw-r--r--modules/visual_script/register_types.cpp1
-rw-r--r--modules/visual_script/visual_script.cpp25
-rw-r--r--modules/visual_script/visual_script.h5
-rw-r--r--modules/visual_script/visual_script_editor.cpp310
-rw-r--r--modules/visual_script/visual_script_editor.h25
-rw-r--r--modules/visual_script/visual_script_expression.cpp16
-rw-r--r--modules/visual_script/visual_script_flow_control.cpp23
-rw-r--r--modules/visual_script/visual_script_flow_control.h3
-rw-r--r--modules/visual_script/visual_script_func_nodes.cpp331
-rw-r--r--modules/visual_script/visual_script_func_nodes.h30
-rw-r--r--modules/visual_script/visual_script_nodes.cpp197
-rw-r--r--modules/visual_script/visual_script_nodes.h33
-rw-r--r--modules/visual_script/visual_script_yield_nodes.cpp16
-rw-r--r--platform/android/detect.py152
-rw-r--r--platform/android/export/export.cpp18
-rw-r--r--platform/android/java_glue.cpp2
-rw-r--r--platform/android/os_android.cpp32
-rw-r--r--platform/android/run_icon.pngbin0 -> 636 bytes
-rw-r--r--platform/haiku/detect.py51
-rw-r--r--platform/iphone/SCsub9
-rw-r--r--platform/iphone/detect.py187
-rw-r--r--platform/iphone/export/export.cpp347
-rw-r--r--platform/iphone/export/export.h30
-rw-r--r--platform/iphone/os_iphone.cpp16
-rw-r--r--platform/javascript/detect.py62
-rw-r--r--platform/javascript/export/export.cpp43
-rw-r--r--platform/javascript/os_javascript.cpp191
-rw-r--r--platform/javascript/run_icon.pngbin0 -> 471 bytes
-rw-r--r--platform/osx/detect.py70
-rw-r--r--platform/osx/export/export.cpp804
-rw-r--r--platform/osx/os_osx.h16
-rw-r--r--platform/osx/os_osx.mm149
-rw-r--r--platform/server/detect.py78
-rw-r--r--platform/uwp/app.cpp18
-rw-r--r--platform/uwp/detect.py106
-rw-r--r--platform/windows/detect.py272
-rw-r--r--platform/windows/export/export.cpp2
-rw-r--r--platform/windows/godot.icobin370070 -> 110755 bytes
-rw-r--r--platform/windows/os_windows.cpp170
-rw-r--r--platform/windows/os_windows.h2
-rw-r--r--platform/x11/detect.py151
-rw-r--r--platform/x11/export/export.cpp2
-rw-r--r--platform/x11/godot_x11.cpp3
-rw-r--r--platform/x11/os_x11.cpp219
-rw-r--r--platform/x11/os_x11.h7
-rw-r--r--scene/2d/animated_sprite.cpp9
-rw-r--r--scene/2d/animated_sprite.h16
-rw-r--r--scene/2d/area_2d.cpp97
-rw-r--r--scene/2d/area_2d.h20
-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/camera_2d.cpp188
-rw-r--r--scene/2d/camera_2d.h13
-rw-r--r--scene/2d/canvas_item.cpp290
-rw-r--r--scene/2d/canvas_item.h110
-rw-r--r--scene/2d/collision_object_2d.cpp339
-rw-r--r--scene/2d/collision_object_2d.h62
-rw-r--r--scene/2d/collision_polygon_2d.cpp188
-rw-r--r--scene/2d/collision_polygon_2d.h32
-rw-r--r--scene/2d/collision_shape_2d.cpp176
-rw-r--r--scene/2d/collision_shape_2d.h26
-rw-r--r--scene/2d/light_2d.cpp16
-rw-r--r--scene/2d/light_2d.h4
-rw-r--r--scene/2d/line_2d.cpp5
-rw-r--r--scene/2d/line_builder.cpp10
-rw-r--r--scene/2d/node_2d.cpp8
-rw-r--r--scene/2d/particles_2d.cpp1191
-rw-r--r--scene/2d/particles_2d.h251
-rw-r--r--scene/2d/physics_body_2d.cpp477
-rw-r--r--scene/2d/physics_body_2d.h90
-rw-r--r--scene/2d/polygon_2d.cpp12
-rw-r--r--scene/2d/ray_cast_2d.cpp18
-rw-r--r--scene/2d/ray_cast_2d.h6
-rw-r--r--scene/2d/remote_transform_2d.cpp101
-rw-r--r--scene/2d/remote_transform_2d.h17
-rw-r--r--scene/2d/screen_button.cpp102
-rw-r--r--scene/2d/screen_button.h2
-rw-r--r--scene/2d/sprite.cpp45
-rw-r--r--scene/2d/sprite.h8
-rw-r--r--scene/2d/tile_map.cpp57
-rw-r--r--scene/3d/area.cpp48
-rw-r--r--scene/3d/area.h10
-rw-r--r--scene/3d/camera.cpp2
-rw-r--r--scene/3d/collision_polygon.cpp2
-rw-r--r--scene/3d/gi_probe.cpp44
-rw-r--r--scene/3d/gi_probe.h4
-rw-r--r--scene/3d/immediate_geometry.cpp2
-rw-r--r--scene/3d/light.cpp14
-rw-r--r--scene/3d/light.h1
-rw-r--r--scene/3d/listener.cpp2
-rw-r--r--scene/3d/mesh_instance.cpp84
-rw-r--r--scene/3d/mesh_instance.h2
-rw-r--r--scene/3d/navigation_mesh.cpp6
-rw-r--r--scene/3d/navigation_mesh.h2
-rw-r--r--scene/3d/particles.cpp262
-rw-r--r--scene/3d/particles.h17
-rw-r--r--scene/3d/path.cpp66
-rw-r--r--scene/3d/physics_body.cpp16
-rw-r--r--scene/3d/physics_body.h4
-rw-r--r--scene/3d/quad.cpp226
-rw-r--r--scene/3d/quad.h76
-rw-r--r--scene/3d/ray_cast.cpp22
-rw-r--r--scene/3d/ray_cast.h6
-rw-r--r--scene/3d/reflection_probe.cpp2
-rw-r--r--scene/3d/remote_transform.cpp96
-rw-r--r--scene/3d/remote_transform.h17
-rw-r--r--scene/3d/scenario_fx.cpp35
-rw-r--r--scene/3d/scenario_fx.h4
-rw-r--r--scene/3d/spatial.cpp13
-rw-r--r--scene/3d/spatial.h2
-rw-r--r--scene/3d/sprite_3d.cpp52
-rw-r--r--scene/3d/sprite_3d.h1
-rw-r--r--scene/3d/visual_instance.cpp2
-rw-r--r--scene/animation/animation_player.cpp1
-rw-r--r--scene/animation/tween.cpp10
-rw-r--r--scene/audio/audio_player.cpp84
-rw-r--r--scene/audio/audio_player.h12
-rw-r--r--scene/gui/base_button.cpp2
-rw-r--r--scene/gui/button_array.cpp546
-rw-r--r--scene/gui/button_array.h131
-rw-r--r--scene/gui/color_picker.cpp106
-rw-r--r--scene/gui/color_picker.h1
-rw-r--r--scene/gui/container.cpp20
-rw-r--r--scene/gui/control.cpp133
-rw-r--r--scene/gui/control.h24
-rw-r--r--scene/gui/dialogs.cpp30
-rw-r--r--scene/gui/gradient_edit.cpp (renamed from scene/gui/color_ramp_edit.cpp)46
-rw-r--r--scene/gui/gradient_edit.h (renamed from scene/gui/color_ramp_edit.h)8
-rw-r--r--scene/gui/graph_edit.cpp46
-rw-r--r--scene/gui/graph_edit.h2
-rw-r--r--scene/gui/graph_node.cpp10
-rw-r--r--scene/gui/input_action.cpp2
-rw-r--r--scene/gui/item_list.cpp109
-rw-r--r--scene/gui/item_list.h3
-rw-r--r--scene/gui/label.cpp7
-rw-r--r--scene/gui/line_edit.cpp4
-rw-r--r--scene/gui/patch_9_rect.cpp36
-rw-r--r--scene/gui/patch_9_rect.h17
-rw-r--r--scene/gui/popup.cpp10
-rw-r--r--scene/gui/popup_menu.cpp37
-rw-r--r--scene/gui/popup_menu.h4
-rw-r--r--scene/gui/rich_text_label.cpp43
-rw-r--r--scene/gui/rich_text_label.h6
-rw-r--r--scene/gui/scroll_bar.cpp14
-rw-r--r--scene/gui/scroll_container.cpp4
-rw-r--r--scene/gui/slider.cpp26
-rw-r--r--scene/gui/slider.h4
-rw-r--r--scene/gui/spin_box.cpp6
-rw-r--r--scene/gui/split_container.cpp32
-rw-r--r--scene/gui/split_container.h2
-rw-r--r--scene/gui/tab_container.cpp4
-rw-r--r--scene/gui/tabs.cpp214
-rw-r--r--scene/gui/tabs.h12
-rw-r--r--scene/gui/text_edit.cpp32
-rw-r--r--scene/gui/tree.cpp307
-rw-r--r--scene/gui/tree.h35
-rwxr-xr-xscene/main/node.cpp98
-rw-r--r--scene/main/node.h21
-rw-r--r--scene/main/scene_tree.cpp (renamed from scene/main/scene_main_loop.cpp)28
-rw-r--r--scene/main/scene_tree.h (renamed from scene/main/scene_main_loop.h)6
-rw-r--r--scene/main/viewport.cpp133
-rw-r--r--scene/main/viewport.h45
-rw-r--r--scene/register_scene_types.cpp39
-rw-r--r--scene/resources/animation.cpp4
-rw-r--r--scene/resources/animation.h2
-rw-r--r--scene/resources/audio_stream_sample.cpp5
-rw-r--r--scene/resources/audio_stream_sample.h3
-rw-r--r--scene/resources/bit_mask.cpp4
-rw-r--r--scene/resources/box_shape.cpp4
-rw-r--r--scene/resources/capsule_shape_2d.cpp2
-rw-r--r--scene/resources/circle_shape_2d.cpp2
-rw-r--r--scene/resources/concave_polygon_shape_2d.cpp2
-rw-r--r--scene/resources/convex_polygon_shape_2d.cpp2
-rw-r--r--scene/resources/curve.cpp481
-rw-r--r--scene/resources/curve.h111
-rw-r--r--scene/resources/default_theme/default_theme.cpp16
-rw-r--r--scene/resources/default_theme/hslider_grabber_disabled.pngbin0 -> 386 bytes
-rw-r--r--scene/resources/default_theme/theme_data.h8
-rw-r--r--scene/resources/default_theme/vslider_grabber_disabled.pngbin0 -> 335 bytes
-rw-r--r--scene/resources/environment.cpp340
-rw-r--r--scene/resources/environment.h80
-rw-r--r--scene/resources/font.cpp8
-rw-r--r--scene/resources/font.h2
-rw-r--r--scene/resources/material.cpp569
-rw-r--r--scene/resources/material.h135
-rw-r--r--scene/resources/mesh.cpp1019
-rw-r--r--scene/resources/mesh.h63
-rw-r--r--scene/resources/mesh_data_tool.cpp6
-rw-r--r--scene/resources/mesh_data_tool.h4
-rw-r--r--scene/resources/mesh_library.h2
-rw-r--r--scene/resources/multimesh.h2
-rw-r--r--scene/resources/polygon_path_finder.cpp2
-rw-r--r--scene/resources/primitive_meshes.cpp1466
-rw-r--r--scene/resources/primitive_meshes.h313
-rw-r--r--scene/resources/scene_format_text.cpp10
-rw-r--r--scene/resources/scene_format_text.h3
-rw-r--r--scene/resources/segment_shape_2d.cpp6
-rw-r--r--scene/resources/shader_graph.h2
-rw-r--r--scene/resources/shape.cpp6
-rw-r--r--scene/resources/shape.h8
-rw-r--r--scene/resources/shape_line_2d.cpp2
-rw-r--r--scene/resources/style_box.cpp49
-rw-r--r--scene/resources/style_box.h6
-rw-r--r--scene/resources/surface_tool.cpp8
-rw-r--r--scene/resources/surface_tool.h2
-rw-r--r--scene/resources/texture.cpp575
-rw-r--r--scene/resources/texture.h140
-rw-r--r--scene/resources/theme.h2
-rw-r--r--scene/resources/tile_set.cpp219
-rw-r--r--scene/resources/tile_set.h48
-rw-r--r--scene/resources/world.h2
-rw-r--r--scene/resources/world_2d.cpp16
-rw-r--r--scene/resources/world_2d.h4
-rw-r--r--scene/scene_string_names.cpp2
-rw-r--r--scene/scene_string_names.h2
-rw-r--r--servers/audio/effects/audio_effect_compressor.cpp20
-rw-r--r--servers/audio/effects/audio_effect_compressor.h6
-rw-r--r--servers/audio/effects/audio_effect_limiter.cpp20
-rw-r--r--servers/audio/effects/audio_effect_limiter.h6
-rw-r--r--servers/audio_server.cpp14
-rw-r--r--servers/audio_server.h3
-rw-r--r--servers/physics/body_sw.cpp2
-rw-r--r--servers/physics/collision_object_sw.cpp4
-rw-r--r--servers/physics/collision_object_sw.h8
-rw-r--r--servers/physics/collision_solver_sat.cpp2
-rw-r--r--servers/physics/collision_solver_sw.cpp6
-rw-r--r--servers/physics/joints/cone_twist_joint_sw.cpp1
-rw-r--r--servers/physics/physics_server_sw.cpp20
-rw-r--r--servers/physics/physics_server_sw.h14
-rw-r--r--servers/physics/shape_sw.cpp26
-rw-r--r--servers/physics/space_sw.cpp34
-rw-r--r--servers/physics/space_sw.h14
-rw-r--r--servers/physics_2d/area_pair_2d_sw.cpp15
-rw-r--r--servers/physics_2d/body_2d_sw.cpp4
-rw-r--r--servers/physics_2d/body_2d_sw.h15
-rw-r--r--servers/physics_2d/body_pair_2d_sw.cpp15
-rw-r--r--servers/physics_2d/broad_phase_2d_hash_grid.cpp14
-rw-r--r--servers/physics_2d/collision_object_2d_sw.cpp7
-rw-r--r--servers/physics_2d/collision_object_2d_sw.h23
-rw-r--r--servers/physics_2d/collision_solver_2d_sw.cpp2
-rw-r--r--servers/physics_2d/physics_2d_server_sw.cpp68
-rw-r--r--servers/physics_2d/physics_2d_server_sw.h22
-rw-r--r--servers/physics_2d/physics_2d_server_wrap_mt.h21
-rw-r--r--servers/physics_2d/shape_2d_sw.cpp24
-rw-r--r--servers/physics_2d/shape_2d_sw.h10
-rw-r--r--servers/physics_2d/space_2d_sw.cpp161
-rw-r--r--servers/physics_2d/space_2d_sw.h20
-rw-r--r--servers/physics_2d_server.cpp47
-rw-r--r--servers/physics_2d_server.h45
-rw-r--r--servers/physics_server.cpp30
-rw-r--r--servers/physics_server.h34
-rw-r--r--servers/server_wrap_mt_common.h30
-rw-r--r--servers/visual/rasterizer.h114
-rw-r--r--servers/visual/shader_language.cpp42
-rw-r--r--servers/visual/shader_types.cpp34
-rw-r--r--servers/visual/visual_server_canvas.cpp151
-rw-r--r--servers/visual/visual_server_canvas.h23
-rw-r--r--servers/visual/visual_server_raster.cpp36
-rw-r--r--servers/visual/visual_server_raster.h50
-rw-r--r--servers/visual/visual_server_scene.cpp65
-rw-r--r--servers/visual/visual_server_scene.h3
-rw-r--r--servers/visual/visual_server_viewport.cpp148
-rw-r--r--servers/visual/visual_server_viewport.h16
-rw-r--r--servers/visual/visual_server_wrap_mt.cpp193
-rw-r--r--servers/visual/visual_server_wrap_mt.h591
-rw-r--r--servers/visual_server.cpp33
-rw-r--r--servers/visual_server.h70
-rw-r--r--thirdparty/README.md38
-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/rg-etc1/rg_etc1.cpp2446
-rw-r--r--thirdparty/rg-etc1/rg_etc1.h76
-rw-r--r--thirdparty/zstd/LICENSE30
-rw-r--r--thirdparty/zstd/PATENTS33
-rw-r--r--thirdparty/zstd/README.md146
-rw-r--r--thirdparty/zstd/common/bitstream.h446
-rw-r--r--thirdparty/zstd/common/entropy_common.c221
-rw-r--r--thirdparty/zstd/common/error_private.c44
-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.h283
-rw-r--r--thirdparty/zstd/common/mem.h373
-rw-r--r--thirdparty/zstd/common/pool.c194
-rw-r--r--thirdparty/zstd/common/pool.h56
-rw-r--r--thirdparty/zstd/common/threading.c80
-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.c73
-rw-r--r--thirdparty/zstd/common/zstd_errors.h75
-rw-r--r--thirdparty/zstd/common/zstd_internal.h284
-rw-r--r--thirdparty/zstd/compress/fse_compress.c857
-rw-r--r--thirdparty/zstd/compress/huf_compress.c684
-rw-r--r--thirdparty/zstd/compress/zstd_compress.c3598
-rw-r--r--thirdparty/zstd/compress/zstd_opt.h921
-rw-r--r--thirdparty/zstd/compress/zstdmt_compress.c751
-rw-r--r--thirdparty/zstd/compress/zstdmt_compress.h78
-rw-r--r--thirdparty/zstd/decompress/huf_decompress.c888
-rw-r--r--thirdparty/zstd/decompress/zstd_decompress.c2376
-rw-r--r--thirdparty/zstd/zstd.h795
1127 files changed, 101814 insertions, 32556 deletions
diff --git a/.gitignore b/.gitignore
index 537ed7d32a..7552e8fd17 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,31 +1,5 @@
# Godot auto generated files
-core/global_defaults.cpp
-core/method_bind_ext.inc
-core/method_bind.inc
-core/script_encryption_key.cpp
-core/version_generated.h
-drivers/gles2/shaders/*.h
-drivers/gles3/shaders/*.h
-drivers/unix/os_unix_global_settings_path.cpp
-editor/builtin_fonts.h
-editor/certs_compressed.h
-editor/doc_data_compressed.h
-editor/editor_icons.cpp
-editor/register_exporters.cpp
-editor/translations.h
-log.txt
-main/app_icon.h
-main/splash.h
-make.bat
-modules/register_module_types.cpp
-platform/android/logo.h
-platform/bb10/logo.h
-platform/iphone/logo.h
-platform/javascript/logo.h
-platform/osx/logo.h
-platform/server/logo.h
-platform/windows/logo.h
-platform/x11/logo.h
+*.gen.*
# Documentation generated by doxygen or from classes.xml
doc/_build/
diff --git a/.travis.yml b/.travis.yml
index 6be9f1f603..12d49f5d5d 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 platform=$GODOT_TARGET CXX=$CXX openssl=builtin;
+ else
+ scons platform=$GODOT_TARGET bits=64 CXX=$CXX openssl=builtin;
+ fi
fi
diff --git a/AUTHORS.md b/AUTHORS.md
index 728ba5f6ee..84b0754929 100644
--- a/AUTHORS.md
+++ b/AUTHORS.md
@@ -10,17 +10,26 @@ 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.
-## Original authors
+## 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)
@@ -41,8 +50,10 @@ name is available.
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)
@@ -55,17 +66,21 @@ name is available.
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)
diff --git a/COPYRIGHT.txt b/COPYRIGHT.txt
index 698e4b1dc8..84a57d2663 100644
--- a/COPYRIGHT.txt
+++ b/COPYRIGHT.txt
@@ -41,6 +41,7 @@ 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
@@ -49,6 +50,7 @@ Files: ./icon.png
./icon.svg
./logo.png
./logo.svg
+Comment: Godot Engine logo
Copyright: Andrea Calabró
License: CC-BY-3.0
@@ -61,21 +63,25 @@ Files: ./platform/android/android_native_app_glue.c
./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
@@ -83,12 +89,14 @@ 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: ./platform/uwp/export/export.cpp
+Comment: fb-util-for-appx
Copyright: 2016, Facebook, Inc. All rights reserved.
2007-2017, Juan Linietsky, Ariel Manzur.
2014-2017, Godot Engine contributors (cf. AUTHORS.md)
@@ -104,6 +112,7 @@ Files: ./servers/physics/gjk_epa.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)
@@ -111,79 +120,97 @@ 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/COPYING
+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
@@ -193,68 +220,82 @@ 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,
@@ -262,27 +303,28 @@ Copyright: 2001-2011, Xiph.Org, Skype Limited, Octasic,
License: BSD-3-clause
Files: ./thirdparty/pvrtccompressor/
+Comment: PvrTcCompressor
Copyright: 2014, Jeffrey Lim.
License: BSD-3-clause
-Files: ./thirdparty/rg-etc1/
-Copyright: 2012, Rich Geldreich
-License: Zlib
-
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
diff --git a/SConstruct b/SConstruct
index 11cd95464d..a403117065 100644
--- a/SConstruct
+++ b/SConstruct
@@ -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
@@ -377,7 +384,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')
diff --git a/core/SCsub b/core/SCsub
index fd3f57dd7c..02abaa2bb6 100644
--- a/core/SCsub
+++ b/core/SCsub
@@ -18,7 +18,7 @@ gd_cpp = '#include "global_config.h"\n'
gd_cpp += gd_inc
gd_cpp += "void GlobalConfig::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()
@@ -47,7 +47,7 @@ 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 = open("script_encryption_key.gen.cpp", "wb")
f.write("#include \"global_config.h\"\nuint8_t script_encryption_key[32]={" + txt + "};\n")
f.close()
@@ -83,6 +83,25 @@ thirdparty_minizip_sources = [
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")
@@ -90,7 +109,7 @@ env.add_source_files(env.core_sources, "*.cpp")
# 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
@@ -104,5 +123,5 @@ SConscript('helper/SCsub')
# 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/bind/core_bind.cpp b/core/bind/core_bind.cpp
index 2752391901..095f058ed9 100644
--- a/core/bind/core_bind.cpp
+++ b/core/bind/core_bind.cpp
@@ -31,6 +31,7 @@
#include "core/global_config.h"
#include "geometry.h"
+#include "io/file_access_compressed.h"
#include "io/file_access_encrypted.h"
#include "io/marshalls.h"
#include "os/keyboard.h"
@@ -1395,6 +1396,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();
@@ -1700,6 +1719,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);
@@ -1749,6 +1769,10 @@ 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);
}
_File::_File() {
@@ -2532,6 +2556,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);
@@ -2550,6 +2578,8 @@ void _Engine::_bind_methods() {
ClassDB::bind_method(D_METHOD("get_main_loop:MainLoop"), &_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 e48b5c85ad..87d84c0732 100644
--- a/core/bind/core_bind.h
+++ b/core/bind/core_bind.h
@@ -31,6 +31,7 @@
#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"
@@ -366,8 +367,15 @@ public:
WRITE_READ = 7,
};
+ enum CompressionMode {
+ COMPRESSION_FASTLZ = Compression::MODE_FASTLZ,
+ COMPRESSION_DEFLATE = Compression::MODE_DEFLATE,
+ COMPRESSION_ZSTD = Compression::MODE_ZSTD
+ };
+
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
@@ -634,6 +642,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 1fe02c8cd9..6b8c290a99 100644
--- a/core/class_db.cpp
+++ b/core/class_db.cpp
@@ -497,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;
@@ -528,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);
@@ -802,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;
diff --git a/core/class_db.h b/core/class_db.h
index 547068da5f..4f00a16e91 100644
--- a/core/class_db.h
+++ b/core/class_db.h
@@ -139,6 +139,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
@@ -486,7 +487,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/command_queue_mt.h b/core/command_queue_mt.h
index bae8cf7fca..2e0c478108 100644
--- a/core/command_queue_mt.h
+++ b/core/command_queue_mt.h
@@ -170,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>
@@ -779,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/core_string_names.cpp b/core/core_string_names.cpp
index e35ac2b72c..0ed44b0cb7 100644
--- a/core/core_string_names.cpp
+++ b/core/core_string_names.cpp
@@ -44,4 +44,7 @@ CoreStringNames::CoreStringNames() {
_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
}
diff --git a/core/core_string_names.h b/core/core_string_names.h
index 6672772432..4b4f87a8f0 100644
--- a/core/core_string_names.h
+++ b/core/core_string_names.h
@@ -61,6 +61,9 @@ public:
StringName _iter_next;
StringName _iter_get;
StringName get_rid;
+#ifdef TOOLS_ENABLED
+ StringName _sections_unfolded;
+#endif
};
#endif // SCENE_STRING_NAMES_H
diff --git a/core/dvector.h b/core/dvector.h
index 2e951b9661..66af42f7e2 100644
--- a/core/dvector.h
+++ b/core/dvector.h
@@ -92,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
@@ -216,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++) {
@@ -403,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;
@@ -500,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/error_macros.h b/core/error_macros.h
index 00fced3586..6c803951a1 100644
--- a/core/error_macros.h
+++ b/core/error_macros.h
@@ -115,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)) { \
@@ -122,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 { \
@@ -136,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.
@@ -173,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
@@ -234,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/global_config.cpp b/core/global_config.cpp
index 896384d9c8..ba0a7f3e31 100644
--- a/core/global_config.cpp
+++ b/core/global_config.cpp
@@ -39,6 +39,8 @@
#include "os/os.h"
#include "variant_parser.h"
+#include <zlib.h>
+
#define FORMAT_VERSION 3
GlobalConfig *GlobalConfig::singleton = NULL;
@@ -967,6 +969,12 @@ GlobalConfig::GlobalConfig() {
custom_prop_info["physics/2d/thread_model"] = PropertyInfo(Variant::INT, "physics/2d/thread_model", PROPERTY_HINT_ENUM, "Single-Unsafe,Single-Safe,Multi-Threaded");
GLOBAL_DEF("debug/profiler/max_functions", 16384);
+
+ GLOBAL_DEF("compression/zstd/compression_level", 3);
+ custom_prop_info["compression/zstd/compression_level"] = PropertyInfo(Variant::INT, "compression/zstd/compression_level", PROPERTY_HINT_RANGE, "1,22,1");
+ GLOBAL_DEF("compression/zlib/compression_level", Z_DEFAULT_COMPRESSION);
+ custom_prop_info["compression/zlib/compression_level"] = PropertyInfo(Variant::INT, "compression/zlib/compression_level", PROPERTY_HINT_RANGE, "-1,9,1");
+
using_datapack = false;
}
diff --git a/core/hash_map.h b/core/hash_map.h
index 49701188ab..45e7b82d24 100644
--- a/core/hash_map.h
+++ b/core/hash_map.h
@@ -473,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/helper/math_fieldwise.cpp b/core/helper/math_fieldwise.cpp
index 2f176fb9bf..5545c2d642 100644
--- a/core/helper/math_fieldwise.cpp
+++ b/core/helper/math_fieldwise.cpp
@@ -63,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)
@@ -110,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/image.cpp b/core/image.cpp
index 2640c6be2a..6ab8bb6d46 100644
--- a/core/image.cpp
+++ b/core/image.cpp
@@ -81,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[i] = p_src[ofs + i];
+ p_pixel[i] = p_data[ofs + i];
}
}
@@ -423,7 +423,7 @@ void Image::convert(Format p_new_format) {
for (int i = 0; i < width; i++) {
for (int j = 0; j < height; j++) {
- new_img.put_pixel(i, j, get_pixel(i, j));
+ new_img.set_pixel(i, j, get_pixel(i, j));
}
}
@@ -818,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++) {
@@ -854,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);
@@ -1325,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) \
@@ -1457,7 +1457,7 @@ Error Image::save_png(const String &p_path) const {
if (save_png_func == NULL)
return ERR_UNAVAILABLE;
- return save_png_func(p_path, Ref<Image>(this));
+ 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) {
@@ -1483,23 +1483,23 @@ Error Image::decompress() {
_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, bool p_for_srgb) {
+Error Image::compress(CompressMode p_mode, CompressSource p_source, float p_lossy_quality) {
switch (p_mode) {
case COMPRESS_S3TC: {
ERR_FAIL_COND_V(!_image_compress_bc_func, ERR_UNAVAILABLE);
- _image_compress_bc_func(this, p_for_srgb);
+ _image_compress_bc_func(this, p_source);
} break;
case COMPRESS_PVRTC2: {
@@ -1513,13 +1513,13 @@ Error Image::compress(CompressMode p_mode, bool p_for_srgb) {
} 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;
}
@@ -1599,7 +1599,7 @@ Rect2 Image::get_used_rect() const {
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>(this), p_area, Point2(0, 0));
+ img->blit_rect(Ref<Image>((Image *)this), p_area, Point2(0, 0));
return img;
}
@@ -1612,11 +1612,11 @@ void Image::blit_rect(const Ref<Image> &p_src, const Rect2 &p_src_rect, const Po
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));
-
- 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();
@@ -1626,15 +1626,15 @@ void Image::blit_rect(const Ref<Image> &p_src, const Rect2 &p_src_rect, const Po
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];
uint8_t *dst = &dst_data_ptr[(dst_y * width + dst_x) * pixel_size];
@@ -1646,17 +1646,200 @@ void Image::blit_rect(const Ref<Image> &p_src, const Rect2 &p_src_rect, const Po
}
}
+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();
+
+ 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 *, bool) = 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 Ref<Image> &, float) = NULL;
@@ -1712,7 +1895,7 @@ void Image::unlock() {
write_lock = PoolVector<uint8_t>::Write();
}
-Color Image::get_pixel(int p_x, int p_y) {
+Color Image::get_pixel(int p_x, int p_y) const {
uint8_t *ptr = write_lock.ptr();
#ifdef DEBUG_ENABLED
@@ -1858,12 +2041,12 @@ Color Image::get_pixel(int p_x, int p_y) {
return Color();
}
-void Image::put_pixel(int p_x, int p_y, const Color &p_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 put_pixel()");
+ ERR_EXPLAIN("Image must be locked with 'lock()' before using set_pixel()");
ERR_FAIL_COND(!ptr);
}
@@ -1977,7 +2160,7 @@ void Image::put_pixel(int p_x, int p_y, const Color &p_color) {
} break;
default: {
- ERR_EXPLAIN("Can't put_pixel() on compressed image, sorry.");
+ ERR_EXPLAIN("Can't set_pixel() on compressed image, sorry.");
ERR_FAIL();
}
}
@@ -2040,7 +2223,7 @@ void Image::_bind_methods() {
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_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);
@@ -2072,6 +2255,10 @@ void Image::_bind_methods() {
ClassDB::bind_method(D_METHOD("normalmap_to_xy"), &Image::normalmap_to_xy);
ClassDB::bind_method(D_METHOD("blit_rect", "src:Image", "src_rect", "dst"), &Image::blit_rect);
+ ClassDB::bind_method(D_METHOD("blit_rect_mask", "src:Image", "mask:Image", "src_rect", "dst"), &Image::blit_rect_mask);
+ ClassDB::bind_method(D_METHOD("blend_rect", "src:Image", "src_rect", "dst"), &Image::blend_rect);
+ ClassDB::bind_method(D_METHOD("blend_rect_mask", "src:Image", "mask:Image", "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:Image", "rect"), &Image::get_rect);
@@ -2083,7 +2270,7 @@ void Image::_bind_methods() {
ClassDB::bind_method(D_METHOD("lock"), &Image::lock);
ClassDB::bind_method(D_METHOD("unlock"), &Image::unlock);
- ClassDB::bind_method(D_METHOD("put_pixel", "x", "y", "color"), &Image::put_pixel);
+ 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");
@@ -2140,9 +2327,13 @@ void Image::_bind_methods() {
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 *, bool)) {
+void Image::set_compress_bc_func(void (*p_compress_func)(Image *, CompressSource)) {
_image_compress_bc_func = p_compress_func;
}
@@ -2243,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++) {
@@ -2252,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;
@@ -2274,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];
diff --git a/core/image.h b/core/image.h
index 2a78870f53..7acc4744e9 100644
--- a/core/image.h
+++ b/core/image.h
@@ -109,20 +109,26 @@ public:
/* INTERPOLATE GAUSS */
};
+ enum CompressSource {
+ COMPRESS_SOURCE_GENERIC,
+ COMPRESS_SOURCE_SRGB,
+ COMPRESS_SOURCE_NORMAL
+ };
+
//some functions provided by something else
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 *, bool p_srgb);
+ 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 *);
static PoolVector<uint8_t> (*lossy_packer)(const Ref<Image> &p_image, float p_quality);
@@ -162,8 +168,8 @@ private:
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;
@@ -267,7 +273,7 @@ public:
COMPRESS_ETC2,
};
- Error compress(CompressMode p_mode = COMPRESS_S3TC, bool p_for_srgb = false);
+ Error compress(CompressMode p_mode = COMPRESS_S3TC, CompressSource p_source = COMPRESS_SOURCE_GENERIC, float p_lossy_quality = 0.7);
Error decompress();
bool is_compressed() const;
@@ -277,11 +283,15 @@ public:
void normalmap_to_xy();
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;
Ref<Image> get_rect(const Rect2 &p_area) const;
- static void set_compress_bc_func(void (*p_compress_func)(Image *, bool));
+ 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);
@@ -304,8 +314,8 @@ public:
DetectChannels get_detected_channels();
- Color get_pixel(int p_x, int p_y);
- void put_pixel(int p_x, int p_y, const Color &p_color);
+ 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());
@@ -322,6 +332,7 @@ public:
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/io/compression.cpp b/core/io/compression.cpp
index 662411a62e..f806c4da6d 100644
--- a/core/io/compression.cpp
+++ b/core/io/compression.cpp
@@ -28,11 +28,12 @@
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
#include "compression.h"
-
+#include "global_config.h"
#include "os/copymem.h"
#include "zip_io.h"
#include "thirdparty/misc/fastlz.h"
+#include "thirdparty/zstd/zstd.h"
#include <zlib.h>
@@ -57,7 +58,8 @@ int Compression::compress(uint8_t *p_dst, const uint8_t *p_src, int p_src_size,
strm.zalloc = zipio_alloc;
strm.zfree = zipio_free;
strm.opaque = Z_NULL;
- int err = deflateInit(&strm, Z_DEFAULT_COMPRESSION);
+ int level = GLOBAL_GET("compression/zlib/compression_level");
+ int err = deflateInit(&strm, level);
if (err != Z_OK)
return -1;
@@ -76,6 +78,12 @@ 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);
+ int level = GLOBAL_GET("compression/zstd/compression_level");
+ return ZSTD_compress(p_dst, max_dst_size, p_src, p_src_size, level);
+ } break;
}
ERR_FAIL_V(-1);
@@ -105,6 +113,10 @@ int Compression::get_max_compressed_buffer_size(int p_src_size, Mode p_mode) {
deflateEnd(&strm);
return aout;
} break;
+ case MODE_ZSTD: {
+
+ return ZSTD_compressBound(p_src_size);
+ } break;
}
ERR_FAIL_V(-1);
@@ -148,6 +160,10 @@ 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);
diff --git a/core/io/compression.h b/core/io/compression.h
index a982a074b1..742f0f4d68 100644
--- a/core/io/compression.h
+++ b/core/io/compression.h
@@ -36,12 +36,13 @@ class Compression {
public:
enum Mode {
MODE_FASTLZ,
- MODE_DEFLATE
+ MODE_DEFLATE,
+ MODE_ZSTD
};
- 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/file_access_compressed.cpp b/core/io/file_access_compressed.cpp
index 4c6e8f5507..4e802579c6 100644
--- a/core/io/file_access_compressed.cpp
+++ b/core/io/file_access_compressed.cpp
@@ -369,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 6af9d9b6ca..340c298a0f 100644
--- a/core/io/file_access_compressed.h
+++ b/core/io/file_access_compressed.h
@@ -64,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/http_client.cpp b/core/io/http_client.cpp
index 899f3b3b2d..0c84a5213f 100644
--- a/core/io/http_client.cpp
+++ b/core/io/http_client.cpp
@@ -96,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";
@@ -151,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";
diff --git a/core/io/marshalls.cpp b/core/io/marshalls.cpp
index dccf70ad7a..75dfd563dd 100644
--- a/core/io/marshalls.cpp
+++ b/core/io/marshalls.cpp
@@ -139,8 +139,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;
@@ -211,9 +211,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]);
@@ -861,8 +861,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]);
}
@@ -926,9 +926,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]);
diff --git a/core/io/resource_format_binary.cpp b/core/io/resource_format_binary.cpp
index 26b53c2a31..b474c2e078 100644
--- a/core/io/resource_format_binary.cpp
+++ b/core/io/resource_format_binary.cpp
@@ -155,8 +155,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;
@@ -191,9 +191,9 @@ Error ResourceInteractiveLoaderBinary::parse_variant(Variant &r_v) {
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();
@@ -689,6 +689,7 @@ Error ResourceInteractiveLoaderBinary::poll() {
f->close();
resource = res;
+ resource->set_as_translation_remapped(translation_remapped);
error = ERR_FILE_EOF;
} else {
@@ -706,6 +707,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();
@@ -920,6 +926,7 @@ ResourceInteractiveLoaderBinary::ResourceInteractiveLoaderBinary() {
endian_swap = false;
use_real64 = false;
error = OK;
+ translation_remapped = false;
}
ResourceInteractiveLoaderBinary::~ResourceInteractiveLoaderBinary() {
@@ -1288,8 +1295,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);
@@ -1327,9 +1334,9 @@ void ResourceFormatSaverBinaryInstance::write_variant(const Variant &p_property,
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);
diff --git a/core/io/resource_format_binary.h b/core/io/resource_format_binary.h
index 59b9d66d8f..5da5a0fc37 100644
--- a/core/io/resource_format_binary.h
+++ b/core/io/resource_format_binary.h
@@ -36,6 +36,7 @@
class ResourceInteractiveLoaderBinary : public ResourceInteractiveLoader {
+ bool translation_remapped;
String local_path;
String res_path;
String type;
@@ -87,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.h b/core/io/resource_import.h
index 25b7a534b2..9d2a5180dc 100644
--- a/core/io/resource_import.h
+++ b/core/io/resource_import.h
@@ -61,6 +61,7 @@ public:
String get_internal_resource_path(const String &p_path) const;
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);
diff --git a/core/io/resource_loader.cpp b/core/io/resource_loader.cpp
index 234d71cb68..bb7be38413 100644
--- a/core/io/resource_loader.cpp
+++ b/core/io/resource_loader.cpp
@@ -29,10 +29,12 @@
/*************************************************************************/
#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 "translation.h"
ResourceFormatLoader *ResourceLoader::loader[MAX_LOADERS];
int ResourceLoader::loader_count = 0;
@@ -102,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() {}
};
@@ -165,38 +168,45 @@ RES ResourceLoader::load(const String &p_path, const String &p_type_hint, bool p
else
local_path = GlobalConfig::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)) {
+ 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);
}
@@ -206,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();
@@ -225,14 +235,17 @@ Ref<ResourceInteractiveLoader> ResourceLoader::load_interactive(const String &p_
else
local_path = GlobalConfig::get_singleton()->localize_path(p_path);
- ERR_FAIL_COND_V(local_path == "", Ref<ResourceInteractiveLoader>());
+ bool xl_remapped = false;
+ String path = _path_remap(local_path, &xl_remapped);
+
+ 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;
@@ -246,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>();
@@ -283,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 = GlobalConfig::get_singleton()->localize_path(path);
for (int i = 0; i < loader_count; i++) {
@@ -304,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 = GlobalConfig::get_singleton()->localize_path(path);
for (int i = 0; i < loader_count; i++) {
@@ -342,6 +361,95 @@ 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() {
+
+ Dictionary remaps = GlobalConfig::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;
@@ -350,3 +458,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 54b62f6916..e6687800d7 100644
--- a/core/io/resource_loader.h
+++ b/core/io/resource_loader.h
@@ -49,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() {}
@@ -87,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);
@@ -118,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/list.h b/core/list.h
index 4390cb65fc..df69b1dc40 100644
--- a/core/list.h
+++ b/core/list.h
@@ -398,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;
@@ -415,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;
@@ -437,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/map.h b/core/map.h
index acf1d608d8..ef0f75fc9b 100644
--- a/core/map.h
+++ b/core/map.h
@@ -599,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) {
@@ -613,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 320990cc50..838fec22f0 100644
--- a/core/math/a_star.cpp
+++ b/core/math/a_star.cpp
@@ -401,7 +401,7 @@ void AStar::_bind_methods() {
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("connect_points", "id", "to_id"), &AStar::connect_points, DEFVAL(true));
+ 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);
diff --git a/core/math/bsp_tree.cpp b/core/math/bsp_tree.cpp
index 9bbce752c0..327a6017c3 100644
--- a/core/math/bsp_tree.cpp
+++ b/core/math/bsp_tree.cpp
@@ -39,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();
@@ -552,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 {
diff --git a/core/math/camera_matrix.cpp b/core/math/camera_matrix.cpp
index 5b072b7c53..33ad522315 100644
--- a/core/math/camera_matrix.cpp
+++ b/core/math/camera_matrix.cpp
@@ -507,8 +507,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;
}
@@ -559,8 +559,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/face3.cpp b/core/math/face3.cpp
index 6d772cf08c..0e292500bf 100644
--- a/core/math/face3.cpp
+++ b/core/math/face3.cpp
@@ -197,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);
@@ -272,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;
@@ -281,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);
@@ -318,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 31ab72b925..1cc94321c3 100644
--- a/core/math/face3.h
+++ b/core/math/face3.h
@@ -101,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,
@@ -117,8 +117,8 @@ bool Face3::intersects_aabb2(const Rect3 &p_aabb) const {
#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 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) \
@@ -150,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 618017f8b3..2bea514d37 100644
--- a/core/math/geometry.cpp
+++ b/core/math/geometry.cpp
@@ -301,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))
@@ -640,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);
}
@@ -707,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/math_2d.cpp b/core/math/math_2d.cpp
index 962a42acb9..52e240ed47 100644
--- a/core/math/math_2d.cpp
+++ b/core/math/math_2d.cpp
@@ -308,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;
diff --git a/core/math/math_2d.h b/core/math/math_2d.h
index 128b74baf6..780bb532d7 100644
--- a/core/math/math_2d.h
+++ b/core/math/math_2d.h
@@ -207,24 +207,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;
@@ -234,17 +234,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)
@@ -259,9 +259,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 {
@@ -275,14 +275,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;
}
@@ -291,25 +291,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;
@@ -317,18 +317,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 {
@@ -339,8 +358,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;
@@ -352,19 +371,19 @@ 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);
+ position = Point2(p_x, p_y);
size = Size2(p_width, p_height);
}
Rect2(const Point2 &p_pos, const Size2 &p_size) {
- pos = p_pos;
+ position = p_pos;
size = p_size;
}
};
@@ -434,24 +453,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;
@@ -459,9 +478,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 {
@@ -475,14 +494,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;
}
@@ -491,25 +510,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;
@@ -517,14 +536,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;
@@ -532,8 +551,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;
@@ -545,24 +564,24 @@ 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); }
+ operator Rect2() const { return Rect2(position, size); }
Rect2i(const Rect2 &p_r2) {
- pos = p_r2.pos;
+ 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);
+ position = Point2(p_x, p_y);
size = Size2(p_width, p_height);
}
Rect2i(const Point2 &p_pos, const Size2 &p_size) {
- pos = p_pos;
+ position = p_pos;
size = p_size;
}
};
@@ -668,30 +687,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;
@@ -706,20 +725,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;
@@ -735,10 +754,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]);
@@ -847,10 +866,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);
@@ -868,14 +887,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_funcs.h b/core/math/math_funcs.h
index 6a5e12c3ce..45509a0808 100644
--- a/core/math/math_funcs.h
+++ b/core/math/math_funcs.h
@@ -51,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); }
@@ -112,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
@@ -120,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
diff --git a/core/math/matrix3.cpp b/core/math/matrix3.cpp
index c733251c3c..b59fecc196 100644
--- a/core/math/matrix3.cpp
+++ b/core/math/matrix3.cpp
@@ -451,9 +451,10 @@ Basis::operator String() const {
}
Basis::operator Quat() const {
-#ifdef MATH_CHECKS
- ERR_FAIL_COND_V(is_rotation() == false, Quat());
-#endif
+ //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];
diff --git a/core/math/matrix3.h b/core/math/matrix3.h
index c3eeb1f705..8897c692f7 100644
--- a/core/math/matrix3.h
+++ b/core/math/matrix3.h
@@ -145,6 +145,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 4cc046ddf4..010c1b18f7 100644
--- a/core/math/octree.h
+++ b/core/math/octree.h
@@ -483,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 */
@@ -544,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;
}
}
@@ -576,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
@@ -797,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);
@@ -837,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);
diff --git a/core/math/quick_hull.cpp b/core/math/quick_hull.cpp
index ce93720067..54b97ac38c 100644
--- a/core/math/quick_hull.cpp
+++ b/core/math/quick_hull.cpp
@@ -42,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]);
}
@@ -58,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/rect3.cpp b/core/math/rect3.cpp
index 39b0beb071..973607f565 100644
--- a/core/math/rect3.cpp
+++ b/core/math/rect3.cpp
@@ -38,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) {
@@ -51,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;
@@ -64,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;
@@ -107,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]) {
@@ -156,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;
@@ -208,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;
@@ -327,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;
}
@@ -396,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 136a156151..b7c94ad9f7 100644
--- a/core/math/rect3.h
+++ b/core/math/rect3.h
@@ -36,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
@@ -55,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; }
@@ -102,24 +102,24 @@ public:
_FORCE_INLINE_ Rect3() {}
inline Rect3(const Vector3 &p_pos, const Vector3 &p_size) {
- pos = p_pos;
+ 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;
@@ -127,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;
@@ -145,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) &&
@@ -162,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,
@@ -174,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());
@@ -192,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];
@@ -210,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
@@ -246,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;
@@ -264,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;
@@ -281,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);
@@ -332,21 +332,21 @@ bool Rect3::smits_intersect_ray(const Vector3 &from, const Vector3 &dir, real_t
real_t divy = 1.0 / dir.y;
real_t divz = 1.0 / 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;
+ tmin = (position.x - from.x) * divx;
tmax = (upbound.x - from.x) * divx;
} else {
tmin = (upbound.x - from.x) * divx;
- tmax = (pos.x - from.x) * divx;
+ tmax = (position.x - from.x) * divx;
}
if (dir.y >= 0) {
- tymin = (pos.y - from.y) * divy;
+ tymin = (position.y - from.y) * divy;
tymax = (upbound.y - from.y) * divy;
} else {
tymin = (upbound.y - from.y) * divy;
- tymax = (pos.y - from.y) * divy;
+ tymax = (position.y - from.y) * divy;
}
if ((tmin > tymax) || (tymin > tmax))
return false;
@@ -355,11 +355,11 @@ bool Rect3::smits_intersect_ray(const Vector3 &from, const Vector3 &dir, real_t
if (tymax < tmax)
tmax = tymax;
if (dir.z >= 0) {
- tzmin = (pos.z - from.z) * divz;
+ tzmin = (position.z - from.z) * divz;
tzmax = (upbound.z - from.z) * divz;
} else {
tzmin = (upbound.z - from.z) * divz;
- tzmax = (pos.z - from.z) * divz;
+ tzmax = (position.z - from.z) * divz;
}
if ((tmin > tzmax) || (tzmin > tmax))
return false;
@@ -372,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 e53e6cf519..7a50214596 100644
--- a/core/math/transform.cpp
+++ b/core/math/transform.cpp
@@ -82,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;
@@ -96,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);
@@ -103,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;
}
diff --git a/core/math/transform.h b/core/math/transform.h
index 4731496bf3..48467f2ed7 100644
--- a/core/math/transform.h
+++ b/core/math/transform.h
@@ -97,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;
@@ -167,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);
@@ -182,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;
@@ -208,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++) {
diff --git a/core/math/triangle_mesh.cpp b/core/math/triangle_mesh.cpp
index 1cf1351646..1df3c8c298 100644
--- a/core/math/triangle_mesh.cpp
+++ b/core/math/triangle_mesh.cpp
@@ -79,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;
@@ -117,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();
@@ -128,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);
}
@@ -138,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/vector3.cpp b/core/math/vector3.cpp
index e413cc147d..efffacb36e 100644
--- a/core/math/vector3.cpp
+++ b/core/math/vector3.cpp
@@ -61,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 5f4390fbd1..7dfcedd0da 100644
--- a/core/math/vector3.h
+++ b/core/math/vector3.h
@@ -81,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;
diff --git a/core/method_bind.h b/core/method_bind.h
index 8d72c8573a..dbc9cca082 100644
--- a/core/method_bind.h
+++ b/core/method_bind.h
@@ -343,6 +343,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/object.cpp b/core/object.cpp
index 7aee936a2d..3416cd8c5a 100644
--- a/core/object.cpp
+++ b/core/object.cpp
@@ -419,6 +419,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);
@@ -464,6 +474,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);
@@ -516,6 +536,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) {
@@ -1332,6 +1357,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()) {
@@ -1571,6 +1611,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;
@@ -1641,6 +1698,7 @@ void Object::_bind_methods() {
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);
@@ -1831,10 +1889,10 @@ 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);
@@ -1859,7 +1917,7 @@ void ObjectDB::remove_instance(Object *p_object) {
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);
@@ -1874,7 +1932,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]);
@@ -1909,7 +1967,7 @@ 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;
diff --git a/core/object.h b/core/object.h
index 3b39224af0..f87705c48b 100644
--- a/core/object.h
+++ b/core/object.h
@@ -350,7 +350,7 @@ public: \
private:
class ScriptInstance;
-typedef uint32_t ObjectID;
+typedef uint64_t ObjectID;
class Object {
public:
@@ -423,13 +423,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;
@@ -442,6 +443,7 @@ private:
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;
@@ -531,6 +533,12 @@ public:
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() {
@@ -561,6 +569,10 @@ public:
#endif
}
+#ifdef __clang__
+#pragma clang diagnostic pop
+#endif
+
enum {
NOTIFICATION_POSTINITIALIZE = 0,
@@ -666,6 +678,11 @@ 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
+
void clear_internal_resource_paths();
Object();
@@ -690,16 +707,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();
@@ -707,7 +724,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/input_event.cpp b/core/os/input_event.cpp
index 7ec76c1eed..1c575aa970 100644
--- a/core/os/input_event.cpp
+++ b/core/os/input_event.cpp
@@ -89,6 +89,11 @@ bool InputEvent::action_match(const Ref<InputEvent> &p_event) const {
return false;
}
+bool InputEvent::shortcut_match(const Ref<InputEvent> &p_event) const {
+
+ return false;
+}
+
bool InputEvent::is_action_type() const {
return false;
@@ -130,10 +135,13 @@ void InputEvent::_bind_methods() {
ClassDB::bind_method(D_METHOD("as_text"), &InputEvent::as_text);
ClassDB::bind_method(D_METHOD("action_match", "event:InputEvent"), &InputEvent::action_match);
+ ClassDB::bind_method(D_METHOD("shortcut_match", "event:InputEvent"), &InputEvent::shortcut_match);
ClassDB::bind_method(D_METHOD("is_action_type"), &InputEvent::is_action_type);
ClassDB::bind_method(D_METHOD("xformed_by:InputEvent", "xform", "local_ofs"), &InputEvent::xformed_by, DEFVAL(Vector2()));
+
+ ADD_PROPERTY(PropertyInfo(Variant::INT, "device"), "set_device", "get_device");
}
InputEvent::InputEvent() {
@@ -276,13 +284,49 @@ uint32_t InputEventKey::get_scancode_with_modifiers() const {
return sc;
}
+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;
- return get_scancode_with_modifiers() == key->get_scancode_with_modifiers();
+ 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() {
@@ -324,20 +368,20 @@ int InputEventMouse::get_button_mask() const {
return button_mask;
}
-void InputEventMouse::set_pos(const Vector2 &p_pos) {
+void InputEventMouse::set_position(const Vector2 &p_pos) {
pos = p_pos;
}
-Vector2 InputEventMouse::get_pos() const {
+Vector2 InputEventMouse::get_position() const {
return pos;
}
-void InputEventMouse::set_global_pos(const Vector2 &p_global_pos) {
+void InputEventMouse::set_global_position(const Vector2 &p_global_pos) {
global_pos = p_global_pos;
}
-Vector2 InputEventMouse::get_global_pos() const {
+Vector2 InputEventMouse::get_global_position() const {
return global_pos;
}
@@ -347,15 +391,15 @@ 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_pos", "pos"), &InputEventMouse::set_pos);
- ClassDB::bind_method(D_METHOD("get_pos"), &InputEventMouse::get_pos);
+ 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_pos", "global_pos"), &InputEventMouse::set_global_pos);
- ClassDB::bind_method(D_METHOD("get_global_pos"), &InputEventMouse::get_global_pos);
+ 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, "pos"), "set_pos", "get_pos");
- ADD_PROPERTY(PropertyInfo(Variant::VECTOR2, "global_pos"), "set_global_pos", "get_global_pos");
+ 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() {
@@ -404,8 +448,8 @@ bool InputEventMouseButton::is_doubleclick() const {
Ref<InputEvent> InputEventMouseButton::xformed_by(const Transform2D &p_xform, const Vector2 &p_local_ofs) const {
- Vector2 g = p_xform.xform(get_global_pos());
- Vector2 l = p_xform.xform(get_pos() + p_local_ofs);
+ Vector2 g = p_xform.xform(get_global_position());
+ Vector2 l = p_xform.xform(get_position() + p_local_ofs);
Ref<InputEventMouseButton> mb;
mb.instance();
@@ -418,8 +462,8 @@ Ref<InputEvent> InputEventMouseButton::xformed_by(const Transform2D &p_xform, co
mb->set_control(get_control());
mb->set_metakey(get_metakey());
- mb->set_pos(l);
- mb->set_global_pos(g);
+ mb->set_position(l);
+ mb->set_global_position(g);
mb->set_button_mask(get_button_mask());
mb->set_pressed(pressed);
@@ -489,8 +533,8 @@ Vector2 InputEventMouseMotion::get_speed() const {
Ref<InputEvent> InputEventMouseMotion::xformed_by(const Transform2D &p_xform, const Vector2 &p_local_ofs) const {
- Vector2 g = p_xform.xform(get_global_pos());
- Vector2 l = p_xform.xform(get_pos() + p_local_ofs);
+ 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());
@@ -505,8 +549,8 @@ Ref<InputEvent> InputEventMouseMotion::xformed_by(const Transform2D &p_xform, co
mm->set_control(get_control());
mm->set_metakey(get_metakey());
- mm->set_pos(l);
- mm->set_global_pos(g);
+ mm->set_position(l);
+ mm->set_global_position(g);
mm->set_button_mask(get_button_mask());
mm->set_relative(r);
@@ -650,11 +694,11 @@ int InputEventScreenTouch::get_index() const {
return index;
}
-void InputEventScreenTouch::set_pos(const Vector2 &p_pos) {
+void InputEventScreenTouch::set_position(const Vector2 &p_pos) {
pos = p_pos;
}
-Vector2 InputEventScreenTouch::get_pos() const {
+Vector2 InputEventScreenTouch::get_position() const {
return pos;
}
@@ -675,7 +719,7 @@ Ref<InputEvent> InputEventScreenTouch::xformed_by(const Transform2D &p_xform, co
st->set_id(get_id());
st->set_device(get_device());
st->set_index(index);
- st->set_pos(p_xform.xform(pos + p_local_ofs));
+ st->set_position(p_xform.xform(pos + p_local_ofs));
st->set_pressed(pressed);
return st;
@@ -686,14 +730,14 @@ 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_pos", "pos"), &InputEventScreenTouch::set_pos);
- ClassDB::bind_method(D_METHOD("get_pos"), &InputEventScreenTouch::get_pos);
+ 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, "pos"), "set_pos", "get_pos");
+ ADD_PROPERTY(PropertyInfo(Variant::VECTOR2, "position"), "set_position", "get_position");
ADD_PROPERTY(PropertyInfo(Variant::BOOL, "pressed"), "set_pressed", "is_pressed");
}
@@ -715,11 +759,11 @@ int InputEventScreenDrag::get_index() const {
return index;
}
-void InputEventScreenDrag::set_pos(const Vector2 &p_pos) {
+void InputEventScreenDrag::set_position(const Vector2 &p_pos) {
pos = p_pos;
}
-Vector2 InputEventScreenDrag::get_pos() const {
+Vector2 InputEventScreenDrag::get_position() const {
return pos;
}
@@ -752,7 +796,7 @@ Ref<InputEvent> InputEventScreenDrag::xformed_by(const Transform2D &p_xform, con
sd->set_device(get_device());
sd->set_index(index);
- sd->set_pos(p_xform.xform(pos + p_local_ofs));
+ 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));
@@ -764,8 +808,8 @@ 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_pos", "pos"), &InputEventScreenDrag::set_pos);
- ClassDB::bind_method(D_METHOD("get_pos"), &InputEventScreenDrag::get_pos);
+ 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);
@@ -774,7 +818,7 @@ void InputEventScreenDrag::_bind_methods() {
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, "pos"), "set_pos", "get_pos");
+ 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");
}
diff --git a/core/os/input_event.h b/core/os/input_event.h
index 31f88b295b..b120d4b840 100644
--- a/core/os/input_event.h
+++ b/core/os/input_event.h
@@ -165,6 +165,7 @@ public:
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();
@@ -243,9 +244,12 @@ public:
uint32_t get_scancode_with_modifiers() 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 { return true; }
+ virtual String as_text() const;
+
InputEventKey();
};
@@ -265,11 +269,11 @@ public:
void set_button_mask(int p_mask);
int get_button_mask() const;
- void set_pos(const Vector2 &p_pos);
- Vector2 get_pos() const;
+ void set_position(const Vector2 &p_pos);
+ Vector2 get_position() const;
- void set_global_pos(const Vector2 &p_global_pos);
- Vector2 get_global_pos() const;
+ void set_global_position(const Vector2 &p_global_pos);
+ Vector2 get_global_position() const;
InputEventMouse();
};
@@ -390,8 +394,8 @@ public:
void set_index(int p_index);
int get_index() const;
- void set_pos(const Vector2 &p_pos);
- Vector2 get_pos() const;
+ void set_position(const Vector2 &p_pos);
+ Vector2 get_position() const;
void set_pressed(bool p_pressed);
virtual bool is_pressed() const;
@@ -416,8 +420,8 @@ public:
void set_index(int p_index);
int get_index() const;
- void set_pos(const Vector2 &p_pos);
- Vector2 get_pos() const;
+ void set_position(const Vector2 &p_pos);
+ Vector2 get_position() const;
void set_relative(const Vector2 &p_relative);
Vector2 get_relative() const;
diff --git a/core/reference.h b/core/reference.h
index afc097817a..4e2d6c36c0 100644
--- a/core/reference.h
+++ b/core/reference.h
@@ -344,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);
}
};
diff --git a/core/resource.cpp b/core/resource.cpp
index 559d4c1201..a7a5498ef6 100644
--- a/core/resource.cpp
+++ b/core/resource.cpp
@@ -31,9 +31,9 @@
#include "core_string_names.h"
#include "io/resource_loader.h"
+#include "io/resource_loader.h"
#include "os/file_access.h"
#include "script_language.h"
-
#include <stdio.h>
void Resource::emit_changed() {
@@ -127,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;
@@ -302,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);
@@ -325,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 903edeff52..5a4e45da36 100644
--- a/core/resource.h
+++ b/core/resource.h
@@ -35,6 +35,7 @@
#include "ref_ptr.h"
#include "reference.h"
#include "safe_refcount.h"
+#include "self_list.h"
/**
@author Juan Linietsky <reduzio@gmail.com>
@@ -74,6 +75,8 @@ class Resource : public Reference {
friend class SceneState;
Node *local_scene;
+ SelfList<Resource> remapped_list;
+
protected:
void emit_changed();
@@ -127,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();
@@ -137,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/script_language.h b/core/script_language.h
index 115ab59dca..6e39593a89 100644
--- a/core/script_language.h
+++ b/core/script_language.h
@@ -196,6 +196,8 @@ 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;
diff --git a/core/sort.h b/core/sort.h
index a45eb8865a..06c427f61e 100644
--- a/core/sort.h
+++ b/core/sort.h
@@ -46,7 +46,7 @@ class SortArray {
enum {
- INTROSORT_TRESHOLD = 16
+ INTROSORT_THRESHOLD = 16
};
public:
@@ -180,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);
@@ -273,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/translation.cpp b/core/translation.cpp
index bd670167f9..72231ef295 100644
--- a/core/translation.cpp
+++ b/core/translation.cpp
@@ -870,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) {
@@ -945,6 +949,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 {
diff --git a/core/translation.h b/core/translation.h
index 577282b45f..8630b8a478 100644
--- a/core/translation.h
+++ b/core/translation.h
@@ -36,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/ustring.cpp b/core/ustring.cpp
index 6a93d7789e..ab4528e495 100644
--- a/core/ustring.cpp
+++ b/core/ustring.cpp
@@ -65,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)
@@ -96,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)
@@ -119,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)
diff --git a/core/variant.cpp b/core/variant.cpp
index ae5141b8bf..0807a33788 100644
--- a/core/variant.cpp
+++ b/core/variant.cpp
@@ -2549,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;
@@ -2590,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);
}
@@ -2820,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;
@@ -2855,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_call.cpp b/core/variant_call.cpp
index 6568dc877e..6936a362e1 100644
--- a/core/variant_call.cpp
+++ b/core/variant_call.cpp
@@ -30,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"
@@ -354,6 +355,8 @@ 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);
@@ -507,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()));
+ 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);
@@ -1433,6 +1474,8 @@ 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());
@@ -1548,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());
diff --git a/core/variant_op.cpp b/core/variant_op.cpp
index 7b9b7abd9e..5fda6b1473 100644
--- a/core/variant_op.cpp
+++ b/core/variant_op.cpp
@@ -1109,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;
@@ -1131,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;
@@ -1141,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;
}
}
@@ -1177,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,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;
@@ -1314,7 +1314,7 @@ 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;
}
}
@@ -1572,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;
}
@@ -1589,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;
@@ -1657,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];
}
@@ -1718,15 +1718,15 @@ 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;
@@ -2105,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"));
@@ -2127,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: {
@@ -2148,7 +2146,7 @@ void Variant::get_property_list(List<PropertyInfo> *p_list) const {
} 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;
@@ -2236,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;
@@ -2387,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)
@@ -2396,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;
@@ -2759,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: {
@@ -2769,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: {
@@ -2879,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: {
@@ -2899,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: {
diff --git a/core/variant_parser.cpp b/core/variant_parser.cpp
index 55e2bb42e3..26a6a05a30 100644
--- a/core/variant_parser.cpp
+++ b/core/variant_parser.cpp
@@ -744,7 +744,12 @@ Error VariantParser::parse_value(Token &token, Variant &value, Stream *p_stream,
return err;
if (token.type == TK_PARENTHESIS_CLOSE) {
-
+ Reference *reference = obj->cast_to<Reference>();
+ if (reference) {
+ value = REF(reference);
+ } else {
+ value = obj;
+ }
return OK;
}
@@ -760,7 +765,6 @@ Error VariantParser::parse_value(Token &token, Variant &value, Stream *p_stream,
}
}
- get_token(p_stream, token, line, r_err_str);
if (token.type != TK_STRING) {
r_err_str = "Expected property name as string";
return ERR_PARSE_ERROR;
@@ -1616,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: {
@@ -1633,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: {
diff --git a/core/vector.h b/core/vector.h
index fe1c1b05dd..5eed8dce96 100644
--- a/core/vector.h
+++ b/core/vector.h
@@ -134,10 +134,7 @@ public:
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.
@@ -146,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];
}
diff --git a/core/version.h b/core/version.h
index 80e50e51b9..43f6f1bbf9 100644
--- a/core/version.h
+++ b/core/version.h
@@ -27,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 "version_generated.h"
+#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)
diff --git a/core/vmap.h b/core/vmap.h
index ad07973308..66f935f58d 100644
--- a/core/vmap.h
+++ b/core/vmap.h
@@ -180,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/doc/base/classes.xml b/doc/base/classes.xml
index da614e14d3..6ff3e0fa29 100644
--- a/doc/base/classes.xml
+++ b/doc/base/classes.xml
@@ -1,15 +1,5 @@
<?xml version="1.0" encoding="UTF-8" ?>
<doc version="3.0.alpha.custom_build" name="Engine Types">
-<class name="@DLScript" category="Core">
- <brief_description>
- </brief_description>
- <description>
- </description>
- <methods>
- </methods>
- <constants>
- </constants>
-</class>
<class name="@GDScript" category="Core">
<brief_description>
Built-in GDScript functions.
@@ -398,7 +388,8 @@
<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).
+ 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">
@@ -1914,45 +1905,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>
@@ -1991,9 +1986,9 @@
<argument index="1" name="pos" type="Vector3">
</argument>
<argument index="2" name="weight_scale" type="float" default="1">
- Weight scale has to be 1 or larger.
</argument>
<description>
+ Add a new point at the given position. The [code]weight_scale[/code] has to be 1 or larger.
</description>
</method>
<method name="are_points_connected" qualifiers="const">
@@ -2015,6 +2010,8 @@
</argument>
<argument index="1" name="to_id" type="int">
</argument>
+ <argument index="2" name="bidirectional" type="bool" default="true">
+ </argument>
<description>
</description>
</method>
@@ -2986,7 +2983,7 @@
Return the default blend time between animations.
</description>
</method>
- <method name="get_position" qualifiers="const">
+ <method name="get_pos" qualifiers="const">
<return type="float">
</return>
<description>
@@ -3757,6 +3754,22 @@
Return the angular damp rate.
</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>
@@ -3794,22 +3807,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>
@@ -3892,6 +3889,24 @@
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_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>
@@ -3938,24 +3953,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>
@@ -4002,7 +3999,7 @@
<members>
<member name="angular_damp" type="float" setter="set_angular_damp" getter="get_angular_damp" brief="">
</member>
- <member name="collision_layers" type="int" setter="set_layer_mask" getter="get_layer_mask" brief="">
+ <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>
@@ -4125,6 +4122,22 @@
Return the angular damp rate.
</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>
@@ -4162,22 +4175,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>
@@ -4260,6 +4257,24 @@
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_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>
@@ -4306,24 +4321,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>
@@ -4370,7 +4367,7 @@
<members>
<member name="angular_damp" type="float" setter="set_angular_damp" getter="get_angular_damp" brief="">
</member>
- <member name="collision_layers" type="int" setter="set_layer_mask" getter="get_layer_mask" brief="">
+ <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>
@@ -4718,6 +4715,251 @@
<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>
+ <constant name="PRIMITIVE_POINTS" value="0">
+ Render array as points (one vertex equals one point).
+ </constant>
+ <constant name="PRIMITIVE_LINES" value="1">
+ Render array as lines (every two vertices a line is created).
+ </constant>
+ <constant name="PRIMITIVE_LINE_STRIP" value="2">
+ Render array as line strip.
+ </constant>
+ <constant name="PRIMITIVE_LINE_LOOP" value="3">
+ Render array as line loop (like line strip, but closed).
+ </constant>
+ <constant name="PRIMITIVE_TRIANGLES" value="4">
+ Render array as triangles (every three vertices a triangle is created).
+ </constant>
+ <constant name="PRIMITIVE_TRIANGLE_STRIP" value="5">
+ Render array as triangle strips.
+ </constant>
+ <constant name="PRIMITIVE_TRIANGLE_FAN" value="6">
+ Render array as triangle fans.
+ </constant>
+ </constants>
+</class>
<class name="AtlasTexture" inherits="Texture" category="Core">
<brief_description>
</brief_description>
@@ -6006,7 +6248,7 @@
<description>
</description>
</method>
- <method name="get_position">
+ <method name="get_pos">
<return type="float">
</return>
<description>
@@ -6595,58 +6837,6 @@
</constant>
</constants>
</class>
-<class name="BakedLight" inherits="VisualInstance" category="Core">
- <brief_description>
- </brief_description>
- <description>
- </description>
- <methods>
- <method name="bake">
- <description>
- </description>
- </method>
- <method name="bake_lights">
- <description>
- </description>
- </method>
- <method name="bake_radiance">
- <description>
- </description>
- </method>
- <method name="debug_mesh_albedo">
- <description>
- </description>
- </method>
- <method name="debug_mesh_light">
- <description>
- </description>
- </method>
- <method name="get_cell_subdiv" qualifiers="const">
- <return type="int">
- </return>
- <description>
- </description>
- </method>
- <method name="set_cell_subdiv">
- <argument index="0" name="steps" type="int">
- </argument>
- <description>
- </description>
- </method>
- </methods>
- <members>
- <member name="cell_subdiv" type="int" setter="set_cell_subdiv" getter="get_cell_subdiv" brief="">
- </member>
- </members>
- <signals>
- <signal name="baked_light_changed">
- <description>
- </description>
- </signal>
- </signals>
- <constants>
- </constants>
-</class>
<class name="BaseButton" inherits="Control" category="Core">
<brief_description>
Provides a base class for different kinds of buttons.
@@ -6858,21 +7048,21 @@
<method name="Basis">
<return type="Basis">
</return>
- <argument index="0" name="axis" type="Vector3">
- </argument>
- <argument index="1" name="phi" type="float">
+ <argument index="0" name="euler" type="Vector3">
</argument>
<description>
- Create a rotation matrix which rotates around the given axis by the specified angle. The axis must be a normalized vector.
+ Create a rotation matrix (in the XYZ convention: first Z, then Y, and X last) from the specified Euler angles, given in the vector format as (third, second, first).
</description>
</method>
<method name="Basis">
<return type="Basis">
</return>
- <argument index="0" name="euler" type="Vector3">
+ <argument index="0" name="axis" type="Vector3">
+ </argument>
+ <argument index="1" name="phi" type="float">
</argument>
<description>
- Create a rotation matrix (in the XYZ convention: first Z, then Y, and X last) from the specified Euler angles, given in the vector format as (third,second,first).
+ 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">
@@ -6941,38 +7131,32 @@
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="set_rotation_euler">
+ <method name="scaled">
<return type="Basis">
</return>
- <argument index="0" name="euler" type="Vector3">
+ <argument index="0" name="scale" 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).
+ 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">
- <return type="Basis">
- </return>
<argument index="0" name="axis" type="Vector3">
</argument>
- <argument index="1" name="phi" type="float">
+ <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="scaled">
- <return type="Basis">
- </return>
- <argument index="0" name="scale" type="Vector3">
+ <method name="set_rotation_euler">
+ <argument index="0" name="euler" 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].
+ 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">
- <return type="Basis">
- </return>
<argument index="0" name="scale" type="Vector3">
</argument>
<description>
@@ -7019,7 +7203,7 @@
<argument index="0" name="v" type="Vector3">
</argument>
<description>
- Return a vector transformed (multiplied) by the matrix and return it.
+ Return a vector transformed (multiplied) by the matrix.
</description>
</method>
<method name="xform_inv">
@@ -7028,7 +7212,7 @@
<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.
+ 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>
@@ -7056,7 +7240,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>
@@ -7473,173 +7657,6 @@
</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>
- <argument index="1" name="tooltip" type="String" default="&quot;&quot;">
- </argument>
- <description>
- Append a new button to the array, with the specified text and tooltip.
- </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>
- <argument index="2" name="tooltip" type="String" default="&quot;&quot;">
- </argument>
- <description>
- Append a new button to the array, with the specified icon, text and tooltip.
- </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_button_tooltip" qualifiers="const">
- <return type="String">
- </return>
- <argument index="0" name="button_idx" type="int">
- </argument>
- <description>
- Return the tooltip 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="is_flat" qualifiers="const">
- <return type="bool">
- </return>
- <description>
- </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_button_tooltip">
- <argument index="0" name="button_idx" type="int">
- </argument>
- <argument index="1" name="text" type="String">
- </argument>
- <description>
- Define the tooltip of the specified button.
- </description>
- </method>
- <method name="set_flat">
- <argument index="0" name="enabled" type="bool">
- </argument>
- <description>
- </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>
- <members>
- <member name="flat" type="bool" setter="set_flat" getter="is_flat" brief="">
- </member>
- </members>
- <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="Resource" category="Core">
<brief_description>
Group of Buttons.
@@ -8553,12 +8570,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">
@@ -8869,6 +8885,74 @@
<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>
<class name="CapsuleShape" inherits="Shape" category="Core">
<brief_description>
Capsule shape resource.
@@ -9169,6 +9253,16 @@
<description>
</description>
</method>
+ <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>
@@ -9231,6 +9325,18 @@
<description>
</description>
</method>
+ <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_class_list" qualifiers="const">
<return type="PoolStringArray">
</return>
@@ -9416,7 +9522,7 @@
<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>
@@ -9455,7 +9561,6 @@
<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">
@@ -9570,12 +9675,11 @@
<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_entered">
@@ -10184,120 +10288,6 @@
</theme_item>
</theme_items>
</class>
-<class name="ColorRamp" 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="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>
- 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="ColorRect" inherits="Control" category="Core">
<brief_description>
</brief_description>
@@ -10605,7 +10595,7 @@
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.
@@ -10622,7 +10612,6 @@
<argument index="0" name="event" type="InputEvent">
</argument>
<description>
- Called when an input event reaches the control.
</description>
</method>
<method name="accept_event">
@@ -10819,7 +10808,7 @@
<description>
</description>
</method>
- <method name="get_global_pos" qualifiers="const">
+ <method name="get_global_position" qualifiers="const">
<return type="Vector2">
</return>
<description>
@@ -11184,7 +11173,7 @@
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>
@@ -11323,7 +11312,7 @@
</member>
<member name="rect_min_size" type="Vector2" setter="set_custom_minimum_size" getter="get_custom_minimum_size" brief="">
</member>
- <member name="rect_pos" type="Vector2" setter="set_pos" getter="get_pos" brief="">
+ <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>
@@ -11352,10 +11341,9 @@
</description>
</signal>
<signal name="gui_input">
- <argument index="0" name="ev" type="InputEvent">
+ <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">
@@ -11566,7 +11554,7 @@
</description>
</method>
<method name="get_side" qualifiers="const">
- <return type="Image">
+ <return type="Object">
</return>
<argument index="0" name="side" type="int">
</argument>
@@ -11600,7 +11588,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>
@@ -11641,6 +11629,74 @@
</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="Curve2D" inherits="Resource" category="Core">
<brief_description>
Describes a Bezier curve in 2D space.
@@ -12091,67 +12147,83 @@
<constants>
</constants>
</class>
-<class name="DLLibrary" inherits="Resource" category="Core">
+<class name="CylinderMesh" inherits="PrimitiveMesh" category="Core">
<brief_description>
</brief_description>
<description>
</description>
<methods>
- <method name="get_platform_file" qualifiers="const">
- <return type="String">
+ <method name="get_bottom_radius" qualifiers="const">
+ <return type="float">
</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>
+ <method name="get_height" qualifiers="const">
+ <return type="float">
+ </return>
<description>
</description>
</method>
- </methods>
- <constants>
- </constants>
-</class>
-<class name="DLScript" inherits="Script" category="Core">
- <brief_description>
- </brief_description>
- <description>
- </description>
- <methods>
- <method name="get_library" qualifiers="const">
- <return type="Object">
+ <method name="get_radial_segments" qualifiers="const">
+ <return type="int">
</return>
<description>
</description>
</method>
- <method name="get_script_name" qualifiers="const">
- <return type="String">
+ <method name="get_rings" qualifiers="const">
+ <return type="int">
</return>
<description>
</description>
</method>
- <method name="set_library">
- <argument index="0" name="library" type="Object">
+ <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_script_name">
- <argument index="0" name="script_name" type="String">
+ <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="library" type="DLLibrary" setter="set_library" getter="get_library" brief="">
+ <member name="bottom_radius" type="float" setter="set_bottom_radius" getter="get_bottom_radius" brief="">
</member>
- <member name="script_name" type="String" setter="set_script_name" getter="get_script_name" brief="">
+ <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>
@@ -12346,8 +12418,6 @@
</method>
</methods>
<members>
- <member name="directional_shadow_bias_split_scale" type="float" setter="set_param" getter="get_param" brief="">
- </member>
<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="">
@@ -13051,6 +13121,94 @@
<constants>
</constants>
</class>
+<class name="EditorImportPlugin" inherits="Reference" category="Core">
+ <brief_description>
+ </brief_description>
+ <description>
+ </description>
+ <methods>
+ <method name="get_import_options" qualifiers="virtual">
+ <return type="Array">
+ </return>
+ <argument index="0" name="preset" type="int">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="get_importer_name" qualifiers="virtual">
+ <return type="String">
+ </return>
+ <description>
+ </description>
+ </method>
+ <method name="get_option_visibility" qualifiers="virtual">
+ <return type="bool">
+ </return>
+ <argument index="0" name="option" type="String">
+ </argument>
+ <argument index="1" name="options" type="Dictionary">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="get_preset_count" qualifiers="virtual">
+ <return type="int">
+ </return>
+ <description>
+ </description>
+ </method>
+ <method name="get_preset_name" qualifiers="virtual">
+ <return type="String">
+ </return>
+ <argument index="0" name="preset" type="int">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="get_recognized_extensions" qualifiers="virtual">
+ <return type="Array">
+ </return>
+ <description>
+ </description>
+ </method>
+ <method name="get_resource_type" qualifiers="virtual">
+ <return type="String">
+ </return>
+ <description>
+ </description>
+ </method>
+ <method name="get_save_extension" qualifiers="virtual">
+ <return type="String">
+ </return>
+ <description>
+ </description>
+ </method>
+ <method name="get_visible_name" qualifiers="virtual">
+ <return type="String">
+ </return>
+ <description>
+ </description>
+ </method>
+ <method name="import" qualifiers="virtual">
+ <return type="int">
+ </return>
+ <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>
+ </method>
+ </methods>
+ <constants>
+ </constants>
+</class>
<class name="EditorPlugin" inherits="Node" category="Core">
<brief_description>
Used by the editor to extend its functionality.
@@ -13108,6 +13266,12 @@
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_import_plugin">
+ <argument index="0" name="arg0" type="Object">
+ </argument>
+ <description>
+ </description>
+ </method>
<method name="add_tool_submenu_item">
<argument index="0" name="name" type="String">
</argument>
@@ -13157,7 +13321,6 @@
<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">
@@ -13177,9 +13340,6 @@
<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.
</description>
</method>
<method name="get_base_control">
@@ -13328,6 +13488,12 @@
Remove a custom type added by [method EditorPlugin.add_custom_type]
</description>
</method>
+ <method name="remove_import_plugin">
+ <argument index="0" name="arg0" type="Object">
+ </argument>
+ <description>
+ </description>
+ </method>
<method name="save_external_data" qualifiers="virtual">
<description>
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.
@@ -13723,7 +13889,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].
@@ -13868,6 +14034,12 @@
"string" - major + minor + patch + status + revision in a single String
</description>
</method>
+ <method name="is_in_fixed_frame" qualifiers="const">
+ <return type="bool">
+ </return>
+ <description>
+ </description>
+ </method>
<method name="set_iterations_per_second">
<argument index="0" name="iterations_per_second" type="int">
</argument>
@@ -13933,7 +14105,7 @@
<description>
</description>
</method>
- <method name="get_ambient_light_skybox_contribution" qualifiers="const">
+ <method name="get_ambient_light_sky_contribution" qualifiers="const">
<return type="float">
</return>
<description>
@@ -14011,6 +14183,60 @@
<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>
@@ -14047,13 +14273,13 @@
<description>
</description>
</method>
- <method name="get_skybox" qualifiers="const">
+ <method name="get_sky" qualifiers="const">
<return type="CubeMap">
</return>
<description>
</description>
</method>
- <method name="get_skybox_scale" qualifiers="const">
+ <method name="get_sky_scale" qualifiers="const">
<return type="float">
</return>
<description>
@@ -14101,19 +14327,19 @@
<description>
</description>
</method>
- <method name="get_ssr_accel" qualifiers="const">
+ <method name="get_ssr_depth_tolerance" qualifiers="const">
<return type="float">
</return>
<description>
</description>
</method>
- <method name="get_ssr_depth_tolerance" qualifiers="const">
+ <method name="get_ssr_fade_in" qualifiers="const">
<return type="float">
</return>
<description>
</description>
</method>
- <method name="get_ssr_fade" qualifiers="const">
+ <method name="get_ssr_fade_out" qualifiers="const">
<return type="float">
</return>
<description>
@@ -14191,6 +14417,30 @@
<description>
</description>
</method>
+ <method name="is_fog_depth_enabled" qualifiers="const">
+ <return type="bool">
+ </return>
+ <description>
+ </description>
+ </method>
+ <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>
@@ -14235,12 +14485,6 @@
<description>
</description>
</method>
- <method name="is_ssr_smooth" qualifiers="const">
- <return type="bool">
- </return>
- <description>
- </description>
- </method>
<method name="set_adjustment_brightness">
<argument index="0" name="brightness" type="float">
</argument>
@@ -14283,7 +14527,7 @@
<description>
</description>
</method>
- <method name="set_ambient_light_skybox_contribution">
+ <method name="set_ambient_light_sky_contribution">
<argument index="0" name="energy" type="float">
</argument>
<description>
@@ -14373,6 +14617,84 @@
<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>
@@ -14429,13 +14751,13 @@
<description>
</description>
</method>
- <method name="set_skybox">
- <argument index="0" name="skybox" type="CubeMap">
+ <method name="set_sky">
+ <argument index="0" name="sky" type="CubeMap">
</argument>
<description>
</description>
</method>
- <method name="set_skybox_scale">
+ <method name="set_sky_scale">
<argument index="0" name="scale" type="float">
</argument>
<description>
@@ -14495,12 +14817,6 @@
<description>
</description>
</method>
- <method name="set_ssr_accel">
- <argument index="0" name="accel" type="float">
- </argument>
- <description>
- </description>
- </method>
<method name="set_ssr_depth_tolerance">
<argument index="0" name="depth_tolerance" type="float">
</argument>
@@ -14513,26 +14829,26 @@
<description>
</description>
</method>
- <method name="set_ssr_fade">
- <argument index="0" name="fade" type="float">
+ <method name="set_ssr_fade_in">
+ <argument index="0" name="fade_in" type="float">
</argument>
<description>
</description>
</method>
- <method name="set_ssr_max_steps">
- <argument index="0" name="max_steps" type="int">
+ <method name="set_ssr_fade_out">
+ <argument index="0" name="fade_out" type="float">
</argument>
<description>
</description>
</method>
- <method name="set_ssr_rough">
- <argument index="0" name="rough" type="bool">
+ <method name="set_ssr_max_steps">
+ <argument index="0" name="max_steps" type="int">
</argument>
<description>
</description>
</method>
- <method name="set_ssr_smooth">
- <argument index="0" name="smooth" type="bool">
+ <method name="set_ssr_rough">
+ <argument index="0" name="rough" type="bool">
</argument>
<description>
</description>
@@ -14601,17 +14917,17 @@
</member>
<member name="ambient_light_energy" type="float" setter="set_ambient_light_energy" getter="get_ambient_light_energy" brief="">
</member>
- <member name="ambient_light_skybox_contribution" type="float" setter="set_ambient_light_skybox_contribution" getter="get_ambient_light_skybox_contribution" brief="">
+ <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_expoure_enabled" type="bool" setter="set_tonemap_auto_exposure" getter="get_tonemap_auto_exposure" brief="">
+ <member name="auto_exposure_enabled" type="bool" setter="set_tonemap_auto_exposure" getter="get_tonemap_auto_exposure" brief="">
</member>
- <member name="auto_expoure_max_luma" type="float" setter="set_tonemap_auto_exposure_max" getter="get_tonemap_auto_exposure_max" brief="">
+ <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_expoure_min_luma" type="float" setter="set_tonemap_auto_exposure_min" getter="get_tonemap_auto_exposure_min" brief="">
+ <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_expoure_scale" type="float" setter="set_tonemap_auto_exposure_grey" getter="get_tonemap_auto_exposure_grey" brief="">
+ <member name="auto_exposure_scale" type="float" setter="set_tonemap_auto_exposure_grey" getter="get_tonemap_auto_exposure_grey" brief="">
</member>
- <member name="auto_expoure_speed" type="float" setter="set_tonemap_auto_exposure_speed" getter="get_tonemap_auto_exposure_speed" brief="">
+ <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>
@@ -14621,9 +14937,9 @@
</member>
<member name="background_mode" type="int" setter="set_background" getter="get_background" brief="">
</member>
- <member name="background_skybox" type="SkyBox" setter="set_skybox" getter="get_skybox" brief="">
+ <member name="background_sky" type="Sky" setter="set_sky" getter="get_sky" brief="">
</member>
- <member name="background_skybox_scale" type="float" setter="set_skybox_scale" getter="get_skybox_scale" brief="">
+ <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>
@@ -14645,6 +14961,32 @@
</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="">
@@ -14675,15 +15017,13 @@
</member>
<member name="glow_strength" type="float" setter="set_glow_strength" getter="get_glow_strength" brief="">
</member>
- <member name="ss_reflections_accel" type="float" setter="set_ssr_accel" getter="get_ssr_accel" brief="">
- </member>
- <member name="ss_reflections_accel_smooth" type="bool" setter="set_ssr_smooth" getter="is_ssr_smooth" 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" type="float" setter="set_ssr_fade" getter="get_ssr_fade" brief="">
+ <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>
@@ -14721,7 +15061,7 @@
</constant>
<constant name="BG_COLOR" value="1">
</constant>
- <constant name="BG_SKYBOX" value="2">
+ <constant name="BG_SKY" value="2">
</constant>
<constant name="BG_CANVAS" value="3">
</constant>
@@ -14914,7 +15254,7 @@
Get a [String] saved in Pascal format from the file.
</description>
</method>
- <method name="get_position" qualifiers="const">
+ <method name="get_pos" qualifiers="const">
<return type="int">
</return>
<description>
@@ -14960,6 +15300,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>
@@ -15106,6 +15459,15 @@
<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>
</constants>
</class>
<class name="FileDialog" inherits="ConfirmationDialog" category="Core">
@@ -15435,11 +15797,10 @@
<return type="bool">
</return>
<argument index="0" name="extended_check" type="bool" default="false">
- If true, also check if the associated script and object still exists.
- 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.
</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">
@@ -15471,6 +15832,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>
@@ -16599,6 +17032,120 @@
<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="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>
+ 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>
@@ -17620,40 +18167,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.
@@ -17668,15 +18181,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>
@@ -17718,9 +18231,9 @@
</theme_item>
<theme_item name="grabber" type="Texture">
</theme_item>
- <theme_item name="grabber_hilite" type="Texture">
+ <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>
@@ -18451,27 +18964,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">
@@ -18479,137 +19001,276 @@
</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="compressed">
- <return type="Image">
+ <method name="clear_mipmaps">
+ <description>
+ </description>
+ </method>
+ <method name="compress">
+ <return type="int">
</return>
- <argument index="0" name="format" type="int" default="0">
+ <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>
- 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="convert">
+ <argument index="0" name="format" 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="copy_from">
+ <argument index="0" name="src" type="Image">
+ </argument>
+ <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="3" name="format" type="int">
+ </argument>
+ <description>
+ Create an empty image of a specific size and format.
+ </description>
+ </method>
+ <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>
+ </description>
+ </method>
+ <method name="crop">
+ <argument index="0" name="width" type="int">
+ </argument>
+ <argument index="1" name="height" type="int">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <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">
+ <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_rect">
+ <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>
+ <description>
+ </description>
+ </method>
+ <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="resized">
- <return type="Image">
- </return>
+ <method name="lock">
+ <description>
+ </description>
+ </method>
+ <method name="normalmap_to_xy">
+ <description>
+ </description>
+ </method>
+ <method name="premultiply_alpha">
+ <description>
+ </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="color" type="Color">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="resize">
+ <argument index="0" name="width" type="int">
+ </argument>
+ <argument index="1" name="height" type="int">
+ </argument>
<argument index="2" name="interpolation" type="int" default="1">
</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">
+ <method name="resize_to_po2">
+ <argument index="0" name="square" type="bool" default="&quot;false&quot;">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="save_png" qualifiers="const">
<return type="int">
</return>
- <argument index="0" name="path" type="String" default="0">
+ <argument index="0" name="path" type="String">
</argument>
<description>
Save this [Image] as a png.
</description>
</method>
+ <method name="shrink_x2">
+ <description>
+ </description>
+ </method>
+ <method name="srgb_to_linear">
+ <description>
+ </description>
+ </method>
+ <method name="unlock">
+ <description>
+ </description>
+ </method>
</methods>
+ <members>
+ <member name="data" type="Dictionary" setter="_set_data" getter="_get_data" brief="">
+ </member>
+ </members>
<constants>
- <constant name="COMPRESS_16BIT" value="0">
- </constant>
- <constant name="COMPRESS_S3TC" value="1">
- </constant>
- <constant name="COMPRESS_PVRTC2" value="2">
- </constant>
- <constant name="COMPRESS_PVRTC4" value="3">
- </constant>
- <constant name="COMPRESS_ETC" value="4">
- </constant>
- <constant name="COMPRESS_ETC2" value="5">
- </constant>
<constant name="FORMAT_L8" value="0">
</constant>
<constant name="FORMAT_LA8" value="1">
@@ -18622,27 +19283,27 @@
</constant>
<constant name="FORMAT_RGBA8" value="5">
</constant>
- <constant name="FORMAT_RGB565" value="6">
+ <constant name="FORMAT_RGBA4444" value="6">
</constant>
- <constant name="FORMAT_RGBA4444" value="7">
+ <constant name="FORMAT_RGBA5551" value="7">
</constant>
- <constant name="FORMAT_RGBA5551" value="17">
+ <constant name="FORMAT_RF" value="8">
</constant>
- <constant name="FORMAT_RF" value="9">
+ <constant name="FORMAT_RGF" value="9">
</constant>
- <constant name="FORMAT_RGF" value="10">
+ <constant name="FORMAT_RGBF" value="10">
</constant>
- <constant name="FORMAT_RGBF" value="11">
+ <constant name="FORMAT_RGBAF" value="11">
</constant>
- <constant name="FORMAT_RGBAF" value="12">
+ <constant name="FORMAT_RH" value="12">
</constant>
- <constant name="FORMAT_RH" value="13">
+ <constant name="FORMAT_RGH" value="13">
</constant>
- <constant name="FORMAT_RGH" value="14">
+ <constant name="FORMAT_RGBH" value="14">
</constant>
- <constant name="FORMAT_RGBH" value="15">
+ <constant name="FORMAT_RGBAH" value="15">
</constant>
- <constant name="FORMAT_RGBAH" value="16">
+ <constant name="FORMAT_RGBE9995" value="16">
</constant>
<constant name="FORMAT_DXT1" value="17">
</constant>
@@ -18650,9 +19311,9 @@
</constant>
<constant name="FORMAT_DXT5" value="19">
</constant>
- <constant name="FORMAT_ATI1" value="20">
+ <constant name="FORMAT_RGTC_R" value="20">
</constant>
- <constant name="FORMAT_ATI2" value="21">
+ <constant name="FORMAT_RGTC_RG" value="21">
</constant>
<constant name="FORMAT_BPTC_RGBA" value="22">
</constant>
@@ -18692,59 +19353,27 @@
</constant>
<constant name="INTERPOLATE_CUBIC" value="2">
</constant>
- </constants>
-</class>
-<class name="ImageSkyBox" inherits="SkyBox" category="Core">
- <brief_description>
- </brief_description>
- <description>
- </description>
- <methods>
- <method name="get_image_path" qualifiers="const">
- <return type="String">
- </return>
- <argument index="0" name="image" type="int">
- </argument>
- <description>
- </description>
- </method>
- <method name="set_image_path">
- <argument index="0" name="image" type="int">
- </argument>
- <argument index="1" name="path" type="String">
- </argument>
- <description>
- </description>
- </method>
- </methods>
- <members>
- <member name="image_path_negative_x" type="String" setter="set_image_path" getter="get_image_path" brief="">
- </member>
- <member name="image_path_negative_y" type="String" setter="set_image_path" getter="get_image_path" brief="">
- </member>
- <member name="image_path_negative_z" type="String" setter="set_image_path" getter="get_image_path" brief="">
- </member>
- <member name="image_path_positive_x" type="String" setter="set_image_path" getter="get_image_path" brief="">
- </member>
- <member name="image_path_positive_y" type="String" setter="set_image_path" getter="get_image_path" brief="">
- </member>
- <member name="image_path_positive_z" type="String" setter="set_image_path" getter="get_image_path" brief="">
- </member>
- </members>
- <constants>
- <constant name="IMAGE_PATH_NEGATIVE_X" value="0">
+ <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="IMAGE_PATH_POSITIVE_X" value="1">
+ <constant name="COMPRESS_PVRTC2" value="1">
</constant>
- <constant name="IMAGE_PATH_NEGATIVE_Y" value="2">
+ <constant name="COMPRESS_PVRTC4" value="2">
</constant>
- <constant name="IMAGE_PATH_POSITIVE_Y" value="3">
+ <constant name="COMPRESS_ETC" value="3">
</constant>
- <constant name="IMAGE_PATH_NEGATIVE_Z" value="4">
+ <constant name="COMPRESS_ETC2" value="4">
</constant>
- <constant name="IMAGE_PATH_POSITIVE_Z" value="5">
+ <constant name="COMPRESS_SOURCE_GENERIC" value="0">
</constant>
- <constant name="IMAGE_PATH_MAX" value="6">
+ <constant name="COMPRESS_SOURCE_SRGB" value="1">
+ </constant>
+ <constant name="COMPRESS_SOURCE_NORMAL" value="2">
</constant>
</constants>
</class>
@@ -18780,10 +19409,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>
@@ -18819,14 +19444,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>
@@ -18854,10 +19471,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">
@@ -19186,7 +19799,7 @@
</description>
</method>
<method name="parse_input_event">
- <argument index="0" name="event" type="InputEvent">
+ <argument index="0" name="event" type="Object">
</argument>
<description>
</description>
@@ -19280,15 +19893,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">
@@ -19297,7 +19934,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">
@@ -19306,7 +19943,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">
@@ -19315,1045 +19952,627 @@
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>
- <argument index="1" name="pressed" type="bool">
+ <description>
+ </description>
+ </method>
+ <method name="set_id">
+ <argument index="0" name="id" type="int">
+ </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="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" setter="" getter="" brief="">
- Event identifier, positive integer increased at each new event.
- </member>
- <member name="device" type="int" setter="" getter="" brief="">
- Device identifier.
- </member>
- <member name="type" type="int" setter="" getter="" brief="">
- Type of event (one of the [InputEvent] constants).
- </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="JOYPAD_MOTION" value="4">
- Joypad motion event.
- </constant>
- <constant name="JOYPAD_BUTTON" value="5">
- Joypad 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">
- </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">
+ <method name="get_action" qualifiers="const">
+ <return type="String">
</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>
+ <method name="set_action">
<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>
- <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_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" setter="" getter="" brief="">
- Event identifier, positive integer increased at each new event.
- </member>
- <member name="device" type="int" setter="" getter="" brief="">
- Device identifier.
+ <member name="action" type="String" setter="set_action" getter="get_action" brief="">
</member>
- <member name="type" type="int" setter="" getter="" brief="">
- Type of event (one of the [InputEvent] constants).
+ <member name="pressed" type="bool" setter="set_pressed" getter="is_pressed" 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="JOYPAD_MOTION" value="4">
- Joypad motion event.
- </constant>
- <constant name="JOYPAD_BUTTON" value="5">
- Joypad 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="InputEventJoypadButton" category="Built-In Types">
+<class name="InputEventJoypadButton" inherits="InputEvent" category="Core">
<brief_description>
- Built-in input event type for joypad button events.
+ Input event type for joypad button events.
</brief_description>
<description>
- Input event type for joypad 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_pressure" 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_button_index">
+ <argument index="0" name="button_index" 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>
+ <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">
- </argument>
- <argument index="1" name="pressed" type="bool">
+ <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" setter="" getter="" brief="">
- Event identifier, positive integer increased at each new event.
- </member>
- <member name="button_index" type="int" setter="" getter="" brief="">
+ <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" setter="" getter="" brief="">
- Device identifier.
- </member>
- <member name="pressed" type="bool" setter="" getter="" brief="">
+ <member name="pressed" type="bool" setter="set_pressed" getter="is_pressed" brief="">
Pressed state of the joypad button.
</member>
- <member name="pressure" type="float" setter="" getter="" brief="">
+ <member name="pressure" type="float" setter="set_pressure" getter="get_pressure" brief="">
Intensity of the button pressure, ranges from 0 to 1.0.
</member>
- <member name="type" type="int" setter="" getter="" brief="">
- Type of event (one of the [InputEvent] constants).
- </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="JOYPAD_MOTION" value="4">
- Joypad motion event.
- </constant>
- <constant name="JOYPAD_BUTTON" value="5">
- Joypad 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="InputEventJoypadMotion" category="Built-In Types">
+<class name="InputEventJoypadMotion" inherits="InputEvent" category="Core">
<brief_description>
- Built-in input event type for joypad motion/axis events.
+ Input event type for joypad motion/axis events.
</brief_description>
<description>
- Input event type for joypad motion/axis 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>
</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" setter="" getter="" brief="">
- Event identifier, positive integer increased at each new event.
- </member>
- <member name="axis" type="int" setter="" getter="" brief="">
+ <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="device" type="int" setter="" getter="" brief="">
- Device identifier.
- </member>
- <member name="type" type="int" setter="" getter="" brief="">
- Type of event (one of the [InputEvent] constants).
- </member>
- <member name="value" type="float" setter="" getter="" brief="">
+ <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="JOYPAD_MOTION" value="4">
- Joypad motion event.
- </constant>
- <constant name="JOYPAD_BUTTON" value="5">
- Joypad 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="InputEventKey" inherits="InputEventWithModifiers" category="Core">
<brief_description>
- Built-in input event type for keyboard events.
+ Input event type for keyboard 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_scancode" 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_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.
</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" setter="" getter="" brief="">
- Event identifier, positive integer increased at each new event.
- </member>
- <member name="alt" type="bool" setter="" getter="" brief="">
- State of the Alt modifier.
- </member>
- <member name="control" type="bool" setter="" getter="" brief="">
- State of the Ctrl modifier.
- </member>
- <member name="device" type="int" setter="" getter="" brief="">
- Device identifier.
- </member>
- <member name="echo" type="bool" setter="" getter="" brief="">
+ <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="meta" type="bool" setter="" getter="" brief="">
- State of the Meta modifier.
- </member>
- <member name="pressed" type="bool" setter="" getter="" brief="">
+ <member name="pressed" type="bool" setter="set_pressed" getter="is_pressed" brief="">
Pressed state of the key.
</member>
- <member name="scancode" type="int" setter="" getter="" brief="">
+ <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="shift" type="bool" setter="" getter="" brief="">
- State of the Shift modifier.
- </member>
- <member name="type" type="int" setter="" getter="" brief="">
- Type of event (one of the [InputEvent] constants).
- </member>
- <member name="unicode" type="int" setter="" getter="" brief="">
+ <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="JOYPAD_MOTION" value="4">
- Joypad motion event.
- </constant>
- <constant name="JOYPAD_BUTTON" value="5">
- Joypad 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="InputEventMouse" inherits="InputEventWithModifiers" category="Core">
<brief_description>
- Built-in input event type for mouse button events.
+ Base input event type for mouse 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_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 (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_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" setter="" getter="" brief="">
- Event identifier, positive integer increased at each new event.
- </member>
- <member name="alt" type="bool" setter="" getter="" brief="">
- State of the Alt modifier.
- </member>
- <member name="button_index" type="int" setter="" getter="" brief="">
- Mouse button identifier, one of the BUTTON_* or BUTTON_WHEEL_* constants in [@Global Scope].
- </member>
- <member name="button_mask" type="int" setter="" getter="" brief="">
+ <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="control" type="bool" setter="" getter="" brief="">
- State of the Control modifier.
- </member>
- <member name="device" type="int" setter="" getter="" brief="">
- Device identifier.
- </member>
- <member name="doubleclick" type="bool" setter="" getter="" brief="">
- Whether the event is a double-click.
- </member>
- <member name="global_pos" type="Vector2" setter="" getter="" brief="">
+ <member name="global_position" type="Vector2" setter="set_global_position" getter="get_global_position" brief="">
Global position of the mouse click.
</member>
- <member name="global_x" type="float" setter="" getter="" brief="">
- Global X coordinate of the mouse click.
- </member>
- <member name="global_y" type="float" setter="" getter="" brief="">
- Global Y coordinate of the mouse click.
- </member>
- <member name="meta" type="bool" setter="" getter="" brief="">
- State of the Meta modifier.
- </member>
- <member name="pos" type="Vector2" setter="" getter="" brief="">
+ <member name="position" type="Vector2" setter="set_position" getter="get_position" brief="">
Local position of the mouse click.
</member>
- <member name="pressed" type="bool" setter="" getter="" brief="">
- Pressed state of the mouse button.
- </member>
- <member name="shift" type="bool" setter="" getter="" brief="">
- State of the Shift modifier.
- </member>
- <member name="type" type="int" setter="" getter="" brief="">
- Type of event (one of the [InputEvent] constants).
- </member>
- <member name="x" type="float" setter="" getter="" brief="">
- Local X coordinate of the mouse click.
- </member>
- <member name="y" type="float" setter="" getter="" brief="">
- 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="JOYPAD_MOTION" value="4">
- Joypad motion event.
- </constant>
- <constant name="JOYPAD_BUTTON" value="5">
- Joypad 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="InputEventMouseButton" inherits="InputEventMouse" category="Core">
<brief_description>
- Built-in input event type for mouse motion events.
+ Input event type for mouse button 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_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. Not relevant for MOUSE_MOTION events, always false.
</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). 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>
+ <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. Not relevant for MOUSE_MOTION events, always false.
</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 (irrelevant for this type) pressed status passed as argument.
</description>
</method>
</methods>
<members>
- <member name="ID" type="int" setter="" getter="" brief="">
- Event identifier, positive integer increased at each new event.
- </member>
- <member name="alt" type="bool" setter="" getter="" brief="">
- State of the Alt modifier.
- </member>
- <member name="button_mask" type="int" setter="" getter="" brief="">
- Mouse button mask identifier, one of or a bitwise combination of the BUTTON_MASK_* constants in [@Global Scope].
- </member>
- <member name="control" type="bool" setter="" getter="" brief="">
- State of the Ctrl modifier.
- </member>
- <member name="device" type="int" setter="" getter="" brief="">
- Device identifier.
- </member>
- <member name="global_pos" type="Vector2" setter="" getter="" brief="">
- Global position of the mouse pointer.
- </member>
- <member name="global_x" type="float" setter="" getter="" brief="">
- Global X coordinate of the mouse pointer.
+ <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="global_y" type="float" setter="" getter="" brief="">
- Global Y coordinate of the mouse pointer.
+ <member name="doubleclick" type="bool" setter="set_doubleclick" getter="is_doubleclick" brief="">
+ Whether the event is a double-click.
</member>
- <member name="meta" type="bool" setter="" getter="" brief="">
- State of the Meta modifier.
+ <member name="factor" type="float" setter="set_factor" getter="get_factor" brief="">
</member>
- <member name="pos" type="Vector2" setter="" getter="" brief="">
- Local position of the mouse pointer.
+ <member name="pressed" type="bool" setter="set_pressed" getter="is_pressed" brief="">
+ Pressed state of the mouse button.
</member>
- <member name="relative_pos" type="Vector2" setter="" getter="" brief="">
+ </members>
+ <constants>
+ </constants>
+</class>
+<class name="InputEventMouseMotion" inherits="InputEventMouse" category="Core">
+ <brief_description>
+ Input event type for mouse motion events.
+ </brief_description>
+ <description>
+ </description>
+ <methods>
+ <method name="get_relative" qualifiers="const">
+ <return type="Vector2">
+ </return>
+ <description>
+ </description>
+ </method>
+ <method name="get_speed" qualifiers="const">
+ <return type="Vector2">
+ </return>
+ <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>
+ </description>
+ </method>
+ </methods>
+ <members>
+ <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="float" setter="" getter="" brief="">
- X coordinate of the mouse pointer relative to the previous mouse position.
- </member>
- <member name="relative_y" type="float" setter="" getter="" brief="">
- Y coordinate of the mouse pointer relative to the previous mouse position.
- </member>
- <member name="shift" type="bool" setter="" getter="" brief="">
- State of the Shift modifier.
- </member>
- <member name="speed" type="Vector2" setter="" getter="" brief="">
+ <member name="speed" type="Vector2" setter="set_speed" getter="get_speed" brief="">
Speed of the mouse pointer.
</member>
- <member name="speed_x" type="float" setter="" getter="" brief="">
- Speed of the mouse pointer on the X axis.
- </member>
- <member name="speed_y" type="float" setter="" getter="" brief="">
- Speed of the mouse pointer on the Y axis.
- </member>
- <member name="type" type="int" setter="" getter="" brief="">
- Type of event (one of the [InputEvent] constants).
- </member>
- <member name="x" type="float" setter="" getter="" brief="">
- Local X coordinate of the mouse pointer.
- </member>
- <member name="y" type="float" setter="" getter="" brief="">
- 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="JOYPAD_MOTION" value="4">
- Joypad motion event.
- </constant>
- <constant name="JOYPAD_BUTTON" value="5">
- Joypad 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" setter="" getter="" brief="">
- Event identifier, positive integer increased at each new event.
- </member>
- <member name="device" type="int" setter="" getter="" brief="">
- Device identifier.
- </member>
- <member name="index" type="int" setter="" getter="" brief="">
+ <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" setter="" getter="" brief="">
+ <member name="position" type="Vector2" setter="set_position" getter="get_position" brief="">
Position of the drag event.
</member>
- <member name="relative_pos" type="Vector2" setter="" getter="" brief="">
+ <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" setter="" getter="" brief="">
- X coordinate of the drag event relative to its start position.
- </member>
- <member name="relative_y" type="float" setter="" getter="" brief="">
- Y coordinate of the drag event relative to its start position.
- </member>
- <member name="speed" type="Vector2" setter="" getter="" brief="">
+ <member name="speed" type="Vector2" setter="set_speed" getter="get_speed" brief="">
Speed of the drag event.
</member>
- <member name="speed_x" type="float" setter="" getter="" brief="">
- Speed of the drag event on the X axis.
- </member>
- <member name="speed_y" type="float" setter="" getter="" brief="">
- Speed of the drag event on the Y axis.
- </member>
- <member name="type" type="int" setter="" getter="" brief="">
- 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" setter="" getter="" brief="">
- 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" setter="" getter="" brief="">
- 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="JOYPAD_MOTION" value="4">
- Joypad motion event.
- </constant>
- <constant name="JOYPAD_BUTTON" value="5">
- Joypad 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>
- <argument index="1" name="pressed" type="bool">
+ <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>
+ <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" setter="" getter="" brief="">
- Event identifier, positive integer increased at each new event.
- </member>
- <member name="device" type="int" setter="" getter="" brief="">
- Device identifier.
- </member>
- <member name="index" type="int" setter="" getter="" brief="">
- Touch event index in the case of a multi-touch event.
- </member>
- <member name="pos" type="Vector2" setter="" getter="" brief="">
- 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" setter="" getter="" brief="">
- 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" setter="" getter="" brief="">
- 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" setter="" getter="" brief="">
- 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" setter="" getter="" brief="">
- 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="JOYPAD_MOTION" value="4">
- Joypad motion event.
- </constant>
- <constant name="JOYPAD_BUTTON" value="5">
- Joypad 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">
@@ -20361,13 +20580,12 @@
Singleton that manages actions.
</brief_description>
<description>
- Singleton that manages actions. InputMap has a list of the actions used in Ref<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.
@@ -20376,7 +20594,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.
@@ -20387,7 +20605,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.
@@ -20410,7 +20628,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>
@@ -20418,24 +20636,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>
@@ -21259,6 +21459,18 @@
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="get_move_and_slide_colliders" qualifiers="const">
+ <return type="Array">
+ </return>
+ <description>
+ </description>
+ </method>
+ <method name="get_travel" qualifiers="const">
+ <return type="Vector3">
+ </return>
+ <description>
+ </description>
+ </method>
<method name="is_colliding" qualifiers="const">
<return type="bool">
</return>
@@ -21266,6 +21478,24 @@
Return whether the body is colliding with another.
</description>
</method>
+ <method name="is_move_and_slide_on_ceiling" qualifiers="const">
+ <return type="bool">
+ </return>
+ <description>
+ </description>
+ </method>
+ <method name="is_move_and_slide_on_floor" qualifiers="const">
+ <return type="bool">
+ </return>
+ <description>
+ </description>
+ </method>
+ <method name="is_move_and_slide_on_wall" qualifiers="const">
+ <return type="bool">
+ </return>
+ <description>
+ </description>
+ </method>
<method name="move">
<return type="Vector3">
</return>
@@ -21275,6 +21505,26 @@
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_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="ceil_normal" type="Vector3" default="Vector3(0, 0, 0)">
+ </argument>
+ <argument index="3" name="slope_stop_min_velocity" type="float" default="5">
+ </argument>
+ <argument index="4" name="max_bounces" type="int" default="4">
+ </argument>
+ <argument index="5" name="floor_max_angle" type="float" default="0.785398">
+ </argument>
+ <argument index="6" name="ceil_max_angle" type="float" default="0.785398">
+ </argument>
+ <description>
+ </description>
+ </method>
<method name="move_to">
<return type="Vector3">
</return>
@@ -21284,6 +21534,10 @@
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>
+ </description>
+ </method>
<method name="set_collide_with_character_bodies">
<argument index="0" name="enable" type="bool">
</argument>
@@ -21968,9 +22222,7 @@
</constant>
<constant name="PARAM_SHADOW_BIAS" value="12">
</constant>
- <constant name="PARAM_SHADOW_BIAS_SPLIT_SCALE" value="13">
- </constant>
- <constant name="PARAM_MAX" value="14">
+ <constant name="PARAM_MAX" value="13">
</constant>
</constants>
</class>
@@ -22062,6 +22314,12 @@
<description>
</description>
</method>
+ <method name="get_shadow_smooth" qualifiers="const">
+ <return type="float">
+ </return>
+ <description>
+ </description>
+ </method>
<method name="get_texture" qualifiers="const">
<return type="Object">
</return>
@@ -22219,6 +22477,12 @@
<description>
</description>
</method>
+ <method name="set_shadow_smooth">
+ <argument index="0" name="smooth" type="float">
+ </argument>
+ <description>
+ </description>
+ </method>
<method name="set_texture">
<argument index="0" name="texture" type="Object">
</argument>
@@ -22290,6 +22554,8 @@
</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="">
@@ -22538,7 +22804,7 @@
</member>
<member name="end_cap_mode" type="int" setter="set_end_cap_mode" getter="get_end_cap_mode" brief="">
</member>
- <member name="gradient" type="ColorRamp" setter="set_gradient" getter="get_gradient" brief="">
+ <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>
@@ -23059,7 +23325,7 @@
</description>
</method>
<method name="input_event">
- <argument index="0" name="ev" type="InputEvent">
+ <argument index="0" name="ev" type="Object">
</argument>
<description>
</description>
@@ -23249,244 +23515,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_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="Array()">
- </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).
- (might be obsolete) 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_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 [Mesh] 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">
+ <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 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_outline" qualifiers="const">
+ <return type="ArrayMesh">
</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 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>
- <constant name="PRIMITIVE_LINES" value="1">
- Render array as lines (every two vertices a line is created).
- </constant>
- <constant name="PRIMITIVE_LINE_STRIP" value="2">
- Render array as line strip.
- </constant>
- <constant name="PRIMITIVE_LINE_LOOP" value="3">
- Render array as line loop (like line strip, but closed).
- </constant>
- <constant name="PRIMITIVE_TRIANGLES" value="4">
- Render array as triangles (every three vertices a triangle is created).
- </constant>
- <constant name="PRIMITIVE_TRIANGLE_STRIP" value="5">
- Render array as triangle strips.
- </constant>
- <constant name="PRIMITIVE_TRIANGLE_FAN" value="6">
- Render array as triangle fans.
- </constant>
</constants>
</class>
<class name="MeshDataTool" inherits="Reference" category="Core">
@@ -24616,6 +24678,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">
@@ -24777,12 +24841,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>
@@ -24801,12 +24859,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>
@@ -25020,8 +25072,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">
@@ -25043,16 +25093,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">
@@ -26136,7 +26182,7 @@
</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.
@@ -26650,7 +26696,7 @@
</description>
</method>
<method name="set_icon">
- <argument index="0" name="icon" type="Image">
+ <argument index="0" name="icon" type="Object">
</argument>
<description>
</description>
@@ -26900,7 +26946,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_*).
@@ -26946,7 +26992,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>
@@ -27258,7 +27304,7 @@
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">
@@ -27627,7 +27673,7 @@
<method name="instance" qualifiers="const">
<return type="Node">
</return>
- <argument index="0" name="edit_state" type="int" default="false">
+ <argument index="0" name="edit_state" type="int" default="0">
</argument>
<description>
</description>
@@ -27840,6 +27886,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.
@@ -28110,14 +28182,14 @@
<description>
</description>
<methods>
- <method name="get_amount" qualifiers="const">
- <return type="int">
+ <method name="capture_aabb" qualifiers="const">
+ <return type="Rect3">
</return>
<description>
</description>
</method>
- <method name="get_custom_aabb" qualifiers="const">
- <return type="Rect3">
+ <method name="get_amount" qualifiers="const">
+ <return type="int">
</return>
<description>
</description>
@@ -28160,12 +28232,6 @@
<description>
</description>
</method>
- <method name="get_gravity" qualifiers="const">
- <return type="Vector3">
- </return>
- <description>
- </description>
- </method>
<method name="get_lifetime" qualifiers="const">
<return type="float">
</return>
@@ -28190,12 +28256,24 @@
<description>
</description>
</method>
+ <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>
@@ -28208,12 +28286,6 @@
<description>
</description>
</method>
- <method name="set_custom_aabb">
- <argument index="0" name="aabb" type="Rect3">
- </argument>
- <description>
- </description>
- </method>
<method name="set_draw_order">
<argument index="0" name="order" type="int">
</argument>
@@ -28258,12 +28330,6 @@
<description>
</description>
</method>
- <method name="set_gravity">
- <argument index="0" name="accel_vec" type="Vector3">
- </argument>
- <description>
- </description>
- </method>
<method name="set_lifetime">
<argument index="0" name="secs" type="float">
</argument>
@@ -28288,18 +28354,28 @@
<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="custom_aabb" type="Rect3" setter="set_custom_aabb" getter="get_custom_aabb" 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="">
@@ -28320,8 +28396,6 @@
</member>
<member name="fract_delta" type="bool" setter="set_fractional_delta" getter="get_fractional_delta" brief="">
</member>
- <member name="gravity" type="Vector3" setter="set_gravity" getter="get_gravity" 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="">
@@ -28332,6 +28406,10 @@
</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">
@@ -28388,13 +28466,6 @@
<description>
</description>
</method>
- <method name="get_color_ramp" qualifiers="const">
- <return type="ColorRamp">
- </return>
- <description>
- Returns the [ColorRamp] used to tint each particle
- </description>
- </method>
<method name="get_emission_half_extents" qualifiers="const">
<return type="Vector2">
</return>
@@ -28428,6 +28499,13 @@
<description>
</description>
</method>
+ <method name="get_gradient" qualifiers="const">
+ <return type="Gradient">
+ </return>
+ <description>
+ Returns the [Gradient] used to tint each particle.
+ </description>
+ </method>
<method name="get_h_frames" qualifiers="const">
<return type="int">
</return>
@@ -28568,15 +28646,6 @@
<description>
</description>
</method>
- <method name="set_color_ramp">
- <return type="ColorRamp">
- </return>
- <argument index="0" name="color_ramp" type="Object">
- </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">
</argument>
@@ -28629,6 +28698,15 @@
<description>
</description>
</method>
+ <method name="set_gradient">
+ <return type="Gradient">
+ </return>
+ <argument index="0" name="gradient" type="Object">
+ </argument>
+ <description>
+ Sets the [Gradient] used to tint each particle. Particle will be tinted according to their lifetimes.
+ </description>
+ </method>
<method name="set_h_frames">
<argument index="0" name="enable" type="int">
</argument>
@@ -28710,7 +28788,7 @@
<members>
<member name="color/color" type="Color" setter="set_color" getter="get_color" brief="">
</member>
- <member name="color/color_ramp" type="ColorRamp" setter="set_color_ramp" getter="get_color_ramp" brief="">
+ <member name="color/color_ramp" type="Gradient" setter="set_color_ramp" getter="get_color_ramp" brief="">
</member>
<member name="color_phases/count" type="int" setter="set_color_phases" getter="get_color_phases" brief="">
</member>
@@ -28952,6 +29030,12 @@
<description>
</description>
</method>
+ <method name="get_gravity" qualifiers="const">
+ <return type="Vector3">
+ </return>
+ <description>
+ </description>
+ </method>
<method name="get_param" qualifiers="const">
<return type="float">
</return>
@@ -29062,6 +29146,12 @@
<description>
</description>
</method>
+ <method name="set_gravity">
+ <argument index="0" name="accel_vec" type="Vector3">
+ </argument>
+ <description>
+ </description>
+ </method>
<method name="set_param">
<argument index="0" name="param" type="int">
</argument>
@@ -29164,6 +29254,8 @@
</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="">
@@ -29917,9 +30009,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>
@@ -29940,9 +30032,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>
@@ -30125,22 +30217,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">
@@ -30288,31 +30380,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">
@@ -30476,6 +30568,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>
@@ -30508,15 +30609,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>
@@ -30663,7 +30755,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.
@@ -30716,9 +30808,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.
@@ -30762,7 +30854,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.
@@ -31066,18 +31158,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">
@@ -31115,18 +31207,18 @@
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">
@@ -31442,7 +31534,7 @@
</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 physics layers this area is in.
@@ -31772,9 +31864,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>
@@ -31927,15 +32019,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">
@@ -32083,23 +32175,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>
@@ -32237,6 +32325,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>
@@ -32265,14 +32361,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>
@@ -32964,14 +33052,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>
@@ -33000,14 +33088,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>
@@ -33318,6 +33406,60 @@
<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>
+ </constants>
+</class>
<class name="PlaneShape" inherits="Shape" category="Core">
<brief_description>
</brief_description>
@@ -33645,6 +33787,26 @@
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>
@@ -34563,6 +34725,13 @@
Returns a boolean that indicates whether or not the PopupMenu will hide on item selection.
</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_item_checkable" qualifiers="const">
<return type="bool">
</return>
@@ -34613,6 +34782,13 @@
Sets whether or not the PopupMenu will hide on item selection.
</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_item_ID">
<argument index="0" name="idx" type="int">
</argument>
@@ -34905,195 +35081,455 @@
<constants>
</constants>
</class>
-<class name="ProgressBar" inherits="Range" category="Core">
+<class name="PrimitiveMesh" inherits="Mesh" category="Core">
<brief_description>
- General purpose progress bar.
</brief_description>
<description>
- General purpose progress bar. Shows fill percentage from right to left.
</description>
<methods>
- <method name="is_percent_visible" qualifiers="const">
- <return type="bool">
+ <method name="get_material" qualifiers="const">
+ <return type="Material">
</return>
<description>
</description>
</method>
- <method name="set_percent_visible">
- <argument index="0" name="visible" type="bool">
+ <method name="set_material">
+ <argument index="0" name="material" type="Material">
</argument>
<description>
</description>
</method>
</methods>
<members>
- <member name="percent_visible" type="bool" setter="set_percent_visible" getter="is_percent_visible" brief="">
+ <member name="material" type="Material" setter="set_material" getter="get_material" brief="">
</member>
</members>
<constants>
</constants>
- <theme_items>
- <theme_item name="bg" type="StyleBox">
- </theme_item>
- <theme_item name="fg" 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_shadow" type="Color">
- </theme_item>
- </theme_items>
</class>
-<class name="ProximityGroup" inherits="Spatial" category="Core">
+<class name="PrismMesh" inherits="PrimitiveMesh" category="Core">
<brief_description>
- General purpose proximity-detection node.
</brief_description>
<description>
- General purpose proximity-detection node.
</description>
<methods>
- <method name="broadcast">
- <argument index="0" name="name" type="String">
- </argument>
- <argument index="1" name="parameters" type="Variant">
- </argument>
+ <method name="get_left_to_right" qualifiers="const">
+ <return type="float">
+ </return>
<description>
</description>
</method>
- <method name="get_grid_radius" qualifiers="const">
+ <method name="get_size" qualifiers="const">
<return type="Vector3">
</return>
<description>
</description>
</method>
- <method name="set_dispatch_mode">
- <argument index="0" name="mode" type="int">
+ <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_grid_radius">
- <argument index="0" name="radius" type="Vector3">
+ <method name="set_size">
+ <argument index="0" name="size" type="Vector3">
</argument>
<description>
</description>
</method>
- <method name="set_group_name">
- <argument index="0" name="name" type="String">
+ <method name="set_subdivide_depth">
+ <argument index="0" name="segments" type="int">
</argument>
<description>
</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">
+ <method name="set_subdivide_height">
+ <argument index="0" name="segments" type="int">
</argument>
- <argument index="1" name="parameters" type="Array">
+ <description>
+ </description>
+ </method>
+ <method name="set_subdivide_width">
+ <argument index="0" name="segments" type="int">
</argument>
<description>
</description>
- </signal>
- </signals>
+ </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="Quad" inherits="GeometryInstance" category="Core">
+<class name="ProceduralSky" inherits="Sky" category="Core">
<brief_description>
</brief_description>
<description>
</description>
<methods>
- <method name="get_axis" qualifiers="const">
- <return type="int">
+ <method name="get_ground_bottom_color" qualifiers="const">
+ <return type="Color">
</return>
<description>
</description>
</method>
- <method name="get_offset" qualifiers="const">
- <return type="Vector2">
+ <method name="get_ground_curve" qualifiers="const">
+ <return type="float">
</return>
<description>
</description>
</method>
- <method name="get_size" qualifiers="const">
- <return type="Vector2">
+ <method name="get_ground_energy" qualifiers="const">
+ <return type="float">
</return>
<description>
</description>
</method>
- <method name="is_centered" qualifiers="const">
- <return type="bool">
+ <method name="get_ground_horizon_color" qualifiers="const">
+ <return type="Color">
</return>
<description>
</description>
</method>
- <method name="set_axis">
- <argument index="0" name="axis" type="int">
+ <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_centered">
- <argument index="0" name="centered" type="bool">
+ <method name="set_ground_curve">
+ <argument index="0" name="curve" type="float">
</argument>
<description>
</description>
</method>
- <method name="set_offset">
- <argument index="0" name="offset" type="Vector2">
+ <method name="set_ground_energy">
+ <argument index="0" name="energy" type="float">
</argument>
<description>
</description>
</method>
- <method name="set_size">
- <argument index="0" name="size" type="Vector2">
+ <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="axis" type="int" setter="set_axis" getter="get_axis" brief="">
+ <member name="ground_bottom_color" type="Color" setter="set_ground_bottom_color" getter="get_ground_bottom_color" brief="">
</member>
- <member name="centered" type="bool" setter="set_centered" getter="is_centered" brief="">
+ <member name="ground_curve" type="float" setter="set_ground_curve" getter="get_ground_curve" brief="">
</member>
- <member name="offset" type="Vector2" setter="set_offset" getter="get_offset" brief="">
+ <member name="ground_energy" type="float" setter="set_ground_energy" getter="get_ground_energy" brief="">
</member>
- <member name="size" type="Vector2" setter="set_size" getter="get_size" brief="">
+ <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="QuadMesh" inherits="Mesh" category="Core">
+<class name="ProgressBar" inherits="Range" category="Core">
<brief_description>
+ General purpose progress bar.
</brief_description>
<description>
+ General purpose progress bar. Shows fill percentage from right to left.
</description>
<methods>
- <method name="get_material" qualifiers="const">
- <return type="Material">
+ <method name="is_percent_visible" qualifiers="const">
+ <return type="bool">
</return>
<description>
</description>
</method>
- <method name="set_material">
- <argument index="0" name="material" type="Material">
+ <method name="set_percent_visible">
+ <argument index="0" name="visible" type="bool">
</argument>
<description>
</description>
</method>
</methods>
<members>
- <member name="material" type="Material" setter="set_material" getter="get_material" brief="">
+ <member name="percent_visible" type="bool" setter="set_percent_visible" getter="is_percent_visible" brief="">
+ </member>
+ </members>
+ <constants>
+ </constants>
+ <theme_items>
+ <theme_item name="bg" type="StyleBox">
+ </theme_item>
+ <theme_item name="fg" 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_shadow" type="Color">
+ </theme_item>
+ </theme_items>
+</class>
+<class name="ProximityGroup" inherits="Spatial" category="Core">
+ <brief_description>
+ General purpose proximity-detection node.
+ </brief_description>
+ <description>
+ General purpose proximity-detection node.
+ </description>
+ <methods>
+ <method name="broadcast">
+ <argument index="0" name="name" type="String">
+ </argument>
+ <argument index="1" name="parameters" type="Variant">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="get_grid_radius" qualifiers="const">
+ <return type="Vector3">
+ </return>
+ <description>
+ </description>
+ </method>
+ <method name="set_dispatch_mode">
+ <argument index="0" name="mode" type="int">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="set_grid_radius">
+ <argument index="0" name="radius" type="Vector3">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="set_group_name">
+ <argument index="0" name="name" type="String">
+ </argument>
+ <description>
+ </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">
+ </argument>
+ <argument index="1" name="parameters" type="Array">
+ </argument>
+ <description>
+ </description>
+ </signal>
+ </signals>
+ <constants>
+ </constants>
+</class>
+<class name="QuadMesh" inherits="PrimitiveMesh" category="Core">
+ <brief_description>
+ </brief_description>
+ <description>
+ </description>
+ <methods>
+ </methods>
<constants>
</constants>
</class>
@@ -35169,6 +35605,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>
@@ -35190,13 +35633,6 @@
Returns a copy of the quaternion, normalized to unit length.
</description>
</method>
- <method name="is_normalized">
- <return type="bool">
- </return>
- <description>
- Returns whether the quaternion is normalized or not.
- </description>
- </method>
<method name="slerp">
<return type="Quat">
</return>
@@ -35483,6 +35919,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>
@@ -35497,13 +35940,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>
@@ -35545,18 +35981,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">
@@ -35570,9 +36006,9 @@
<members>
<member name="cast_to" type="Vector3" setter="set_cast_to" getter="get_cast_to" brief="">
</member>
- <member name="enabled" type="bool" setter="set_enabled" getter="is_enabled" brief="">
+ <member name="collision_layer" type="int" setter="set_collision_layer" getter="get_collision_layer" brief="">
</member>
- <member name="layer_mask" type="int" setter="set_layer_mask" getter="get_layer_mask" brief="">
+ <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>
@@ -35638,6 +36074,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>
@@ -35659,13 +36102,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>
@@ -35707,6 +36143,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>
@@ -35721,13 +36164,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>
@@ -35739,12 +36175,12 @@
<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="layer_mask" type="int" setter="set_layer_mask" getter="get_layer_mask" brief="">
- </member>
<member name="type_mask" type="int" setter="set_type_mask" getter="get_type_mask" brief="">
</member>
</members>
@@ -35884,6 +36320,30 @@
Return a copy of the [Rect2] grown a given amount of units towards all the sides.
</description>
</method>
+ <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>
+ </description>
+ </method>
+ <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>
+ </description>
+ </method>
<method name="has_no_area">
<return type="bool">
</return>
@@ -35923,8 +36383,7 @@
<member name="end" type="Vector2" setter="" getter="" brief="">
Ending corner.
</member>
- <member name="pos" type="Vector2" setter="" getter="" brief="">
- Position (starting corner).
+ <member name="position" type="Vector2" setter="" getter="" brief="">
</member>
<member name="size" type="Vector2" setter="" getter="" brief="">
Size from position to end.
@@ -36640,7 +37099,7 @@
<description>
</description>
</method>
- <method name="duplicate">
+ <method name="duplicate" qualifiers="const">
<return type="Object">
</return>
<argument index="0" name="subresources" type="bool" default="false">
@@ -39416,7 +39875,7 @@
</constant>
</constants>
</class>
-<class name="SkyBox" inherits="Resource" category="Core">
+<class name="Sky" inherits="Resource" category="Core">
<brief_description>
</brief_description>
<description>
@@ -39968,12 +40427,30 @@
<description>
</description>
</method>
+ <method name="get_depth_deep_parallax_max_layers" qualifiers="const">
+ <return type="int">
+ </return>
+ <description>
+ </description>
+ </method>
+ <method name="get_depth_deep_parallax_min_layers" qualifiers="const">
+ <return type="int">
+ </return>
+ <description>
+ </description>
+ </method>
<method name="get_depth_draw_mode" qualifiers="const">
<return type="int">
</return>
<description>
</description>
</method>
+ <method name="get_depth_scale" qualifiers="const">
+ <return type="float">
+ </return>
+ <description>
+ </description>
+ </method>
<method name="get_detail_blend_mode" qualifiers="const">
<return type="int">
</return>
@@ -40020,19 +40497,13 @@
<description>
</description>
</method>
- <method name="get_height_scale" qualifiers="const">
- <return type="float">
- </return>
- <description>
- </description>
- </method>
<method name="get_line_width" qualifiers="const">
<return type="float">
</return>
<description>
</description>
</method>
- <method name="get_metalness" qualifiers="const">
+ <method name="get_metallic" qualifiers="const">
<return type="float">
</return>
<description>
@@ -40074,12 +40545,6 @@
<description>
</description>
</method>
- <method name="get_refraction_roughness" qualifiers="const">
- <return type="float">
- </return>
- <description>
- </description>
- </method>
<method name="get_rim" qualifiers="const">
<return type="float">
</return>
@@ -40099,13 +40564,7 @@
</description>
</method>
<method name="get_specular" qualifiers="const">
- <return type="Color">
- </return>
- <description>
- </description>
- </method>
- <method name="get_specular_mode" qualifiers="const">
- <return type="int">
+ <return type="float">
</return>
<description>
</description>
@@ -40148,6 +40607,12 @@
<description>
</description>
</method>
+ <method name="is_depth_deep_parallax_enabled" qualifiers="const">
+ <return type="bool">
+ </return>
+ <description>
+ </description>
+ </method>
<method name="set_albedo">
<argument index="0" name="albedo" type="Color">
</argument>
@@ -40190,12 +40655,36 @@
<description>
</description>
</method>
+ <method name="set_depth_deep_parallax">
+ <argument index="0" name="enable" type="bool">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="set_depth_deep_parallax_max_layers">
+ <argument index="0" name="layer" type="int">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="set_depth_deep_parallax_min_layers">
+ <argument index="0" name="layer" type="int">
+ </argument>
+ <description>
+ </description>
+ </method>
<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>
@@ -40242,20 +40731,14 @@
<description>
</description>
</method>
- <method name="set_height_scale">
- <argument index="0" name="height_scale" type="float">
- </argument>
- <description>
- </description>
- </method>
<method name="set_line_width">
<argument index="0" name="line_width" type="float">
</argument>
<description>
</description>
</method>
- <method name="set_metalness">
- <argument index="0" name="metalness" type="float">
+ <method name="set_metallic">
+ <argument index="0" name="metallic" type="float">
</argument>
<description>
</description>
@@ -40296,12 +40779,6 @@
<description>
</description>
</method>
- <method name="set_refraction_roughness">
- <argument index="0" name="refraction_roughness" type="float">
- </argument>
- <description>
- </description>
- </method>
<method name="set_rim">
<argument index="0" name="rim" type="float">
</argument>
@@ -40321,13 +40798,7 @@
</description>
</method>
<method name="set_specular">
- <argument index="0" name="specular" type="Color">
- </argument>
- <description>
- </description>
- </method>
- <method name="set_specular_mode">
- <argument index="0" name="specular_mode" type="int">
+ <argument index="0" name="specular" type="float">
</argument>
<description>
</description>
@@ -40394,6 +40865,18 @@
</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="">
@@ -40424,11 +40907,11 @@
</member>
<member name="flags_use_point_size" type="bool" setter="set_flag" getter="get_flag" brief="">
</member>
- <member name="height_enabled" type="bool" setter="set_feature" getter="get_feature" brief="">
+ <member name="metallic_amount" type="float" setter="set_metallic" getter="get_metallic" brief="">
</member>
- <member name="height_scale" type="float" setter="set_height_scale" getter="get_height_scale" brief="">
+ <member name="metallic_specular" type="float" setter="set_specular" getter="get_specular" brief="">
</member>
- <member name="height_texture" type="Texture" setter="set_texture" getter="get_texture" brief="">
+ <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>
@@ -40456,11 +40939,9 @@
</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_displacement" type="float" setter="set_refraction" getter="get_refraction" brief="">
- </member>
<member name="refraction_enabled" type="bool" setter="set_feature" getter="get_feature" brief="">
</member>
- <member name="refraction_roughness" type="float" setter="set_refraction_roughness" getter="get_refraction_roughness" brief="">
+ <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>
@@ -40472,15 +40953,9 @@
</member>
<member name="rim_tint" type="float" setter="set_rim_tint" getter="get_rim_tint" brief="">
</member>
- <member name="specular_color" type="Color" setter="set_specular" getter="get_specular" brief="">
- </member>
- <member name="specular_metalness" type="float" setter="set_metalness" getter="get_metalness" brief="">
- </member>
- <member name="specular_mode" type="int" setter="set_specular_mode" getter="get_specular_mode" brief="">
+ <member name="roughness_amount" type="float" setter="set_roughness" getter="get_roughness" brief="">
</member>
- <member name="specular_roughness" type="float" setter="set_roughness" getter="get_roughness" brief="">
- </member>
- <member name="specular_texture" type="Texture" setter="set_texture" getter="get_texture" brief="">
+ <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>
@@ -40504,27 +40979,27 @@
<constants>
<constant name="TEXTURE_ALBEDO" value="0">
</constant>
- <constant name="TEXTURE_SPECULAR" value="1">
+ <constant name="TEXTURE_METALLIC" value="1">
</constant>
- <constant name="TEXTURE_EMISSION" value="2">
+ <constant name="TEXTURE_ROUGHNESS" value="2">
</constant>
- <constant name="TEXTURE_NORMAL" value="3">
+ <constant name="TEXTURE_EMISSION" value="3">
</constant>
- <constant name="TEXTURE_RIM" value="4">
+ <constant name="TEXTURE_NORMAL" value="4">
</constant>
- <constant name="TEXTURE_CLEARCOAT" value="5">
+ <constant name="TEXTURE_RIM" value="5">
</constant>
- <constant name="TEXTURE_FLOWMAP" value="6">
+ <constant name="TEXTURE_CLEARCOAT" value="6">
</constant>
- <constant name="TEXTURE_AMBIENT_OCCLUSION" value="7">
+ <constant name="TEXTURE_FLOWMAP" value="7">
</constant>
- <constant name="TEXTURE_HEIGHT" value="8">
+ <constant name="TEXTURE_AMBIENT_OCCLUSION" value="8">
</constant>
- <constant name="TEXTURE_SUBSURFACE_SCATTERING" value="9">
+ <constant name="TEXTURE_DEPTH" value="9">
</constant>
- <constant name="TEXTURE_REFRACTION" value="10">
+ <constant name="TEXTURE_SUBSURFACE_SCATTERING" value="10">
</constant>
- <constant name="TEXTURE_REFRACTION_ROUGHNESS" value="11">
+ <constant name="TEXTURE_REFRACTION" value="11">
</constant>
<constant name="TEXTURE_DETAIL_MASK" value="12">
</constant>
@@ -40552,7 +41027,7 @@
</constant>
<constant name="FEATURE_AMBIENT_OCCLUSION" value="6">
</constant>
- <constant name="FEATURE_HEIGHT_MAPPING" value="7">
+ <constant name="FEATURE_DEPTH_MAPPING" value="7">
</constant>
<constant name="FEATURE_SUBSURACE_SCATTERING" value="8">
</constant>
@@ -40600,16 +41075,12 @@
</constant>
<constant name="DIFFUSE_LAMBERT" value="0">
</constant>
- <constant name="DIFFUSE_LAMBERT_WRAP" value="1">
+ <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="SPECULAR_MODE_METALLIC" value="0">
- </constant>
- <constant name="SPECULAR_MODE_SPECULAR" value="1">
- </constant>
<constant name="BILLBOARD_DISABLED" value="0">
</constant>
<constant name="BILLBOARD_ENABLED" value="1">
@@ -40620,6 +41091,88 @@
</constant>
</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>
<class name="SphereShape" inherits="Shape" category="Core">
<brief_description>
</brief_description>
@@ -41845,7 +42398,7 @@
<description>
</description>
</method>
- <method name="get_position" qualifiers="const">
+ <method name="get_pos" qualifiers="const">
<return type="int">
</return>
<description>
@@ -42162,14 +42715,6 @@
<method name="String">
<return type="String">
</return>
- <argument index="0" name="from" type="InputEvent">
- </argument>
- <description>
- </description>
- </method>
- <method name="String">
- <return type="String">
- </return>
<argument index="0" name="from" type="Dictionary">
</argument>
<description>
@@ -43156,7 +43701,7 @@
</argument>
<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.
@@ -43459,7 +44004,7 @@
<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>
@@ -43473,7 +44018,7 @@
</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>
@@ -43481,7 +44026,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>
@@ -43489,8 +44034,6 @@
</theme_item>
<theme_item name="tab_bg" type="StyleBox">
</theme_item>
- <theme_item name="tab_disabled" type="StyleBox">
- </theme_item>
<theme_item name="tab_fg" type="StyleBox">
</theme_item>
<theme_item name="top_margin" type="int">
@@ -43627,6 +44170,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">
@@ -43651,7 +44200,7 @@
</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>
@@ -43665,7 +44214,7 @@
</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>
@@ -43675,26 +44224,12 @@
</theme_item>
<theme_item name="tab_bg" type="StyleBox">
</theme_item>
- <theme_item name="tab_disabled" type="StyleBox">
- </theme_item>
<theme_item name="tab_fg" type="StyleBox">
</theme_item>
<theme_item name="top_margin" type="int">
</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.
@@ -43799,7 +44334,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>
@@ -43807,7 +44342,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>
@@ -45020,6 +45555,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>
@@ -45027,6 +45570,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>
@@ -45219,13 +45770,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>
@@ -45234,6 +45793,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>
@@ -45326,7 +45893,7 @@
</member>
<member name="collision_friction" type="float" setter="set_collision_friction" getter="get_collision_friction" brief="">
</member>
- <member name="collision_layers" type="int" setter="set_collision_layer" getter="get_collision_layer" brief="">
+ <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>
@@ -46683,6 +47250,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>
@@ -46709,6 +47282,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>
@@ -46776,6 +47353,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">
@@ -46841,6 +47426,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>
@@ -47026,6 +47613,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>
@@ -47104,6 +47699,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>
@@ -47831,40 +48434,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).
@@ -47878,15 +48447,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>
@@ -47926,9 +48495,9 @@ do_property].
<theme_items>
<theme_item name="grabber" type="Texture">
</theme_item>
- <theme_item name="grabber_hilite" type="Texture">
+ <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>
@@ -48092,6 +48661,13 @@ do_property].
Remove the fractional part of x and y.
</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>
@@ -48124,13 +48700,6 @@ do_property].
Returns a normalized vector to unit length.
</description>
</method>
- <method name="is_normalized">
- <return type="bool">
- </return>
- <description>
- Returns whether the vector is normalized or not.
- </description>
- </method>
<method name="reflect">
<return type="Vector2">
</return>
@@ -48309,6 +48878,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>
@@ -48355,13 +48931,6 @@ do_property].
Return a copy of the normalized vector to unit length. This is the same as v / v.length().
</description>
</method>
- <method name="is_normalized">
- <return type="bool">
- </return>
- <description>
- Returns whether the vector is normalized or not.
- </description>
- </method>
<method name="outer">
<return type="Basis">
</return>
@@ -48565,6 +49134,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>
@@ -48589,6 +49164,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>
@@ -48625,6 +49206,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>
@@ -48683,6 +49270,8 @@ do_property].
</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>
@@ -48926,6 +49515,12 @@ do_property].
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="Transform2D">
</return>
@@ -48967,11 +49562,12 @@ do_property].
Get whether picking for all physics objects inside the viewport is enabled.
</description>
</method>
- <method name="get_screen_capture" qualifiers="const">
- <return type="Image">
+ <method name="get_render_info">
+ <return type="int">
</return>
+ <argument index="0" name="info" type="int">
+ </argument>
<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_shadow_atlas_quadrant_subdiv" qualifiers="const">
@@ -49016,6 +49612,12 @@ do_property].
Get when the viewport would be updated, will be one of the [code]UPDATE_*[/code] constants.
</description>
</method>
+ <method name="get_usage" qualifiers="const">
+ <return type="int">
+ </return>
+ <description>
+ </description>
+ </method>
<method name="get_vflip" qualifiers="const">
<return type="bool">
</return>
@@ -49073,7 +49675,7 @@ 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>
@@ -49126,11 +49728,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="set_as_audio_listener">
<argument index="0" name="enable" type="bool">
</argument>
@@ -49164,6 +49761,12 @@ do_property].
<description>
</description>
</method>
+ <method name="set_debug_draw">
+ <argument index="0" name="debug_draw" type="int">
+ </argument>
+ <description>
+ </description>
+ </method>
<method name="set_disable_3d">
<argument index="0" name="disable" type="bool">
</argument>
@@ -49256,6 +49859,12 @@ do_property].
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>
@@ -49284,7 +49893,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>
@@ -49307,6 +49916,8 @@ do_property].
</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="">
@@ -49339,6 +49950,8 @@ do_property].
</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>
@@ -49377,6 +49990,28 @@ do_property].
</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">
@@ -50508,24 +51143,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>
@@ -50536,8 +51159,6 @@ do_property].
<members>
<member name="elem_cache" type="Array" setter="_set_elem_cache" getter="_get_elem_cache" brief="">
</member>
- <member name="input_type" type="int" setter="set_deconstruct_input_type" getter="get_deconstruct_input_type" brief="">
- </member>
<member name="type" type="int" setter="set_deconstruct_type" getter="get_deconstruct_type" brief="">
</member>
</members>
@@ -50898,16 +51519,6 @@ do_property].
<constants>
</constants>
</class>
-<class name="VisualScriptInputFilter" inherits="VisualScriptNode" category="Core">
- <brief_description>
- </brief_description>
- <description>
- </description>
- <methods>
- </methods>
- <constants>
- </constants>
-</class>
<class name="VisualScriptIterator" inherits="VisualScriptNode" category="Core">
<brief_description>
</brief_description>
@@ -51168,12 +51779,6 @@ do_property].
<description>
</description>
</method>
- <method name="get_event_type" qualifiers="const">
- <return type="int">
- </return>
- <description>
- </description>
- </method>
<method name="get_property" qualifiers="const">
<return type="String">
</return>
@@ -51210,12 +51815,6 @@ do_property].
<description>
</description>
</method>
- <method name="set_event_type">
- <argument index="0" name="event_type" type="int">
- </argument>
- <description>
- </description>
- </method>
<method name="set_property">
<argument index="0" name="property" type="String">
</argument>
@@ -51230,8 +51829,6 @@ do_property].
</member>
<member name="property/basic_type" type="int" setter="set_basic_type" getter="get_basic_type" brief="">
</member>
- <member name="property/event_type" type="int" setter="set_event_type" getter="get_event_type" brief="">
- </member>
<member name="property/node_path" type="NodePath" setter="set_base_path" getter="get_base_path" brief="">
</member>
<member name="property/property" type="String" setter="set_property" getter="get_property" brief="">
@@ -51286,12 +51883,6 @@ do_property].
<description>
</description>
</method>
- <method name="get_event_type" qualifiers="const">
- <return type="int">
- </return>
- <description>
- </description>
- </method>
<method name="get_property" qualifiers="const">
<return type="String">
</return>
@@ -51328,12 +51919,6 @@ do_property].
<description>
</description>
</method>
- <method name="set_event_type">
- <argument index="0" name="event_type" type="int">
- </argument>
- <description>
- </description>
- </method>
<method name="set_property">
<argument index="0" name="property" type="String">
</argument>
@@ -51348,8 +51933,6 @@ do_property].
</member>
<member name="property/basic_type" type="int" setter="set_basic_type" getter="get_basic_type" brief="">
</member>
- <member name="property/event_type" type="int" setter="set_event_type" getter="get_event_type" brief="">
- </member>
<member name="property/node_path" type="NodePath" setter="set_base_path" getter="get_base_path" brief="">
</member>
<member name="property/property" type="String" setter="set_property" getter="get_property" brief="">
@@ -51772,7 +52355,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>
@@ -51895,7 +52478,7 @@ 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>
@@ -51909,8 +52492,6 @@ do_property].
</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">
@@ -51933,6 +52514,12 @@ do_property].
<description>
</description>
</method>
+ <method name="get_fallback_environment" qualifiers="const">
+ <return type="Environment">
+ </return>
+ <description>
+ </description>
+ </method>
<method name="get_scenario" qualifiers="const">
<return type="RID">
</return>
@@ -51951,10 +52538,18 @@ 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>
@@ -52004,7 +52599,7 @@ do_property].
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).
+ 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">
@@ -52343,4 +52938,3 @@ do_property].
</constants>
</class>
</doc>
-
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..8a117f6450 100644
--- a/doc/tools/makerst.py
+++ b/doc/tools/makerst.py
@@ -441,6 +441,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/gles2/rasterizer_gles2.cpp b/drivers/gles2/rasterizer_gles2.cpp
index 3c543365f0..25c0f8925d 100644
--- a/drivers/gles2/rasterizer_gles2.cpp
+++ b/drivers/gles2/rasterizer_gles2.cpp
@@ -4199,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);
@@ -6481,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]) {
@@ -6491,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);
diff --git a/drivers/gles2/rasterizer_gles2.h b/drivers/gles2/rasterizer_gles2.h
index e6b76a4e92..e86d3ba298 100644
--- a/drivers/gles2/rasterizer_gles2.h
+++ b/drivers/gles2/rasterizer_gles2.h
@@ -689,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;
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 4f6d68de43..268d6b44c6 100644
--- a/drivers/gles3/rasterizer_canvas_gles3.cpp
+++ b/drivers/gles3/rasterizer_canvas_gles3.cpp
@@ -28,9 +28,10 @@
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
#include "rasterizer_canvas_gles3.h"
-
+#include "global_config.h"
#include "os/os.h"
-
+#include "rasterizer_scene_gles3.h"
+#include "servers/visual/visual_server_raster.h"
#ifndef GLES_OVER_GL
#define glClearDepth glClearDepthf
#endif
@@ -113,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)
@@ -164,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());
@@ -178,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() {
@@ -186,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 {
+
+ if (texture->render_target)
+ texture->render_target->used_in_frame = true;
- glBindTexture(GL_TEXTURE_2D, texture->tex_id);
- state.current_tex = p_texture;
- state.current_tex_ptr = texture;
+ glActiveTexture(GL_TEXTURE0);
+ glBindTexture(GL_TEXTURE_2D, texture->tex_id);
+ state.current_tex = p_texture;
+ state.current_tex_ptr = texture;
- return 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) {
@@ -238,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) {
@@ -404,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);
@@ -429,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: {
@@ -460,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) {
@@ -473,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;
@@ -489,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) {
@@ -500,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);
}
@@ -513,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;
- }
-
- Size2 texpixel_size(1.0 / texture->width, 1.0 / texture->height);
+ RasterizerStorageGLES3::Texture *texture = _bind_canvas_texture(np->texture, np->normal_map);
- state.canvas_shader.set_uniform(CanvasShaderGLES3::COLOR_TEXPIXEL_SIZE, 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(np->source.pos.x, np->source.pos.y, np->margin[MARGIN_LEFT], np->margin[MARGIN_TOP]);
- glDrawArrays(GL_TRIANGLE_FAN, 0, 4);
+ Size2 texpixel_size;
- //top right
- DSTRECT(np->rect.pos.x + np->rect.size.width - np->margin[MARGIN_RIGHT], np->rect.pos.y, np->margin[MARGIN_RIGHT], np->margin[MARGIN_TOP]);
- SRCRECT(np->source.pos.x + np->source.size.width - np->margin[MARGIN_RIGHT], np->source.pos.y, 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.width - np->margin[MARGIN_RIGHT], np->rect.pos.y + np->rect.size.height - np->margin[MARGIN_BOTTOM], np->margin[MARGIN_RIGHT], np->margin[MARGIN_BOTTOM]);
- SRCRECT(np->source.pos.x + np->source.size.width - np->margin[MARGIN_RIGHT], np->source.pos.y + np->source.size.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.height - np->margin[MARGIN_BOTTOM], np->margin[MARGIN_LEFT], np->margin[MARGIN_BOTTOM]);
- SRCRECT(np->source.pos.x, np->source.pos.y + np->source.size.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->source.pos.x + np->margin[MARGIN_LEFT], np->source.pos.y, np->source.size.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.height - np->margin[MARGIN_BOTTOM], np->rect.size.width - np->margin[MARGIN_LEFT] - np->margin[MARGIN_RIGHT], np->margin[MARGIN_TOP]);
- SRCRECT(np->source.pos.x + np->margin[MARGIN_LEFT], np->source.pos.y + np->source.size.height - np->margin[MARGIN_BOTTOM], np->source.size.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(np->source.pos.x, np->source.pos.y + np->margin[MARGIN_TOP], np->margin[MARGIN_LEFT], np->source.size.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(np->source.pos.x + np->source.size.width - np->margin[MARGIN_RIGHT], np->source.pos.y + np->margin[MARGIN_TOP], np->margin[MARGIN_RIGHT], np->source.size.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->source.pos.x + np->margin[MARGIN_LEFT], np->source.pos.y + np->margin[MARGIN_TOP], np->source.size.x - np->margin[MARGIN_LEFT] - np->margin[MARGIN_RIGHT], np->source.size.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;
@@ -595,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);
@@ -618,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: {
@@ -644,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;
@@ -670,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;
@@ -742,6 +939,78 @@ void RasterizerGLES2::_canvas_item_setup_shader_params(ShaderMaterial *material,
#endif
+void RasterizerCanvasGLES3::_copy_texscreen(const Rect2 &p_rect) {
+
+ 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
+
+ if (state.using_texture_rect) {
+ state.using_texture_rect = false;
+ _set_texture_rect_mode(state.using_texture_rect, state.using_ninepatch);
+ }
+}
+
void RasterizerCanvasGLES3::canvas_render_items(Item *p_item_list, int p_z, const Color &p_modulate, Light *p_light) {
Item *current_clip = NULL;
@@ -759,6 +1028,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);
@@ -787,51 +1057,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);
- } else {
- glReadBuffer(GL_BACK);
- }
-#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)
+ _copy_texscreen(Rect2());
} else {
- glCopyTexSubImage2D(GL_TEXTURE_2D,0,x,y,x,y,viewport.width,viewport.height);
+ _copy_texscreen(ci->copy_back_buffer->rect);
}
-
- canvas_texscreen_used=true;
- glActiveTexture(GL_TEXTURE0);
-
}
-#endif
-
//begin rect
Item *material_owner = ci->material_owner ? ci->material_owner : ci;
@@ -853,6 +1096,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();
@@ -866,7 +1114,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) {
@@ -965,7 +1213,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);
@@ -1108,7 +1360,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;
@@ -1165,7 +1417,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);
@@ -1264,18 +1515,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() {
@@ -1299,8 +1546,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);
@@ -1327,9 +1577,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);
@@ -1340,8 +1588,10 @@ 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);
}
@@ -1373,18 +1623,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/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;
@@ -1415,6 +1701,15 @@ void RasterizerCanvasGLES3::initialize() {
glBindVertexArray(0);
}
+
+ glGenVertexArrays(1, &data.polygon_buffer_pointer_array);
+
+ uint32_t index_size = GLOBAL_DEF("rendering/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);
@@ -1425,7 +1720,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);
@@ -1436,6 +1731,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 95ef9ee443..c0af22b5e8 100644
--- a/drivers/gles3/rasterizer_canvas_gles3.h
+++ b/drivers/gles3/rasterizer_canvas_gles3.h
@@ -32,23 +32,34 @@
#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;
};
+ 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;
@@ -60,8 +71,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;
@@ -103,12 +116,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);
diff --git a/drivers/gles3/rasterizer_gles3.cpp b/drivers/gles3/rasterizer_gles3.cpp
index aa4150cbe4..0cfa8a7d6e 100644
--- a/drivers/gles3/rasterizer_gles3.cpp
+++ b/drivers/gles3/rasterizer_gles3.cpp
@@ -212,11 +212,8 @@ void RasterizerGLES3::begin_frame() {
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();
}
@@ -301,18 +298,18 @@ void RasterizerGLES3::set_boot_image(const Ref<Image> &p_image, const Color &p_c
//scale horizontally
screenrect.size.y = window_h;
screenrect.size.x = imgrect.size.x * window_h / imgrect.size.y;
- screenrect.pos.x = (window_w - screenrect.size.x) / 2;
+ 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.pos.y = (window_h - screenrect.size.y) / 2;
+ screenrect.position.y = (window_h - screenrect.size.y) / 2;
}
} else {
screenrect = imgrect;
- screenrect.pos += ((Size2(window_w, window_h) - screenrect.size) / 2.0).floor();
+ screenrect.position += ((Size2(window_w, window_h) - screenrect.size) / 2.0).floor();
}
RasterizerStorageGLES3::Texture *t = storage->texture_owner.get(texture);
@@ -415,6 +412,7 @@ RasterizerGLES3::RasterizerGLES3() {
canvas = memnew(RasterizerCanvasGLES3);
scene = memnew(RasterizerSceneGLES3);
canvas->storage = storage;
+ canvas->scene_render = scene;
storage->canvas = canvas;
scene->storage = storage;
storage->scene = scene;
diff --git a/drivers/gles3/rasterizer_scene_gles3.cpp b/drivers/gles3/rasterizer_scene_gles3.cpp
index 7138363796..e8c6502bf4 100644
--- a/drivers/gles3/rasterizer_scene_gles3.cpp
+++ b/drivers/gles3/rasterizer_scene_gles3.cpp
@@ -869,7 +869,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 +878,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 +932,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 +1024,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 +1039,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 +1228,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,6 +1242,15 @@ bool RasterizerSceneGLES3::_setup_material(RasterizerStorageGLES3::Material *p_m
t->detect_3d(t->detect_3d_ud);
}
#endif
+
+#ifdef TOOLS_ENABLED
+ 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;
+
if (storage->config.srgb_decode_supported) {
//if SRGB decode extension is present, simply switch the texture to whathever is needed
bool must_srgb = false;
@@ -1247,8 +1321,11 @@ void RasterizerSceneGLES3::_setup_geometry(RenderList::Element *e, const Transfo
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
}
@@ -1258,7 +1335,16 @@ void RasterizerSceneGLES3::_setup_geometry(RenderList::Element *e, const Transfo
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;
@@ -1323,13 +1409,26 @@ void RasterizerSceneGLES3::_setup_geometry(RenderList::Element *e, const Transfo
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
+ glBindVertexArray(s->instancing_array_id); // use the instancing array ID
+ }
glBindBuffer(GL_ARRAY_BUFFER, particles->particle_buffer_histories[1]); //modify the buffer
} else {
-
- 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 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
}
@@ -1378,17 +1477,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;
@@ -1399,17 +1506,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;
@@ -1435,7 +1550,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)) {
@@ -1557,18 +1672,25 @@ void RasterizerSceneGLES3::_render_geometry(RenderList::Element *e) {
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 (s->index_array_len > 0) {
+ 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);
+ 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);
+ storage->info.render.vertices_count += s->array_len * (amount - split);
}
}
@@ -1588,34 +1710,49 @@ void RasterizerSceneGLES3::_render_geometry(RenderList::Element *e) {
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 (s->index_array_len > 0) {
+ 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;
+ 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;
+ storage->info.render.vertices_count += s->array_len * split;
}
}
} else {
- 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;
}
}
@@ -1697,7 +1834,7 @@ 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);
+ 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);
@@ -1709,7 +1846,7 @@ void RasterizerSceneGLES3::_setup_light(RenderList::Element *e, const Transform
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);
@@ -1740,30 +1877,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;
@@ -1793,7 +1931,7 @@ void RasterizerSceneGLES3::_render_list(RenderList::Element **p_elements, int p_
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++) {
@@ -1808,7 +1946,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;
}
@@ -1817,7 +1955,7 @@ 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);
@@ -1830,6 +1968,7 @@ 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::SHADELESS,true);
} else {
@@ -1845,8 +1984,9 @@ 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);
- 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) {
@@ -1934,30 +2074,30 @@ 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);
+ 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, p_view_transform);
- storage->info.render_surface_switch_count++;
+ storage->info.render.surface_switch_count++;
}
_set_cull(e->sort_key & RenderList::SORT_KEY_MIRROR_FLAG, p_reverse_cull);
@@ -2000,6 +2140,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) {
@@ -2012,7 +2156,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;
}
}
@@ -2023,7 +2167,19 @@ void RasterizerSceneGLES3::_add_geometry(RasterizerStorageGLES3::Geometry *p_geo
ERR_FAIL_COND(!m);
- bool has_base_alpha = (m->shader->spatial.uses_alpha);
+ _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 *m, bool p_shadow) {
+
+ bool has_base_alpha = (m->shader->spatial.uses_alpha || m->shader->spatial.uses_screen_texture || m->shader->spatial.unshaded);
bool has_blend_alpha = m->shader->spatial.blend_mode != RasterizerStorageGLES3::Shader::Spatial::BLEND_MODE_MIX || m->shader->spatial.ontop;
bool has_alpha = has_base_alpha || has_blend_alpha;
bool shadow = false;
@@ -2038,6 +2194,10 @@ void RasterizerSceneGLES3::_add_geometry(RasterizerStorageGLES3::Geometry *p_geo
state.used_sss = true;
}
+ if (m->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))
@@ -2071,7 +2231,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;
@@ -2099,7 +2259,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;
}
}
@@ -2114,9 +2274,9 @@ 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 || m->shader->spatial.unshaded || state.debug_draw == VS::VIEWPORT_DEBUG_DRAW_UNSHADED) {
- e->sort_key |= RenderList::SORT_KEY_UNSHADED_FLAG;
+ e->sort_key |= SORT_KEY_UNSHADED_FLAG;
}
}
@@ -2209,10 +2369,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;
@@ -2244,6 +2403,30 @@ void RasterizerSceneGLES3::_setup_environment(Environment *env, const CameraMatr
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;
@@ -2261,6 +2444,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;
}
{
@@ -2343,8 +2528,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;
@@ -2389,8 +2574,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;
}
@@ -2579,8 +2764,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;
@@ -2797,6 +2982,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
@@ -2874,6 +3060,39 @@ void RasterizerSceneGLES3::_fill_render_list(InstanceBase **p_cull_result, int p
}
}
+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();
+ 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);
+ }
+}
+
void RasterizerSceneGLES3::_render_mrts(Environment *env, const CameraMatrix &p_cam_projection) {
glDepthMask(GL_FALSE);
@@ -3028,8 +3247,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);
@@ -3045,8 +3264,11 @@ 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);
@@ -3056,10 +3278,15 @@ void RasterizerSceneGLES3::_render_mrts(Environment *env, const CameraMatrix &p_
_copy_screen();
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();
+
+ 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) {
@@ -3072,38 +3299,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();
@@ -3119,9 +3319,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);
@@ -3151,6 +3351,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) {
@@ -3167,6 +3369,13 @@ void RasterizerSceneGLES3::_render_mrts(Environment *env, const CameraMatrix &p_
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));
@@ -3209,19 +3418,21 @@ void RasterizerSceneGLES3::_post_process(Environment *env, const CameraMatrix &p
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();
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;
}
@@ -3395,7 +3606,7 @@ 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);
@@ -3508,7 +3719,7 @@ 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 {
@@ -3584,6 +3795,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);
@@ -3606,6 +3829,11 @@ void RasterizerSceneGLES3::_post_process(Environment *env, const CameraMatrix &p
state.tonemap_shader.set_uniform(TonemapShaderGLES3::AUTO_EXPOSURE_GREY, env->auto_exposure_grey);
}
+ if (env->adjustments_enabled) {
+
+ state.tonemap_shader.set_uniform(TonemapShaderGLES3::BCS, Vector3(env->adjustments_brightness, env->adjustments_contrast, env->adjustments_saturation));
+ }
+
_copy_screen();
//turn off everything used
@@ -3624,6 +3852,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) {
@@ -3633,12 +3864,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);
@@ -3647,7 +3880,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);
}
@@ -3659,8 +3892,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;
@@ -3677,7 +3910,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->frame.current_rt && state.debug_draw != VS::VIEWPORT_DEBUG_DRAW_OVERDRAW) { //detect with state.used_contact_shadows too
//pre z pass
glDisable(GL_BLEND);
@@ -3711,7 +3944,7 @@ 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);
}
@@ -3764,7 +3997,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);
@@ -3813,7 +4051,14 @@ void RasterizerSceneGLES3::render_scene(const Transform &p_cam_transform, const
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) {
@@ -3821,6 +4066,10 @@ 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();
@@ -3838,28 +4087,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();
+
+ //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);
@@ -3881,14 +4156,14 @@ void RasterizerSceneGLES3::render_scene(const Transform &p_cam_transform, const
glDrawBuffers(1, &gldb);
}
- if (env && env->bg_mode == VS::ENV_BG_SKY) {
+ if (env && env->bg_mode == VS::ENV_BG_SKY && !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 sky, only diffuse/ambient matters
*/
- _draw_sky(sky, p_cam_projection, p_cam_transform, storage->frame.current_rt && storage->frame.current_rt->flags[RasterizerStorage::RENDER_TARGET_VFLIP], env->sky_scale, env->bg_energy);
+ _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);
@@ -3898,6 +4173,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 (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 (state.used_screen_texture) {
+ 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);
@@ -3970,153 +4264,12 @@ 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
}
void RasterizerSceneGLES3::render_shadow(RID p_light, RID p_shadow_atlas, int p_pass, InstanceBase **p_cull_result, int p_cull_count) {
@@ -4157,15 +4310,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;
}
}
}
@@ -4173,8 +4326,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;
@@ -4206,8 +4359,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;
@@ -4325,8 +4478,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;
@@ -4438,136 +4591,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();
- storage->shader_set_code(default_shader, "shader_type spatial;\n");
- default_material = storage->material_create();
- storage->material_set_shader(default_material, default_shader);
+ {
+ //default material and shader
- 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);
+ 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);
@@ -4605,7 +4661,6 @@ void RasterizerSceneGLES3::initialize() {
}
render_list.init();
state.cube_to_dp_shader.init();
- _generate_brdf();
shadow_atlas_realloc_tolerance_msec = 500;
@@ -4654,7 +4709,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_DEF("rendering/shadows/directional_shadow_size", 4096));
glGenFramebuffers(1, &directional_shadow.fbo);
glBindFramebuffer(GL_FRAMEBUFFER, directional_shadow.fbo);
glGenTextures(1, &directional_shadow.depth);
@@ -4852,6 +4907,8 @@ 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() {
diff --git a/drivers/gles3/rasterizer_scene_gles3.h b/drivers/gles3/rasterizer_scene_gles3.h
index 322343bc89..37bbd60797 100644
--- a/drivers/gles3/rasterizer_scene_gles3.h
+++ b/drivers/gles3/rasterizer_scene_gles3.h
@@ -33,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:
@@ -77,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;
@@ -108,22 +111,37 @@ 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;
+
} ubo_data;
GLuint scene_ubo;
@@ -137,8 +155,6 @@ public:
GLuint env_radiance_ubo;
- GLuint brdf_texture;
-
GLuint sky_verts;
GLuint sky_array;
@@ -170,7 +186,9 @@ public:
bool cull_front;
bool used_sss;
+ bool used_screen_texture;
+ VS::ViewportDebugDraw debug_draw;
} state;
/* SHADOW ATLAS API */
@@ -342,10 +360,9 @@ public:
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;
@@ -364,7 +381,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;
@@ -389,6 +406,27 @@ 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;
sky_scale = 1.0;
@@ -400,10 +438,9 @@ public:
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;
@@ -430,7 +467,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;
@@ -445,6 +482,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;
}
};
@@ -462,16 +522,25 @@ public:
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_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 {
@@ -497,6 +566,7 @@ public:
Transform transform;
float farplane;
float split;
+ float bias_scale;
};
ShadowTransform shadow_transform[4];
@@ -532,7 +602,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 */
@@ -571,9 +641,10 @@ 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,
+//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)
SORT_KEY_SHADING_SHIFT = 57,
SORT_KEY_SHADING_MASK = 7,
SORT_KEY_MATERIAL_INDEX_SHIFT = 40,
@@ -698,6 +769,8 @@ public:
_FORCE_INLINE_ void _add_geometry(RasterizerStorageGLES3::Geometry *p_geometry, InstanceBase *p_instance, RasterizerStorageGLES3::GeometryOwner *p_owner, int p_material, bool p_shadow);
+ _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);
@@ -711,6 +784,7 @@ public:
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);
@@ -718,9 +792,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 a3f1873eae..14fb36f3b0 100644
--- a/drivers/gles3/rasterizer_storage_gles3.cpp
+++ b/drivers/gles3/rasterizer_storage_gles3.cpp
@@ -782,7 +782,6 @@ void RasterizerStorageGLES3::texture_set_data(RID p_texture, const Ref<Image> &p
int bh = h;
glCompressedTexImage2D(blit_target, i, internal_format, bw, bh, 0, size, &read[ofs]);
- print_line("format: " + Image::get_format_name(texture->format) + " size: " + Vector2(bw, bh) + " block: " + itos(block));
} else {
glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
@@ -825,8 +824,7 @@ Ref<Image> RasterizerStorageGLES3::texture_get_data(RID p_texture, VS::CubeMapSi
ERR_FAIL_COND_V(!texture, Ref<Image>());
ERR_FAIL_COND_V(!texture->active, Ref<Image>());
- ERR_FAIL_COND_V(texture->data_size == 0, Ref<Image>());
- ERR_FAIL_COND_V(texture->render_target, Ref<Image>());
+ ERR_FAIL_COND_V(texture->data_size == 0 && !texture->render_target, Ref<Image>());
if (!texture->images[p_cube_side].is_null()) {
return texture->images[p_cube_side];
@@ -1074,6 +1072,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);
@@ -1254,6 +1260,10 @@ void RasterizerStorageGLES3::sky_set_texture(RID p_sky, RID p_panorama, int p_ra
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) {
@@ -1269,87 +1279,200 @@ void RasterizerStorageGLES3::sky_set_texture(RID p_sky, RID p_panorama, int p_ra
glActiveTexture(GL_TEXTURE1);
glGenTextures(1, &sky->radiance);
- glBindTexture(GL_TEXTURE_2D, 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.set_conditional(CubemapFilterShaderGLES3::USE_PANORAMA, 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, sky->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;
+
+ while (mm_level) {
+
+ glTexImage2D(GL_TEXTURE_2D, lod, internal_format, size, size * 2, 0, format, type, NULL);
+ lod++;
+ mm_level--;
+
+ if (size > 1)
+ size >>= 1;
+ }
+
+ glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_BASE_LEVEL, 0);
+ glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAX_LEVEL, lod - 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);
- shaders.cubemap_filter.set_conditional(CubemapFilterShaderGLES3::USE_PANORAMA, 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 */
@@ -1427,6 +1550,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();
@@ -1438,6 +1562,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);
@@ -1448,6 +1574,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;
@@ -1463,6 +1593,7 @@ void RasterizerStorageGLES3::_update_shader(Shader *p_shader) const {
p_shader->spatial.unshaded = false;
p_shader->spatial.ontop = false;
p_shader->spatial.uses_sss = false;
+ p_shader->spatial.uses_screen_texture = false;
p_shader->spatial.uses_vertex = false;
p_shader->spatial.writes_modelview_or_projection = false;
@@ -1488,6 +1619,7 @@ void RasterizerStorageGLES3::_update_shader(Shader *p_shader) const {
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;
@@ -1547,7 +1679,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()) {
@@ -1734,6 +1870,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);
@@ -1742,7 +1886,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) {
@@ -1752,7 +1900,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) {
@@ -1961,8 +2115,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) {
@@ -2244,6 +2398,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
{
@@ -2309,6 +2467,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]];
@@ -2658,6 +2819,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) {
@@ -2727,6 +2889,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
}
{
@@ -2739,6 +3007,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);
@@ -2770,6 +3040,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) {
@@ -2991,6 +3263,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++) {
@@ -2998,6 +3271,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);
@@ -3830,7 +4111,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);
@@ -4149,7 +4430,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;
@@ -4186,8 +4466,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();
@@ -4497,7 +4776,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;
@@ -4930,6 +5209,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);
@@ -5061,6 +5348,14 @@ void RasterizerStorageGLES3::particles_set_draw_pass_mesh(RID p_particles, int p
particles->draw_passes[p_pass] = p_mesh;
}
+void RasterizerStorageGLES3::particles_restart(RID p_particles) {
+
+ Particles *particles = particles_owner.getornull(p_particles);
+ ERR_FAIL_COND(!particles);
+
+ particles->restart_request = true;
+}
+
void RasterizerStorageGLES3::particles_request_process(RID p_particles) {
Particles *particles = particles_owner.getornull(p_particles);
@@ -5090,7 +5385,7 @@ Rect3 RasterizerStorageGLES3::particles_get_current_aabb(RID p_particles) {
pos = inv.xform(pos);
}
if (i == 0)
- aabb.pos = pos;
+ aabb.position = pos;
else
aabb.expand_to(pos);
}
@@ -5127,13 +5422,35 @@ void RasterizerStorageGLES3::particles_set_emission_transform(RID p_particles, c
particles->emission_transform = p_transform;
}
+int RasterizerStorageGLES3::particles_get_draw_passes(RID p_particles) const {
+
+ const Particles *particles = particles_owner.getornull(p_particles);
+ 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 *particles, float p_delta) {
float new_phase = Math::fmod((float)particles->phase + (p_delta / particles->lifetime) * particles->speed_scale, (float)1.0);
if (particles->clear) {
particles->cycle_number = 0;
+ particles->random_seed = Math::rand();
} else if (new_phase < particles->phase) {
+ if (particles->one_shot) {
+ particles->emitting = false;
+ shaders.particles.set_uniform(ParticlesShaderGLES3::EMITTING, false);
+ }
particles->cycle_number++;
}
@@ -5143,6 +5460,8 @@ void RasterizerStorageGLES3::_particles_process(Particles *particles, float p_de
shaders.particles.set_uniform(ParticlesShaderGLES3::DELTA, p_delta * particles->speed_scale);
shaders.particles.set_uniform(ParticlesShaderGLES3::CLEAR, particles->clear);
+ glUniform1ui(shaders.particles.get_uniform_location(ParticlesShaderGLES3::RANDOM_SEED), particles->random_seed);
+
if (particles->use_local_coords)
shaders.particles.set_uniform(ParticlesShaderGLES3::EMISSION_TRANSFORM, Transform());
else
@@ -5198,6 +5517,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) {
@@ -5258,7 +5615,7 @@ void RasterizerStorageGLES3::update_particles() {
shaders.particles.bind();
shaders.particles.set_uniform(ParticlesShaderGLES3::TOTAL_PARTICLES, particles->amount);
- shaders.particles.set_uniform(ParticlesShaderGLES3::TIME, Color(frame.time[0], frame.time[1], frame.time[2], frame.time[3]));
+ shaders.particles.set_uniform(ParticlesShaderGLES3::TIME, frame.time[0]);
shaders.particles.set_uniform(ParticlesShaderGLES3::EXPLOSIVENESS, particles->explosiveness);
shaders.particles.set_uniform(ParticlesShaderGLES3::LIFETIME, particles->lifetime);
shaders.particles.set_uniform(ParticlesShaderGLES3::ATTRACTOR_COUNT, 0);
@@ -5321,13 +5678,11 @@ void RasterizerStorageGLES3::update_particles() {
particles->particle_valid_histories[0] = true;
}
+
+ particles->instance_change_notify(); //make sure shadows are updated
}
glDisable(GL_RASTERIZER_DISCARD);
-
- for (int i = 0; i < 6; i++) {
- glDisableVertexAttribArray(i);
- }
}
////////
@@ -5452,7 +5807,7 @@ void RasterizerStorageGLES3::_render_target_clear(RenderTarget *rt) {
glDeleteRenderbuffers(1, &rt->buffers.diffuse);
glDeleteRenderbuffers(1, &rt->buffers.specular);
glDeleteRenderbuffers(1, &rt->buffers.normal_rough);
- glDeleteRenderbuffers(1, &rt->buffers.motion_sss);
+ glDeleteRenderbuffers(1, &rt->buffers.sss);
glDeleteFramebuffers(1, &rt->buffers.effect_fbo);
glDeleteTextures(1, &rt->buffers.effect);
@@ -5491,6 +5846,7 @@ 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++) {
@@ -5587,13 +5943,14 @@ 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]) {
static const int msaa_value[] = { 0, 2, 4, 8, 16 };
int msaa = msaa_value[rt->msaa];
@@ -5621,75 +5978,155 @@ 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);
+ 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);
+ if (status != GL_FRAMEBUFFER_COMPLETE) {
+ printf("err status: %x\n", status);
+ _render_target_clear(rt);
+ ERR_FAIL_COND(status != GL_FRAMEBUFFER_COMPLETE);
+ }
- if (status != GL_FRAMEBUFFER_COMPLETE) {
- _render_target_clear(rt);
- ERR_FAIL_COND(status != GL_FRAMEBUFFER_COMPLETE);
+ glBindFramebuffer(GL_FRAMEBUFFER, RasterizerStorageGLES3::system_fbo);
+
+ if (status != GL_FRAMEBUFFER_COMPLETE) {
+ _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);
+ }
}
+ }
+
+ if (!rt->flags[RENDER_TARGET_NO_SAMPLING]) {
for (int i = 0; i < 2; i++) {
@@ -5736,7 +6173,7 @@ void RasterizerStorageGLES3::_render_target_allocate(RenderTarget *rt) {
glBindFramebuffer(GL_FRAMEBUFFER, mm.fbo);
glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, rt->effects.mip_maps[i].color, j);
- 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);
@@ -5756,79 +6193,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);
- }
}
}
@@ -5853,9 +6217,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);
@@ -5892,8 +6257,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);
@@ -5902,10 +6269,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) {
@@ -5974,6 +6351,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);
}
@@ -6045,7 +6423,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);
@@ -6058,7 +6436,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);
@@ -6068,6 +6446,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);
}
}
@@ -6296,6 +6680,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);
@@ -6333,10 +6719,98 @@ bool RasterizerStorageGLES3::has_os_feature(const String &p_feature) const {
////////////////////////////////////////////
-void RasterizerStorageGLES3::initialize() {
+void RasterizerStorageGLES3::set_debug_generate_wireframes(bool p_generate) {
+
+ 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: {
- config.render_arch = RENDER_ARCH_DESKTOP;
- //config.fbo_deferred=int(Globals::get_singleton()->get("rendering/gles3/lighting_technique"));
+ 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;
@@ -6517,6 +6991,8 @@ void RasterizerStorageGLES3::initialize() {
frame.delta = 0;
frame.current_rt = NULL;
config.keep_original_textures = false;
+ config.generate_wireframes = false;
+ config.use_texture_array_environment = GLOBAL_DEF("rendering/quality/texture_array_environments", true);
}
void RasterizerStorageGLES3::finalize() {
diff --git a/drivers/gles3/rasterizer_storage_gles3.h b/drivers/gles3/rasterizer_storage_gles3.h
index 7e107cfdf4..183db534ac 100644
--- a/drivers/gles3/rasterizer_storage_gles3.h
+++ b/drivers/gles3/rasterizer_storage_gles3.h
@@ -35,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;
@@ -61,8 +61,6 @@ public:
struct Config {
- RenderArchitecture render_arch;
-
bool shrink_textures_x2;
bool use_fast_texture_filter;
bool use_anisotropic_filter;
@@ -86,6 +84,10 @@ 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;
@@ -126,12 +128,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;
+
+ Info() {
- 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;
+ texture_mem = 0;
+ vertex_mem = 0;
+ render.reset();
+ render_final.reset();
+ }
} info;
@@ -249,6 +272,9 @@ public:
VisualServer::TextureDetectCallback detect_srgb;
void *detect_srgb_ud;
+ VisualServer::TextureDetectCallback detect_normal;
+ void *detect_normal_ud;
+
Texture() {
using_srgb = false;
@@ -268,6 +294,8 @@ public:
detect_3d_ud = NULL;
detect_srgb = NULL;
detect_srgb_ud = NULL;
+ detect_normal = NULL;
+ detect_normal_ud = NULL;
}
~Texture() {
@@ -308,6 +336,7 @@ 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);
/* SKY API */
@@ -374,6 +403,8 @@ public:
};
int light_mode;
+ bool uses_screen_texture;
+ bool uses_screen_uv;
} canvas_item;
@@ -411,6 +442,7 @@ public:
bool uses_vertex;
bool uses_discard;
bool uses_sss;
+ bool uses_screen_texture;
bool writes_modelview_or_projection;
} spatial;
@@ -426,6 +458,7 @@ public:
: dirty_list(this) {
shader = NULL;
+ ubo_size = 0;
valid = false;
custom_code_id = 0;
version = 1;
@@ -463,6 +496,8 @@ public:
Vector<RID> textures;
float line_width;
+ RID next_pass;
+
uint32_t index;
uint64_t last_pass;
@@ -500,6 +535,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);
@@ -538,6 +574,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;
@@ -568,6 +609,8 @@ public:
mesh->update_multimeshes();
}
+ int total_data_size;
+
Surface() {
array_byte_size = 0;
@@ -582,6 +625,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() {
@@ -990,12 +1040,16 @@ public:
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;
bool use_local_coords;
RID process_material;
@@ -1017,6 +1071,7 @@ public:
float phase;
float prev_phase;
uint64_t prev_ticks;
+ uint32_t random_seed;
uint32_t cycle_number;
@@ -1034,6 +1089,7 @@ public:
: particle_element(this) {
cycle_number = 0;
emitting = false;
+ one_shot = false;
amount = 0;
lifetime = 1.0;
pre_process_time = 0.0;
@@ -1045,6 +1101,9 @@ public:
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));
@@ -1055,6 +1114,8 @@ public:
prev_ticks = 0;
clear = true;
+ inactive = true;
+ inactive_time = false;
glGenBuffers(2, particle_buffers);
glGenVertexArrays(2, particle_vaos);
@@ -1082,6 +1143,7 @@ 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);
@@ -1091,6 +1153,7 @@ public:
virtual void particles_set_process_material(RID p_particles, RID p_material);
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);
@@ -1106,6 +1169,9 @@ public:
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 */
virtual void instance_add_skeleton(RID p_skeleton, RasterizerScene::InstanceBase *p_instance);
@@ -1128,7 +1194,7 @@ public:
GLuint specular;
GLuint diffuse;
GLuint normal_rough;
- GLuint motion_sss;
+ GLuint sss;
GLuint effect_fbo;
GLuint effect;
@@ -1208,9 +1274,10 @@ public:
flags[RENDER_TARGET_VFLIP] = false;
flags[RENDER_TARGET_TRANSPARENT] = false;
+ flags[RENDER_TARGET_NO_3D_EFFECTS] = false;
flags[RENDER_TARGET_NO_3D] = false;
- flags[RENDER_TARGET_HDR] = true;
flags[RENDER_TARGET_NO_SAMPLING] = false;
+ flags[RENDER_TARGET_HDR] = true;
last_exposure_tick = 0;
}
@@ -1226,7 +1293,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 */
@@ -1248,6 +1316,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;
@@ -1274,6 +1343,7 @@ public:
float delta;
uint64_t prev_tick;
uint64_t count;
+
} frame;
void initialize();
@@ -1283,6 +1353,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 147357bcd0..206f270f68 100644
--- a/drivers/gles3/shader_compiler_gles3.cpp
+++ b/drivers/gles3/shader_compiler_gles3.cpp
@@ -304,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()) {
@@ -323,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);
@@ -574,6 +576,7 @@ String ShaderCompilerGLES3::_dump_node_code(SL::Node *p_node, int p_level, Gener
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) + ")";
@@ -593,6 +596,10 @@ 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) {
@@ -646,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;
}
@@ -663,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";
@@ -674,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";
@@ -688,11 +705,12 @@ 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 **/
@@ -740,6 +758,10 @@ ShaderCompilerGLES3::ShaderCompilerGLES3() {
//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].usage_defines["TANGENT"] = "#define ENABLE_TANGENT_INTERP\n";
actions[VS::SHADER_SPATIAL].usage_defines["BINORMAL"] = "@TANGENT";
@@ -757,11 +779,24 @@ ShaderCompilerGLES3::ShaderCompilerGLES3() {
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["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_default_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 */
@@ -779,6 +814,7 @@ ShaderCompilerGLES3::ShaderCompilerGLES3() {
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";
diff --git a/drivers/gles3/shader_gles3.cpp b/drivers/gles3/shader_gles3.cpp
index bebc006032..33a7c9a22f 100644
--- a/drivers/gles3/shader_gles3.cpp
+++ b/drivers/gles3/shader_gles3.cpp
@@ -100,14 +100,14 @@ void ShaderGLES3::bind_uniforms() {
};
uniforms_dirty = false;
-};
+}
GLint ShaderGLES3::get_uniform_location(int p_idx) const {
ERR_FAIL_COND_V(!version, -1);
return version->uniform_location[p_idx];
-};
+}
bool ShaderGLES3::bind() {
@@ -289,16 +289,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());
@@ -361,6 +362,8 @@ ShaderGLES3::Version *ShaderGLES3::get_current_version() {
ERR_FAIL_V(NULL);
}
+ //_display_error_with_code("pepo", strings);
+
/* FRAGMENT SHADER */
strings.resize(strings_base_size);
@@ -385,35 +388,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]));
@@ -615,21 +619,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) {
@@ -649,14 +653,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();
@@ -665,8 +669,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();
@@ -675,16 +679,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/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..1c950c82d9 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;
/*
@@ -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 c8985e6902..a7c388815d 100644
--- a/drivers/gles3/shaders/copy.glsl
+++ b/drivers/gles3/shaders/copy.glsl
@@ -17,15 +17,32 @@ out vec2 uv_interp;
out vec2 uv2_interp;
+#ifdef USE_COPY_SECTION
+
+uniform vec4 copy_section;
+
+#endif
+
void main() {
#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]
@@ -84,8 +101,24 @@ 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;
@@ -109,6 +142,11 @@ void main() {
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;
@@ -135,6 +173,21 @@ 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
diff --git a/drivers/gles3/shaders/cubemap_filter.glsl b/drivers/gles3/shaders/cubemap_filter.glsl
index 2aec6380f5..393ef2892a 100644
--- a/drivers/gles3/shaders/cubemap_filter.glsl
+++ b/drivers/gles3/shaders/cubemap_filter.glsl
@@ -19,9 +19,16 @@ void main() {
precision highp float;
precision highp int;
-#ifdef USE_PANORAMA
+#ifdef USE_SOURCE_PANORAMA
uniform sampler2D source_panorama; //texunit:0
-#else
+#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
@@ -169,7 +176,7 @@ vec2 Hammersley(uint i, uint N) {
uniform bool z_flip;
-#ifdef USE_PANORAMA
+#ifdef USE_SOURCE_PANORAMA
vec4 texturePanorama(vec3 normal,sampler2D pano ) {
@@ -189,6 +196,23 @@ vec4 texturePanorama(vec3 normal,sampler2D pano ) {
#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) {
+ 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
@@ -197,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;
}
@@ -212,13 +235,24 @@ void main() {
#ifdef USE_DIRECT_WRITE
-#ifdef USE_PANORAMA
+#ifdef USE_SOURCE_PANORAMA
frag_color=vec4(texturePanorama(N,source_panorama).rgb,1.0);
-#else
+#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)
+
frag_color=vec4(texture(N,source_cube).rgb,1.0);
#endif
+
+
+
#else
vec4 sum = vec4(0.0, 0.0, 0.0, 0.0);
@@ -233,9 +267,16 @@ void main() {
float ndotl = clamp(dot(N, L),0.0,1.0);
if (ndotl>0.0) {
-#ifdef USE_PANORAMA
+#ifdef USE_SOURCE_PANORAMA
sum.rgb += texturePanorama(H,source_panorama).rgb *ndotl;
-#else
+#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)
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..2550335174 100644
--- a/drivers/gles3/shaders/effect_blur.glsl
+++ b/drivers/gles3/shaders/effect_blur.glsl
@@ -6,11 +6,21 @@ 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]
@@ -89,7 +99,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 +262,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 +285,3 @@ void main() {
}
-
diff --git a/drivers/gles3/shaders/particles.glsl b/drivers/gles3/shaders/particles.glsl
index fa12dd7408..6a977a201e 100644
--- a/drivers/gles3/shaders/particles.glsl
+++ b/drivers/gles3/shaders/particles.glsl
@@ -28,7 +28,7 @@ uniform float prev_system_phase;
uniform int total_particles;
uniform float explosiveness;
uniform float randomness;
-uniform vec4 time;
+uniform float time;
uniform float delta;
uniform int attractor_count;
@@ -37,6 +37,7 @@ uniform bool clear;
uniform uint cycle;
uniform float lifetime;
uniform mat4 emission_transform;
+uniform uint random_seed;
out highp vec4 out_color; //tfb:
@@ -46,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)
@@ -58,6 +58,9 @@ MATERIAL_UNIFORMS
#endif
+
+VERTEX_SHADER_GLOBALS
+
uint hash(uint x) {
x = ((x >> uint(16)) ^ x) * uint(0x45d9f3b);
@@ -104,7 +107,9 @@ void main() {
bool shader_active = velocity_active.a > 0.5;
if (system_phase > prev_system_phase) {
- if (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;
@@ -112,12 +117,12 @@ void main() {
}
} else {
- if (prev_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 (system_phase >= restart_phase) {
+ } else if (restart_phase < system_phase ) {
restart=true;
#ifdef USE_FRACTIONAL_DELTA
local_delta = (system_phase - restart_phase) * lifetime;
@@ -132,6 +137,7 @@ void main() {
}
uint particle_number = current_cycle * uint(total_particles) + uint(gl_VertexID);
+ int index = int(gl_VertexID);
if (restart) {
shader_active=emitting;
@@ -229,7 +235,6 @@ VERTEX_SHADER_CODE
//any code here is never executed, stuff is filled just so it works
-FRAGMENT_SHADER_GLOBALS
#if defined(USE_MATERIAL)
@@ -241,9 +246,15 @@ MATERIAL_UNIFORMS
#endif
+FRAGMENT_SHADER_GLOBALS
+
void main() {
{
+LIGHT_SHADER_CODE
+ }
+
+ {
FRAGMENT_SHADER_CODE
}
}
diff --git a/drivers/gles3/shaders/resolve.glsl b/drivers/gles3/shaders/resolve.glsl
index 6acc712299..181a3c99ec 100644
--- a/drivers/gles3/shaders/resolve.glsl
+++ b/drivers/gles3/shaders/resolve.glsl
@@ -20,7 +20,7 @@ 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 81166e84ff..6fbfeeff6c 100644
--- a/drivers/gles3/shaders/scene.glsl
+++ b/drivers/gles3/shaders/scene.glsl
@@ -63,15 +63,18 @@ 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;
+
+ vec4 fog_color_enabled;
+ vec4 fog_sun_color_amount;
+
float ambient_energy;
float bg_energy;
- float shadow_z_offset;
- float shadow_z_slope_scale;
+ float z_offset;
+ float z_slope_scale;
float shadow_dual_paraboloid_render_zfar;
float shadow_dual_paraboloid_render_side;
@@ -79,10 +82,22 @@ layout(std140) uniform SceneData { //ubo:0
vec2 shadow_atlas_pixel_size;
vec2 directional_shadow_pixel_size;
+ 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;
+
};
uniform highp mat4 world_transform;
@@ -131,7 +146,7 @@ out vec3 binormal_interp;
#endif
-VERTEX_SHADER_GLOBALS
+
#if defined(USE_MATERIAL)
@@ -144,6 +159,8 @@ MATERIAL_UNIFORMS
#endif
+VERTEX_SHADER_GLOBALS
+
#ifdef RENDER_DEPTH_DUAL_PARABOLOID
out highp float dp_clip;
@@ -153,7 +170,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;
@@ -230,7 +247,7 @@ 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
@@ -258,6 +275,19 @@ void main() {
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_TANGENT_INTERP) || defined(ENABLE_NORMALMAP) || defined(LIGHT_USE_ANISOTROPY)
+
+ tangent = normalize((world_matrix * vec4(tangent,0.0)).xyz);
+ binormal = normalize((world_matrix * vec4(binormal,0.0)).xyz);
+#endif
+#endif
+
//defines that make writing custom shaders easier
#define projection_matrix local_projection
#define world_transform world_matrix
@@ -269,29 +299,42 @@ VERTEX_SHADER_CODE
-
-#if !defined(SKIP_TRANSFORM_USED)
+//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_interp = vertex.xyz;
- normal_interp = normal;
+ 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)
-#if !defined(SKIP_TRANSFORM_USED)
+ tangent = normalize((camera_inverse_matrix * vec4(tangent,0.0)).xyz);
+ binormal = normalize((camera_inverse_matrix * vec4(binormal,0.0)).xyz);
+#endif
+#endif
- tangent = normalize((modelview * vec4(tangent,0.0)).xyz);
- binormal = normalize((modelview * vec4(binormal,0.0)).xyz);
+ vertex_interp = vertex.xyz;
+ normal_interp = normal;
-#endif
+
+#if defined(ENABLE_TANGENT_INTERP) || defined(ENABLE_NORMALMAP) || defined(LIGHT_USE_ANISOTROPY)
tangent_interp = tangent;
binormal_interp = binormal;
#endif
+
#ifdef RENDER_DEPTH
@@ -304,7 +347,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;
@@ -317,8 +360,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
@@ -338,7 +381,22 @@ VERTEX_SHADER_CODE
[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
@@ -370,11 +428,9 @@ 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
@@ -384,12 +440,57 @@ layout(std140) uniform Radiance { //ubo:2
};
+#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) {
+ 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) {
+ 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)
@@ -402,23 +503,25 @@ 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;
+ vec4 fog_color_enabled;
+ vec4 fog_sun_color_amount;
float ambient_energy;
float bg_energy;
- float shadow_z_offset;
- float shadow_z_slope_scale;
+ float z_offset;
+ float z_slope_scale;
float shadow_dual_paraboloid_render_zfar;
float shadow_dual_paraboloid_render_side;
@@ -426,10 +529,21 @@ layout(std140) uniform SceneData {
vec2 shadow_atlas_pixel_size;
vec2 directional_shadow_pixel_size;
+ 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;
};
//directional light data
@@ -482,7 +596,7 @@ layout(std140) uniform SpotLightData { //ubo:5
};
-uniform highp sampler2DShadow shadow_atlas; //texunit:-3
+uniform highp sampler2DShadow shadow_atlas; //texunit:-5
struct ReflectionData {
@@ -500,7 +614,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
@@ -517,14 +631,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
@@ -534,7 +653,7 @@ 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
float contact_shadow_compute(vec3 pos, vec3 dir, float max_distance) {
@@ -623,18 +742,104 @@ 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, 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);
@@ -642,7 +847,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);
@@ -674,6 +878,7 @@ 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_blob_intensity;
+#endif
#if defined(LIGHT_USE_CLEARCOAT)
float Dr = GTR1(dotNH, mix(.1,.001,clearcoat_gloss));
@@ -685,6 +890,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)
}
@@ -763,7 +969,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, 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 );
@@ -814,21 +1020,21 @@ void light_process_omni(int idx, vec3 vertex, vec3 eye_vec,vec3 normal,vec3 bino
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,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, 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
@@ -847,7 +1053,7 @@ void light_process_spot(int idx, vec3 vertex, vec3 eye_vec, vec3 normal, vec3 bi
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,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);
}
@@ -968,7 +1174,7 @@ 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;
@@ -1132,23 +1338,7 @@ void gi_probes_compute(vec3 pos, vec3 normal, float roughness, inout vec3 out_sp
#endif
-vec3 textureDualParabolod(sampler2D p_tex, vec3 p_vec,float p_lod) {
-
- vec3 norm = normalize(p_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);
- return textureLod(p_tex, norm.xy, p_lod).xyz;
-}
void main() {
@@ -1213,13 +1403,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
@@ -1286,15 +1478,11 @@ FRAGMENT_SHADER_CODE
} else {
{
-
-#define RADIANCE_MAX_LOD 5.0
- float lod = roughness * RADIANCE_MAX_LOD;
-
{ //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 radiance = textureDualParabolod(radiance_map,ref_vec,lod) * bg_energy;
+ ref_vec=normalize((radiance_inverse_xform * vec4(ref_vec,0.0)).xyz);
+ vec3 radiance = textureDualParaboloid(radiance_map,ref_vec,roughness) * bg_energy;
specular_light = radiance;
}
@@ -1306,7 +1494,7 @@ FRAGMENT_SHADER_CODE
{
vec3 ambient_dir=normalize((radiance_inverse_xform * vec4(normal,0.0)).xyz);
- vec3 env_ambient=textureDualParabolod(radiance_map,ambient_dir,RADIANCE_MAX_LOD) * bg_energy;
+ 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);
@@ -1324,6 +1512,11 @@ FRAGMENT_SHADER_CODE
ambient_light*=ambient_energy;
+ float specular_blob_intensity=1.0;
+#if defined(SPECULAR_TOON)
+ specular_blob_intensity*=specular * 2.0;
+#endif
+
#ifdef USE_LIGHT_DIRECTIONAL
vec3 light_attenuation=vec3(1.0);
@@ -1445,7 +1638,7 @@ 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
@@ -1463,7 +1656,7 @@ 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,light_params.z,roughness,rim,rim_tint,clearcoat,clearcoat_gloss,anisotropy,diffuse_light,specular_light);
+ 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 //#USE_LIGHT_DIRECTIONAL
@@ -1479,8 +1672,6 @@ FRAGMENT_SHADER_CODE
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,reflection_accum,ambient_accum);
}
@@ -1493,11 +1684,11 @@ FRAGMENT_SHADER_CODE
}
for(int i=0;i<omni_light_count;i++) {
- light_process_omni(omni_light_indices[i],vertex,eye_vec,normal,binormal,tangent,albedo,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,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);
}
@@ -1507,14 +1698,7 @@ FRAGMENT_SHADER_CODE
-#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 :)
@@ -1536,11 +1720,15 @@ LIGHT_SHADER_CODE
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 dielectric = vec3(0.034) * 0.5 * 2.0;
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);
@@ -1549,6 +1737,51 @@ LIGHT_SHADER_CODE
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;
+
+
+
+#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,-vertex.z);
+
+ 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
@@ -1566,16 +1799,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 8eec71ecb6..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;
@@ -148,8 +149,6 @@ 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.0;
for(int i=0;i<num_steps;i++) {
@@ -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)/float(num_steps);
- } else {
-#endif
- grad=steps_taken/float(num_steps);
- final_pos=pos;
-#ifdef SMOOTH_ACCEL
- }
-#endif
@@ -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..3ce2edf4e9 100644
--- a/drivers/gles3/shaders/tonemap.glsl
+++ b/drivers/gles3/shaders/tonemap.glsl
@@ -6,12 +6,13 @@ 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
}
@@ -39,6 +40,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
@@ -255,6 +269,20 @@ void main() {
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)));
+#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 25ab767bed..33d271248c 100644
--- a/drivers/png/image_loader_png.cpp
+++ b/drivers/png/image_loader_png.cpp
@@ -256,6 +256,7 @@ static Ref<Image> _load_mem_png(const uint8_t *p_png, int p_size) {
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] != ' ', Ref<Image>());
return _load_mem_png(&r[4], len - 4);
diff --git a/drivers/png/resource_saver_png.cpp b/drivers/png/resource_saver_png.cpp
index 1700603489..0d7e1d9d72 100644
--- a/drivers/png/resource_saver_png.cpp
+++ b/drivers/png/resource_saver_png.cpp
@@ -55,41 +55,6 @@ Error ResourceSaverPNG::save(const String &p_path, const RES &p_resource, uint32
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;
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/editor/SCsub b/editor/SCsub
index d7392f8249..f0d378c097 100644
--- a/editor/SCsub
+++ b/editor/SCsub
@@ -141,6 +141,208 @@ 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
+
+ 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 +354,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 +367,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 +380,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 a5de4fee88..1798e66e8a 100644
--- a/editor/animation_editor.cpp
+++ b/editor/animation_editor.cpp
@@ -76,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");
@@ -111,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;
}
@@ -138,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;
}
}
@@ -1900,13 +1900,13 @@ void AnimationKeyEditor::_track_editor_gui_input(const Ref<InputEvent> &p_input)
if (mb->get_button_index() == BUTTON_RIGHT && mb->is_pressed()) {
- Point2 mpos = mb->get_pos() - ofs;
+ Point2 mpos = mb->get_position() - ofs;
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_pos() - ofs;
+ Point2 mpos = mb->get_position() - ofs;
if (mpos.y < h) {
return;
@@ -1951,7 +1951,7 @@ void AnimationKeyEditor::_track_editor_gui_input(const Ref<InputEvent> &p_input)
if (key == -1) {
click.click = ClickOver::CLICK_SELECT_KEYS;
- click.at = mb->get_pos();
+ click.at = mb->get_position();
click.to = click.at;
click.shift = mb->get_shift();
selected_track = idx;
@@ -1974,7 +1974,7 @@ void AnimationKeyEditor::_track_editor_gui_input(const Ref<InputEvent> &p_input)
selection.insert(sk, ki);
click.click = ClickOver::CLICK_MOVE_KEYS;
- click.at = mb->get_pos();
+ click.at = mb->get_position();
click.to = click.at;
update();
selected_track = idx;
@@ -2009,14 +2009,14 @@ void AnimationKeyEditor::_track_editor_gui_input(const Ref<InputEvent> &p_input)
if (mb->is_pressed()) {
- Point2 mpos = mb->get_pos() - ofs;
+ Point2 mpos = mb->get_position() - ofs;
if (mpos.y < h) {
if (mpos.x < name_limit && mpos.x > (name_limit - hsep - hsize_icon->get_width())) {
click.click = ClickOver::CLICK_RESIZE_NAMES;
- click.at = mb->get_pos();
+ click.at = mb->get_position();
click.to = click.at;
click.at.y = name_limit;
}
@@ -2035,7 +2035,7 @@ void AnimationKeyEditor::_track_editor_gui_input(const Ref<InputEvent> &p_input)
pos = animation->get_length();
timeline_pos = pos;
click.click = ClickOver::CLICK_DRAG_TIMELINE;
- click.at = mb->get_pos();
+ click.at = mb->get_position();
click.to = click.at;
emit_signal("timeline_changed", pos, false);
}
@@ -2055,7 +2055,7 @@ void AnimationKeyEditor::_track_editor_gui_input(const Ref<InputEvent> &p_input)
if (mpos.x >= name_limit && mpos.x < settings_limit) {
click.click = ClickOver::CLICK_SELECT_KEYS;
- click.at = mb->get_pos();
+ click.at = mb->get_position();
click.to = click.at;
//drag select region
}
@@ -2076,7 +2076,7 @@ void AnimationKeyEditor::_track_editor_gui_input(const Ref<InputEvent> &p_input)
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.pos);
+ track_name->set_position(te->get_global_position() + area.position);
track_name->set_size(area.size);
track_name->show_modal();
track_name->grab_focus();
@@ -2115,7 +2115,7 @@ void AnimationKeyEditor::_track_editor_gui_input(const Ref<InputEvent> &p_input)
if (key == -1) {
click.click = ClickOver::CLICK_SELECT_KEYS;
- click.at = mb->get_pos();
+ click.at = mb->get_position();
click.to = click.at;
click.shift = mb->get_shift();
selected_track = idx;
@@ -2138,7 +2138,7 @@ void AnimationKeyEditor::_track_editor_gui_input(const Ref<InputEvent> &p_input)
selection.insert(sk, ki);
click.click = ClickOver::CLICK_MOVE_KEYS;
- click.at = mb->get_pos();
+ click.at = mb->get_position();
click.to = click.at;
update();
selected_track = idx;
@@ -2601,7 +2601,7 @@ void AnimationKeyEditor::_track_editor_gui_input(const Ref<InputEvent> &p_input)
float clickp = click.at.x - ofs.x;
float dif = base - clickp;
- float target = mm->get_pos().x + dif - ofs.x;
+ float target = mm->get_position().x + dif - ofs.x;
float ratio = target / settings_limit;
@@ -2615,7 +2615,7 @@ void AnimationKeyEditor::_track_editor_gui_input(const Ref<InputEvent> &p_input)
} break;
case ClickOver::CLICK_DRAG_TIMELINE: {
- Point2 mpos = mm->get_pos() - ofs;
+ Point2 mpos = mm->get_position() - ofs;
/*
if (mpos.x<name_limit)
mpos.x=name_limit;
@@ -2646,7 +2646,7 @@ void AnimationKeyEditor::_track_editor_gui_input(const Ref<InputEvent> &p_input)
} break;
case ClickOver::CLICK_SELECT_KEYS: {
- click.to = mm->get_pos();
+ click.to = mm->get_position();
if (click.to.y < h && click.at.y > h && mm->get_relative().y < 0) {
float prev = v_scroll->get_value();
@@ -2665,7 +2665,7 @@ void AnimationKeyEditor::_track_editor_gui_input(const Ref<InputEvent> &p_input)
} break;
case ClickOver::CLICK_MOVE_KEYS: {
- click.to = mm->get_pos();
+ click.to = mm->get_position();
} break;
default: {}
}
@@ -2680,7 +2680,7 @@ void AnimationKeyEditor::_track_editor_gui_input(const Ref<InputEvent> &p_input)
if (mm->get_button_mask() == 0) {
- Point2 mpos = mm->get_pos() - ofs;
+ Point2 mpos = mm->get_position() - ofs;
if (mpos.y < h) {
#if 0
diff --git a/editor/editor_asset_installer.cpp b/editor/editor_asset_installer.cpp
index e3ed9fe1af..96bfb295ea 100644
--- a/editor/editor_asset_installer.cpp
+++ b/editor/editor_asset_installer.cpp
@@ -113,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");
}
diff --git a/editor/editor_audio_buses.cpp b/editor/editor_audio_buses.cpp
index 26029261b2..e3e5793ec8 100644
--- a/editor/editor_audio_buses.cpp
+++ b/editor/editor_audio_buses.cpp
@@ -342,7 +342,7 @@ void EditorAudioBus::_effect_edited() {
if (effect->get_metadata(0) == Variant()) {
Rect2 area = effects->get_item_rect(effect);
- effect_options->set_position(effects->get_global_position() + 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 {
@@ -396,7 +396,7 @@ void EditorAudioBus::_gui_input(const Ref<InputEvent> &p_event) {
Ref<InputEventMouseButton> mb = p_event;
if (mb.is_valid() && mb->get_button_index() == 2 && mb->is_pressed()) {
- Vector2 pos = Vector2(mb->get_pos().x, mb->get_pos().y);
+ Vector2 pos = Vector2(mb->get_position().x, mb->get_position().y);
delete_popup->set_position(get_global_position() + pos);
delete_popup->popup();
}
@@ -632,21 +632,24 @@ EditorAudioBus::EditorAudioBus(EditorAudioBuses *p_buses) {
solo = memnew(ToolButton);
solo->set_text("S");
solo->set_toggle_mode(true);
- solo->set_modulate(Color(0.8, 1.2, 0.8));
+ solo->add_color_override("font_color_pressed", Color(0.2, 0.9, 0.2));
+ solo->add_color_override("font_color_hover", Color(0.6, 0.9, 0.6));
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->add_color_override("font_color_pressed", Color(0.9, 0.2, 0.2));
+ mute->add_color_override("font_color_hover", Color(0.9, 0.6, 0.6));
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->add_color_override("font_color_pressed", Color(0.9, 0.9, 0.2));
+ bypass->add_color_override("font_color_hover", Color(0.9, 0.9, 0.6));
bypass->set_focus_mode(FOCUS_NONE);
bypass->connect("pressed", this, "_bypass_toggled");
hbc->add_child(bypass);
diff --git a/editor/editor_data.cpp b/editor/editor_data.cpp
index 31c1402c8f..58ffa223fb 100644
--- a/editor/editor_data.cpp
+++ b/editor/editor_data.cpp
@@ -675,7 +675,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 {
diff --git a/editor/editor_export.cpp b/editor/editor_export.cpp
index cb1b958cca..5cd00738a2 100644
--- a/editor/editor_export.cpp
+++ b/editor/editor_export.cpp
@@ -211,6 +211,7 @@ EditorExportPreset::EditorExportPreset() {
void EditorExportPlatform::gen_debug_flags(Vector<String> &r_flags, int p_flags) {
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";
@@ -230,7 +231,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);
@@ -621,6 +622,7 @@ 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/remote_host");
+ int remote_port = (int)EditorSettings::get_singleton()->get("network/debug/remote_port");
if (p_flags & DEBUG_FLAG_REMOTE_DEBUG_LOCALHOST)
host = "localhost";
@@ -640,7 +642,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);
@@ -1941,14 +1943,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)
@@ -2109,6 +2111,7 @@ 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/remote_host");
+ int remote_port = (int)EditorSettings::get_singleton()->get("network/debug/remote_port");
if (p_flags&EXPORT_REMOTE_DEBUG_LOCALHOST)
host="localhost";
@@ -2128,7 +2131,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);
diff --git a/editor/editor_export.h b/editor/editor_export.h
index 740f05174b..64381fbb35 100644
--- a/editor/editor_export.h
+++ b/editor/editor_export.h
@@ -197,6 +197,7 @@ 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;
diff --git a/editor/editor_file_dialog.cpp b/editor/editor_file_dialog.cpp
index 25fade46d6..c2a408e8ab 100644
--- a/editor/editor_file_dialog.cpp
+++ b/editor/editor_file_dialog.cpp
@@ -1300,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);
diff --git a/editor/editor_file_system.cpp b/editor/editor_file_system.cpp
index 64a9d5df82..f314f772d1 100644
--- a/editor/editor_file_system.cpp
+++ b/editor/editor_file_system.cpp
@@ -153,6 +153,7 @@ EditorFileSystemDirectory::EditorFileSystemDirectory() {
modified_time = 0;
parent = NULL;
+ verified = false;
}
EditorFileSystemDirectory::~EditorFileSystemDirectory() {
@@ -1040,7 +1041,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++) {
@@ -1421,6 +1425,7 @@ EditorFileSystem::EditorFileSystem() {
singleton = this;
filesystem = memnew(EditorFileSystemDirectory); //like, empty
+ filesystem->parent = NULL;
thread = NULL;
scanning = false;
@@ -1429,7 +1434,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 b5d61d47d3..3522a1ab1d 100644
--- a/editor/editor_file_system.h
+++ b/editor/editor_file_system.h
@@ -168,8 +168,6 @@ class EditorFileSystem : public Node {
void _scan_fs_changes(EditorFileSystemDirectory *p_dir, const ScanProgress &p_progress);
- int md_count;
-
Set<String> valid_extensions;
Set<String> import_extensions;
diff --git a/editor/editor_fonts.cpp b/editor/editor_fonts.cpp
index dc4c2b21bc..4a85b4e2ef 100644
--- a/editor/editor_fonts.cpp
+++ b/editor/editor_fonts.cpp
@@ -29,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"
@@ -49,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_help.cpp b/editor/editor_help.cpp
index 8fb307a77d..5089468e1d 100644
--- a/editor/editor_help.cpp
+++ b/editor/editor_help.cpp
@@ -29,7 +29,7 @@
/*************************************************************************/
#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"
@@ -252,8 +252,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();
}
@@ -288,7 +288,6 @@ void EditorHelpSearch::_bind_methods() {
EditorHelpSearch::EditorHelpSearch() {
- editor = EditorNode::get_singleton();
VBoxContainer *vbc = memnew(VBoxContainer);
add_child(vbc);
@@ -362,8 +361,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));
@@ -371,12 +370,10 @@ void EditorHelpIndex::_tree_item_selected() {
void EditorHelpIndex::select_class(const String &p_class) {
- EditorNode *editor = EditorNode::get_singleton();
if (!tree_item_map.has(p_class))
return;
tree_item_map[p_class]->select(0);
class_list->ensure_cursor_is_visible();
- editor->call("_editor_select", EditorNode::EDITOR_SCRIPT); // in case EditorHelpIndex beeen invoked on top of other editor window
}
void EditorHelpIndex::popup() {
@@ -1281,7 +1278,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
}
@@ -1691,8 +1688,6 @@ void EditorHelp::_bind_methods() {
EditorHelp::EditorHelp() {
- editor = EditorNode::get_singleton();
-
VBoxContainer *vbc = this;
EDITOR_DEF("text_editor/help/sort_functions_alphabetically", true);
diff --git a/editor/editor_help.h b/editor/editor_help.h
index d6fc0e3bf2..46d83490f4 100644
--- a/editor/editor_help.h
+++ b/editor/editor_help.h
@@ -49,7 +49,6 @@ class EditorHelpSearch : public ConfirmationDialog {
GDCLASS(EditorHelpSearch, ConfirmationDialog)
- EditorNode *editor;
LineEdit *search_box;
Tree *search_options;
String base_type;
@@ -119,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;
diff --git a/editor/editor_initialize_ssl.cpp b/editor/editor_initialize_ssl.cpp
index 23a033f6fb..290ade277e 100644
--- a/editor/editor_initialize_ssl.cpp
+++ b/editor/editor_initialize_ssl.cpp
@@ -29,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_name_dialog.cpp b/editor/editor_name_dialog.cpp
index d4c418bfc9..7435e9a9f7 100644
--- a/editor/editor_name_dialog.cpp
+++ b/editor/editor_name_dialog.cpp
@@ -85,7 +85,6 @@ EditorNameDialog::EditorNameDialog() {
add_child(makevb);
name = memnew(LineEdit);
makevb->add_child(name);
- makevb->move_child(name, get_label()->get_index() + 1);
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);
diff --git a/editor/editor_node.cpp b/editor/editor_node.cpp
index c1f422cce3..2f50842a52 100644
--- a/editor/editor_node.cpp
+++ b/editor/editor_node.cpp
@@ -30,6 +30,7 @@
#include "editor_node.h"
#include "animation_editor.h"
+#include "authors.gen.h"
#include "bind/core_bind.h"
#include "class_db.h"
#include "core/io/resource_loader.h"
@@ -42,6 +43,7 @@
#include "io/config_file.h"
#include "io/stream_peer_ssl.h"
#include "io/zip_io.h"
+#include "license.gen.h"
#include "main/input_default.h"
#include "message_queue.h"
#include "os/file_access.h"
@@ -72,11 +74,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_texture_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"
@@ -271,6 +272,8 @@ void EditorNode::_notification(int p_what) {
}
editor_selection->update();
+ scene_root->set_size_override(true, Size2(GlobalConfig::get_singleton()->get("display/window/width"), GlobalConfig::get_singleton()->get("display/window/height")));
+
ResourceImporterTexture::get_singleton()->update_imports();
}
if (p_what == NOTIFICATION_ENTER_TREE) {
@@ -339,6 +342,14 @@ void EditorNode::_notification(int p_what) {
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("Content", "EditorStyles"));
+ 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();
}
}
@@ -406,6 +417,8 @@ void EditorNode::_fs_changed() {
}
}
}
+
+ _mark_unsaved_scenes();
}
void EditorNode::_sources_changed(bool p_exist) {
@@ -822,56 +835,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 = GlobalConfig::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) {
@@ -953,6 +964,46 @@ void EditorNode::_save_scene(String p_file, int idx) {
}
}
+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
import_confirmation->hide();
@@ -1084,6 +1135,7 @@ void EditorNode::_dialog_action(String p_file) {
GlobalConfig::get_singleton()->set("application/main_scene", p_file);
GlobalConfig::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: {
@@ -1108,14 +1160,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_default_environment();
- _save_scene_with_preview(p_file);
+ 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;
@@ -1459,7 +1523,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);
@@ -1877,42 +1941,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();
+ 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) {
@@ -1948,7 +2015,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);
@@ -1959,30 +2026,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_default_environment();
+ _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: {
@@ -2089,22 +2146,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) {
@@ -2433,28 +2474,56 @@ 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;
- }
+ if (_next_unsaved_scene() == -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);
+ bool save_each = EDITOR_DEF("interface/save_each_scene_on_quit", true);
+ 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;
+ for (int i = 0; i < editor_data.get_edited_scene_count(); i++) {
+ 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();
+ unsaved_scenes += "\n " + scene_filename;
+ }
+ }
+
+ 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();
+ }
+ }
+
+ if (OS::get_singleton()->is_window_minimized())
+ OS::get_singleton()->request_attention();
+ break;
+ }
+
+ if (_next_unsaved_scene() != -1) {
+ _save_all_scenes();
+ }
+ _discard_changes();
} break;
case RUN_FILE_SERVER: {
@@ -2603,7 +2672,7 @@ void EditorNode::_menu_option_confirm(int p_option, bool p_confirmed) {
OS::get_singleton()->shell_open("https://godotengine.org/community");
} break;
case HELP_ABOUT: {
- about->popup_centered_minsize(Size2(500, 130) * EDSCALE);
+ about->popup_centered_minsize(Size2(780, 500) * EDSCALE);
} break;
case SOURCES_REIMPORT: {
@@ -2680,6 +2749,70 @@ void EditorNode::_menu_option_confirm(int p_option, bool p_confirmed) {
}
}
+int EditorNode::_next_unsaved_scene() {
+
+ for (int i = 0; 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) {
+ 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() == -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);
@@ -3736,7 +3869,7 @@ void EditorNode::_dock_select_input(const Ref<InputEvent> &p_input) {
if (me.is_valid()) {
- Vector2 point = me->get_pos();
+ Vector2 point = me->get_position();
int nrect = -1;
for (int i = 0; i < DOCK_SLOT_MAX; i++) {
@@ -3846,7 +3979,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);
@@ -3899,7 +4032,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) {
@@ -4251,23 +4384,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());
@@ -4758,7 +4944,6 @@ void EditorNode::_dim_timeout() {
}
void EditorNode::_check_gui_base_size() {
- print_line(itos(int(gui_base->get_size().width)));
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>();
@@ -4774,6 +4959,13 @@ void EditorNode::_check_gui_base_size() {
}
}
+void EditorNode::_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 EditorNode::open_export_template_manager() {
export_template_manager->popup_manager();
@@ -4835,9 +5027,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);
@@ -4858,6 +5056,8 @@ void EditorNode::_bind_methods() {
ClassDB::bind_method(D_METHOD("_dim_timeout"), &EditorNode::_dim_timeout);
ClassDB::bind_method(D_METHOD("_check_gui_base_size"), &EditorNode::_check_gui_base_size);
+ ClassDB::bind_method(D_METHOD("_license_tree_selected"), &EditorNode::_license_tree_selected);
+
ADD_SIGNAL(MethodInfo("play_pressed"));
ADD_SIGNAL(MethodInfo("pause_pressed"));
ADD_SIGNAL(MethodInfo("stop_pressed"));
@@ -4878,9 +5078,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>();
@@ -5178,13 +5380,32 @@ EditorNode::EditorNode() {
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_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");
HBoxContainer *tabbar_container = memnew(HBoxContainer);
scene_tabs->set_h_size_flags(Control::SIZE_EXPAND_FILL);
@@ -5238,36 +5459,6 @@ EditorNode::EditorNode() {
top_region->add_child(left_menu_hb);
menu_hb->add_child(top_region);
- PopupMenu *p;
-
- 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);
-
- p = project_menu->get_popup();
- 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(TTR("Project Settings"), RUN_SETTINGS);
- 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);
-
file_menu = memnew(MenuButton);
file_menu->set_text(TTR("Scene"));
//file_menu->set_icon(gui_base->get_icon("Save","EditorIcons"));
@@ -5287,6 +5478,7 @@ EditorNode::EditorNode() {
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();
@@ -5306,7 +5498,6 @@ EditorNode::EditorNode() {
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);
@@ -5332,6 +5523,35 @@ 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);
+
+ 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);
+
+ p = project_menu->get_popup();
+ p->add_item(TTR("Project Settings"), RUN_SETTINGS);
+ p->add_separator();
+ 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();
+
+#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
PanelContainer *editor_region = memnew(PanelContainer);
main_editor_button_vb = memnew(HBoxContainer);
@@ -5713,6 +5933,7 @@ 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_enable_capitalize_paths(bool(EDITOR_DEF("interface/capitalize_properties", true)));
@@ -5818,6 +6039,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");
@@ -5869,19 +6096,160 @@ EditorNode::EditorNode() {
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);
- 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);
+ {
+
+ 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->set_resizable(true);
+ gui_base->add_child(about);
+
+ 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);
+ about->add_child(vbc);
+ vbc->add_child(hbc);
+
+ TextureRect *logo = memnew(TextureRect);
+ logo->set_texture(gui_base->get_icon("Logo", "EditorIcons"));
+ hbc->add_child(logo);
+
+ Label *about_text = memnew(Label);
+ about_text->set_v_size_flags(Control::SIZE_SHRINK_CENTER);
+ about_text->set_text(VERSION_FULL_NAME + 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(600, 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(32);
+ il->set_h_size_flags(Control::SIZE_EXPAND_FILL);
+ il->set_custom_minimum_size(Size2(0, i == 3 ? DEV_NAMES_COUNT * 7.6 : 30) * EDSCALE);
+ 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);
+ il->set_fixed_column_width(240 * EDSCALE);
+
+ 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_custom_minimum_size(Size2(0, 64 * EDSCALE));
+ 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));
+ }
warning = memnew(AcceptDialog);
gui_base->add_child(warning);
@@ -6004,10 +6372,9 @@ EditorNode::EditorNode() {
add_editor_plugin(memnew(Polygon2DEditorPlugin(this)));
add_editor_plugin(memnew(LightOccluder2DEditorPlugin(this)));
add_editor_plugin(memnew(NavigationPolygonEditorPlugin(this)));
- add_editor_plugin(memnew(ColorRampEditorPlugin(this)));
- add_editor_plugin(memnew(GradientTextureEditorPlugin(this)));
+ add_editor_plugin(memnew(GradientEditorPlugin(this)));
add_editor_plugin(memnew(CollisionShape2DEditorPlugin(this)));
- add_editor_plugin(memnew(CurveTextureEditorPlugin(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) ) );
@@ -6020,14 +6387,13 @@ 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();
@@ -6035,6 +6401,7 @@ EditorNode::EditorNode() {
editor_plugin_screen = NULL;
editor_plugins_over = memnew(EditorPluginList);
+ editor_plugins_force_input_forwarding = memnew(EditorPluginList);
//force_top_viewport(true);
_edit_current();
@@ -6183,6 +6550,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();
}
@@ -6218,10 +6586,14 @@ bool EditorPluginList::forward_gui_input(const Transform2D &p_canvas_xform, cons
return discard;
}
-bool EditorPluginList::forward_spatial_gui_input(Camera *p_camera, const Ref<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;
}
@@ -6237,6 +6609,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 bb5b57a454..991cf1df71 100644
--- a/editor/editor_node.h
+++ b/editor/editor_node.h
@@ -140,6 +140,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,
@@ -233,6 +235,8 @@ private:
//main tabs
Tabs *scene_tabs;
+ Panel *tab_preview_panel;
+ TextureRect *tab_preview;
int tab_closing;
bool exiting;
@@ -294,6 +298,7 @@ private:
//CallDialog *call_dialog;
ConfirmationDialog *confirmation;
+ ConfirmationDialog *save_confirmation;
ConfirmationDialog *import_confirmation;
ConfirmationDialog *open_recent_confirmation;
ConfirmationDialog *pick_main_scene;
@@ -396,6 +401,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;
@@ -425,6 +431,9 @@ private:
List<String> previous_scenes;
bool opening_prev;
+ Tree *_tpl_tree;
+ TextEdit *_tpl_text;
+
void _dialog_action(String p_file);
void _edit_current();
@@ -462,6 +471,9 @@ private:
void _vp_resized();
void _save_scene(String p_file, int idx = -1);
+ void _save_all_scenes();
+ int _next_unsaved_scene();
+ void _discard_changes(const String &p_str = String());
void _instance_request(const Vector<String> &p_files);
@@ -520,6 +532,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);
@@ -556,6 +569,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();
@@ -622,6 +640,8 @@ private:
void _dim_timeout();
void _check_gui_base_size();
+ void _license_tree_selected();
+
protected:
void _notification(int p_what);
static void _bind_methods();
@@ -641,6 +661,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; }
@@ -817,8 +838,9 @@ public:
void make_visible(bool p_visible);
void edit(Object *p_object);
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 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_plugin.cpp b/editor/editor_plugin.cpp
index 1b8d1b1677..e4b055a9e2 100644
--- a/editor/editor_plugin.cpp
+++ b/editor/editor_plugin.cpp
@@ -147,6 +147,12 @@ 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);
+}
+
Ref<SpatialEditorGizmo> EditorPlugin::create_spatial_gizmo(Spatial *p_spatial) {
//??
if (get_script_instance() && get_script_instance()->has_method("create_spatial_gizmo")) {
@@ -278,7 +284,12 @@ 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_changes();
+ 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) {
@@ -366,6 +377,8 @@ void EditorPlugin::_bind_methods() {
ClassDB::bind_method(D_METHOD("queue_save_layout"), &EditorPlugin::queue_save_layout);
ClassDB::bind_method(D_METHOD("edit_resource"), &EditorPlugin::edit_resource);
ClassDB::bind_method(D_METHOD("add_import_plugin"), &EditorPlugin::add_import_plugin);
+ ClassDB::bind_method(D_METHOD("remove_import_plugin"), &EditorPlugin::remove_import_plugin);
+ ClassDB::bind_method(D_METHOD("set_input_event_forwarding_always_enabled"), &EditorPlugin::set_input_event_forwarding_always_enabled);
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::OBJECT, "event", PROPERTY_HINT_RESOURCE_TYPE, "InputEvent")));
@@ -408,6 +421,7 @@ void EditorPlugin::_bind_methods() {
EditorPlugin::EditorPlugin() {
undo_redo = NULL;
+ input_event_forwarding_always_enabled = false;
}
EditorPlugin::~EditorPlugin() {
diff --git a/editor/editor_plugin.h b/editor/editor_plugin.h
index 1ef447a6b8..57a22a8b2f 100644
--- a/editor/editor_plugin.h
+++ b/editor/editor_plugin.h
@@ -61,6 +61,8 @@ class EditorPlugin : public Node {
UndoRedo *_get_undo_redo() { return undo_redo; }
+ bool input_event_forwarding_always_enabled;
+
protected:
static void _bind_methods();
UndoRedo &get_undo_redo() { return *undo_redo; }
@@ -106,6 +108,9 @@ public:
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; }
+
virtual Ref<SpatialEditorGizmo> create_spatial_gizmo(Spatial *p_spatial);
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);
@@ -148,6 +153,7 @@ public:
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 40ac95e2b5..c6b9d4bb41 100644
--- a/editor/editor_plugin_settings.cpp
+++ b/editor/editor_plugin_settings.cpp
@@ -82,7 +82,7 @@ void EditorPluginSettings::update_plugins() {
plugins.sort();
- Vector<String> active_plugins = GlobalConfig::get_singleton()->get("plugins/active");
+ Vector<String> active_plugins = GlobalConfig::get_singleton()->get("editor_plugins/enabled");
for (int i = 0; i < plugins.size(); i++) {
diff --git a/editor/editor_profiler.cpp b/editor/editor_profiler.cpp
index 5aad903485..64cf275c3a 100644
--- a/editor/editor_profiler.cpp
+++ b/editor/editor_profiler.cpp
@@ -496,7 +496,7 @@ void EditorProfiler::_graph_tex_input(const Ref<InputEvent> &p_ev) {
(mb.is_valid() && mb->get_button_index() == BUTTON_LEFT && mb->is_pressed()) ||
(mm.is_valid())) {
- int x = me->get_pos().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();
diff --git a/editor/editor_resource_preview.cpp b/editor/editor_resource_preview.cpp
index 0b1887e8a2..5d68de3bb6 100644
--- a/editor/editor_resource_preview.cpp
+++ b/editor/editor_resource_preview.cpp
@@ -190,7 +190,7 @@ void EditorResourcePreview::_thread() {
} else {
preview_mutex->unlock();
- Ref<Texture> texture;
+ Ref<ImageTexture> texture;
//print_line("pop from queue "+item.path);
@@ -229,6 +229,7 @@ void EditorResourcePreview::_thread() {
bool cache_valid = true;
if (tsize != thumbnail_size) {
+
cache_valid = false;
memdelete(f);
} else if (last_modtime != modtime) {
@@ -240,6 +241,7 @@ void EditorResourcePreview::_thread() {
if (last_md5 != md5) {
cache_valid = false;
+
} else {
//update modified time
@@ -252,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);
}
}
diff --git a/editor/editor_run.cpp b/editor/editor_run.cpp
index e0ebe985cd..a8106b4eec 100644
--- a/editor/editor_run.cpp
+++ b/editor/editor_run.cpp
@@ -42,6 +42,7 @@ Error EditorRun::run(const String &p_scene, const String p_custom_args, const Li
String resource_path = GlobalConfig::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");
@@ -50,7 +51,7 @@ Error EditorRun::run(const String &p_scene, const String p_custom_args, const Li
if (true) {
args.push_back("-rdebug");
- args.push_back(remote_host + ":" + String::num(GLOBAL_GET("network/debug/remote_port")));
+ args.push_back(remote_host + ":" + String::num(remote_port));
}
args.push_back("-epid");
@@ -73,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 = GlobalConfig::get_singleton()->get("display/window/width");
+ desired_size.y = GlobalConfig::get_singleton()->get("display/window/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 = GlobalConfig::get_singleton()->get("display/window/test_width");
+ test_size.y = GlobalConfig::get_singleton()->get("display/window/test_height");
if (test_size.x > 0 && test_size.y > 0) {
desired_size = test_size;
@@ -95,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");
@@ -117,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_native.cpp b/editor/editor_run_native.cpp
index 4a767621ef..52b7e6992d 100644
--- a/editor/editor_run_native.cpp
+++ b/editor/editor_run_native.cpp
@@ -41,7 +41,7 @@ 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()) {
Ref<Image> im = icon->get_data();
im = im->duplicate();
diff --git a/editor/editor_settings.cpp b/editor/editor_settings.cpp
index df12c7c75f..5c6ba892cb 100644
--- a/editor/editor_settings.cpp
+++ b/editor/editor_settings.cpp
@@ -42,9 +42,9 @@
#include "os/keyboard.h"
#include "os/os.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;
@@ -292,6 +292,12 @@ void EditorSettings::create() {
dir->change_dir("..");
}
+ if (dir->change_dir("script_templates") != OK) {
+ dir->make_dir("script_templates");
+ } else {
+ dir->change_dir("..");
+ }
+
if (dir->change_dir("tmp") != OK) {
dir->make_dir("tmp");
} else {
@@ -502,7 +508,7 @@ 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);
+ 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);
@@ -511,6 +517,9 @@ void EditorSettings::_load_defaults(Ref<ConfigFile> p_extra_config) {
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("#273241"));
@@ -522,6 +531,12 @@ void EditorSettings::_load_defaults(Ref<ConfigFile> p_extra_config) {
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", "");
@@ -556,6 +571,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);
@@ -567,7 +584,7 @@ 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);
@@ -584,7 +601,7 @@ void EditorSettings::_load_defaults(Ref<ConfigFile> p_extra_config) {
set("editors/3d/grid_color", Color(0, 1, 0, 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);
@@ -612,10 +629,12 @@ void EditorSettings::_load_defaults(Ref<ConfigFile> p_extra_config) {
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++) {
@@ -718,7 +737,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));
@@ -942,6 +961,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?
diff --git a/editor/editor_settings.h b/editor/editor_settings.h
index 7b45e28350..d5adb84b63 100644
--- a/editor/editor_settings.h
+++ b/editor/editor_settings.h
@@ -159,6 +159,8 @@ 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 Ref<InputEvent> &p_event) const;
Ref<ShortCut> get_shortcut(const String &p_name) const;
diff --git a/editor/editor_themes.cpp b/editor/editor_themes.cpp
index bf15f43d32..5b8f41e75f 100644
--- a/editor/editor_themes.cpp
+++ b/editor/editor_themes.cpp
@@ -117,9 +117,9 @@ Ref<Theme> create_editor_theme() {
contrast = 0.25;
} break;
case 3: { // Arc
- highlight_color = Color::html("#68a7f2");
- base_color = Color::html("#434a59");
- contrast = 0.2;
+ highlight_color = Color::html("#5294e2");
+ base_color = Color::html("#383c4a");
+ contrast = 0.25;
} break;
}
@@ -145,8 +145,8 @@ Ref<Theme> create_editor_theme() {
theme->set_icon("unchecked", "PopupMenu", theme->get_icon("Unchecked", "EditorIcons"));
// Editor background
- Ref<StyleBoxFlat> style_background = make_flat_stylebox(dark_color_2, 4, 4, 4, 4);
- theme->set_stylebox("Background", "EditorStyles", style_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);
@@ -193,9 +193,9 @@ Ref<Theme> create_editor_theme() {
theme->set_stylebox("MenuHover", "EditorStyles", style_menu_hover_border);
// Content of each tab
- Ref<StyleBoxFlat> style_panel = make_flat_stylebox(base_color, 1, 4, 1, 1);
- theme->set_stylebox("panel", "TabContainer", style_panel);
- theme->set_stylebox("Content", "EditorStyles", style_panel);
+ Ref<StyleBoxFlat> style_content_panel = make_flat_stylebox(base_color, 1, 4, 1, 1);
+ theme->set_stylebox("panel", "TabContainer", style_content_panel);
+ theme->set_stylebox("Content", "EditorStyles", style_content_panel);
// Button
Ref<StyleBoxFlat> style_button = make_flat_stylebox(dark_color_1, 4, 4, 4, 4);
@@ -235,10 +235,12 @@ Ref<Theme> create_editor_theme() {
style_popup_menu->set_dark_color(light_color_1);
theme->set_stylebox("panel", "PopupMenu", style_popup_menu);
- // Tree & script background
- Ref<StyleBoxFlat> style_bg = make_flat_stylebox(dark_color_1, 0, 0, 0, 0);
- theme->set_stylebox("bg", "Tree", style_bg);
- theme->set_stylebox("ScriptPanel", "EditorStyles", style_bg);
+ // Tree & ItemList background
+ Ref<StyleBoxFlat> style_tree_bg = make_flat_stylebox(dark_color_1, 2, 4, 2, 4);
+ 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);
+ theme->set_stylebox("ScriptPanel", "EditorStyles", style_script_bg);
// Tree
theme->set_icon("checked", "Tree", theme->get_icon("Checked", "EditorIcons"));
@@ -247,14 +249,18 @@ Ref<Theme> create_editor_theme() {
theme->set_icon("arrow_collapsed", "Tree", theme->get_icon("TreeArrowRight", "EditorIcons"));
theme->set_icon("select_arrow", "Tree", theme->get_icon("Dropdown", "EditorIcons"));
theme->set_stylebox("bg_focus", "Tree", focus_sbt);
+ theme->set_stylebox("custom_button", "Tree", style_button);
+ theme->set_stylebox("custom_button_pressed", "Tree", style_button);
+ theme->set_stylebox("custom_button_hover", "Tree", style_button);
+ 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, 4, 4, 4, 4);
+ 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(light_color_1, 4, 4, 4, 4);
+ 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);
@@ -269,25 +275,27 @@ Ref<Theme> create_editor_theme() {
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_3);
- theme->set_color("prop_section", "Editor", dark_color_1);
- theme->set_color("prop_subsection", "Editor", dark_color_2);
- theme->set_color("fg_selected", "Editor", Color::html("ffbd8e8e"));
+ 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_cursor = make_flat_stylebox(highlight_color, 8, 8, 8, 8);
+ Ref<StyleBoxFlat> style_itemlist_bg = make_flat_stylebox(dark_color_1, 4, 4, 4, 4);
+ Ref<StyleBoxFlat> style_itemlist_cursor = make_flat_stylebox(highlight_color, 0, 0, 0, 0);
style_itemlist_cursor->set_draw_center(false);
style_itemlist_cursor->set_border_size(1 * EDSCALE);
- style_itemlist_cursor->set_light_color(light_color_1);
- style_itemlist_cursor->set_dark_color(light_color_1);
+ style_itemlist_cursor->set_light_color(HIGHLIGHT_COLOR_DARK);
+ style_itemlist_cursor->set_dark_color(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_bg);
+ theme->set_stylebox("bg", "ItemList", style_itemlist_bg);
+ theme->set_constant("vseparation", "ItemList", 5 * EDSCALE);
Ref<StyleBoxFlat> style_tab_fg = make_flat_stylebox(base_color, 15, 5, 15, 5);
Ref<StyleBoxFlat> style_tab_bg = make_flat_stylebox(base_color, 15, 5, 15, 5);
@@ -302,6 +310,8 @@ Ref<Theme> create_editor_theme() {
theme->set_color("font_color_bg", "TabContainer", light_color_2);
theme->set_icon("menu", "TabContainer", theme->get_icon("TabMenu", "EditorIcons"));
theme->set_icon("menu_hl", "TabContainer", theme->get_icon("TabMenu", "EditorIcons"));
+ theme->set_stylebox("SceneTabFG", "EditorStyles", make_flat_stylebox(base_color, 10, 5, 10, 5));
+ theme->set_stylebox("SceneTabBG", "EditorStyles", make_empty_stylebox(6, 5, 6, 5));
// Debugger
Ref<StyleBoxFlat> style_panel_debugger = make_flat_stylebox(dark_color_2, 0, 4, 0, 0);
@@ -390,6 +400,9 @@ Ref<Theme> create_editor_theme() {
theme->set_icon("grabber", "VSlider", theme->get_icon("SliderGrabber", "EditorIcons"));
theme->set_icon("grabber_highlight", "VSlider", theme->get_icon("SliderGrabberHl", "EditorIcons"));
+ // 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_size(2 * EDSCALE);
diff --git a/editor/icons/SCsub b/editor/icons/SCsub
index 20a381cc78..182624a80d 100644
--- a/editor/icons/SCsub
+++ b/editor/icons/SCsub
@@ -90,7 +90,7 @@ make_editor_icons_builder = Builder(action=make_editor_icons_action,
suffix='.cpp',
src_suffix='.png')
env['BUILDERS']['MakeEditorIconsBuilder'] = make_editor_icons_builder
-env.Alias('editor_icons', [env.MakeEditorIconsBuilder('#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_audio_player.png b/editor/icons/icon_audio_player.png
deleted file mode 100644
index c3e6d6cafa..0000000000
--- a/editor/icons/icon_audio_player.png
+++ /dev/null
Binary files differ
diff --git a/editor/icons/icon_h_button_array.png b/editor/icons/icon_h_button_array.png
deleted file mode 100644
index baf3386801..0000000000
--- a/editor/icons/icon_h_button_array.png
+++ /dev/null
Binary files differ
diff --git a/editor/icons/icon_v_button_array.png b/editor/icons/icon_v_button_array.png
deleted file mode 100644
index d7ea9cc375..0000000000
--- a/editor/icons/icon_v_button_array.png
+++ /dev/null
Binary files differ
diff --git a/editor/import/editor_import_collada.cpp b/editor/import/editor_import_collada.cpp
index 907c7b045c..5bf2da9912 100644
--- a/editor/import/editor_import_collada.cpp
+++ b/editor/import/editor_import_collada.cpp
@@ -72,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;
@@ -88,7 +88,7 @@ struct ColladaImport {
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_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_data, 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);
@@ -591,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 *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;
@@ -867,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) {
@@ -908,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
@@ -1530,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()));
@@ -1621,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);
@@ -1648,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 {
@@ -1656,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);
diff --git a/editor/import/editor_import_plugin.cpp b/editor/import/editor_import_plugin.cpp
index 6dee5da538..4ebbcb1610 100644
--- a/editor/import/editor_import_plugin.cpp
+++ b/editor/import/editor_import_plugin.cpp
@@ -56,7 +56,7 @@ String EditorImportPlugin::get_preset_name(int p_idx) const {
return get_script_instance()->call("get_preset_name", p_idx);
}
-int EditorImportPlugin::get_preset_count() {
+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");
}
diff --git a/editor/import/editor_import_plugin.h b/editor/import/editor_import_plugin.h
index 3c16b79713..b60813db61 100644
--- a/editor/import/editor_import_plugin.h
+++ b/editor/import/editor_import_plugin.h
@@ -43,7 +43,7 @@ public:
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();
+ 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;
diff --git a/editor/import/resource_importer_csv_translation.cpp b/editor/import/resource_importer_csv_translation.cpp
index 85d446f38a..9214b8f45e 100644
--- a/editor/import/resource_importer_csv_translation.cpp
+++ b/editor/import/resource_importer_csv_translation.cpp
@@ -128,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_obj.cpp b/editor/import/resource_importer_obj.cpp
index 21c2ae6eb3..4a2f37e319 100644
--- a/editor/import/resource_importer_obj.cpp
+++ b/editor/import/resource_importer_obj.cpp
@@ -33,7 +33,6 @@
#include "os/file_access.h"
#include "scene/resources/mesh.h"
#include "scene/resources/surface_tool.h"
-#include "scene/resources/surface_tool.h"
String ResourceImporterOBJ::get_importer_name() const {
@@ -49,12 +48,12 @@ void ResourceImporterOBJ::get_recognized_extensions(List<String> *p_extensions)
p_extensions->push_back("obj");
}
String ResourceImporterOBJ::get_save_extension() const {
- return "msh";
+ return "mesh";
}
String ResourceImporterOBJ::get_resource_type() const {
- return "Mesh";
+ return "ArrayMesh";
}
bool ResourceImporterOBJ::get_option_visibility(const String &p_option, const Map<StringName, Variant> &p_options) const {
@@ -89,7 +88,7 @@ Error ResourceImporterOBJ::import(const String &p_source_file, const String &p_s
FileAccessRef f = FileAccess::open(p_source_file, FileAccess::READ);
ERR_FAIL_COND_V(!f, ERR_CANT_OPEN);
- Ref<Mesh> mesh = Ref<Mesh>(memnew(Mesh));
+ Ref<ArrayMesh> mesh = Ref<ArrayMesh>(memnew(ArrayMesh));
Map<String, Ref<Material> > name_map;
bool generate_normals = p_options["generate/normals"];
@@ -189,7 +188,7 @@ Error ResourceImporterOBJ::import(const String &p_source_file, const String &p_s
Vector3 vertex = vertices[vtx];
if (weld_vertices)
- vertex = vertex.snapped(weld_tolerance);
+ vertex.snap(Vector3(weld_tolerance, weld_tolerance, weld_tolerance));
surf_tool->add_vertex(vertex);
}
@@ -244,7 +243,7 @@ Error ResourceImporterOBJ::import(const String &p_source_file, const String &p_s
}
*/
- Error err = ResourceSaver::save(p_save_path + ".msh", mesh);
+ Error err = ResourceSaver::save(p_save_path + ".mesh", mesh);
return err;
}
diff --git a/editor/import/resource_importer_scene.cpp b/editor/import/resource_importer_scene.cpp
index 755f4eb219..2ccbd36e18 100644
--- a/editor/import/resource_importer_scene.cpp
+++ b/editor/import/resource_importer_scene.cpp
@@ -137,7 +137,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++) {
@@ -175,7 +175,7 @@ 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<SpatialMaterial> fm = m->surface_get_material(i);
@@ -194,7 +194,7 @@ Node *ResourceImporterScene::_fix_node(Node *p_node, Node *p_root, Map<Ref<Mesh>
MeshInstance *mi = p_node->cast_to<MeshInstance>();
- Ref<Mesh> m = mi->get_mesh();
+ Ref<ArrayMesh> m = mi->get_mesh();
if (m.is_valid()) {
@@ -275,7 +275,7 @@ 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<SpatialMaterial> fm = m->surface_get_material(i);
@@ -325,7 +325,7 @@ 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<SpatialMaterial> fm = m->surface_get_material(i);
@@ -477,7 +477,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);
@@ -594,7 +594,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;
@@ -655,7 +655,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")) {
@@ -972,7 +972,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_make_meshes, Map<Ref<Material>, Ref<Material> > &p_materials, Map<Ref<ArrayMesh>, Ref<ArrayMesh> > &p_meshes) {
List<PropertyInfo> pi;
@@ -987,7 +987,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);
@@ -1005,7 +1005,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()) {
@@ -1015,10 +1015,10 @@ 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";
+ String ext_name = p_base_path + "." + _make_extname(mesh->get_name()) + ".mesh";
if (FileAccess::exists(ext_name)) {
//if exists, use it
- Ref<Mesh> existing = ResourceLoader::load(ext_name);
+ Ref<ArrayMesh> existing = ResourceLoader::load(ext_name);
p_meshes[mesh] = existing;
} else {
@@ -1040,7 +1040,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);
@@ -1059,7 +1059,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
}
}
}
@@ -1192,7 +1192,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);
@@ -1230,7 +1230,7 @@ Error ResourceImporterScene::import(const String &p_source_file, const String &p
if (external_materials || external_meshes) {
Map<Ref<Material>, Ref<Material> > mat_map;
- Map<Ref<Mesh>, Ref<Mesh> > mesh_map;
+ Map<Ref<ArrayMesh>, Ref<ArrayMesh> > mesh_map;
_make_external_resources(scene, p_source_file.get_basename(), external_materials, external_meshes, mat_map, mesh_map);
}
diff --git a/editor/import/resource_importer_scene.h b/editor/import/resource_importer_scene.h
index 9f7b1a84e6..ede3028b29 100644
--- a/editor/import/resource_importer_scene.h
+++ b/editor/import/resource_importer_scene.h
@@ -32,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;
@@ -100,9 +101,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_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 7e27f6c618..3834e52fab 100644
--- a/editor/import/resource_importer_texture.cpp
+++ b/editor/import/resource_importer_texture.cpp
@@ -66,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()) {
@@ -96,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);
@@ -144,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;
}
@@ -170,21 +195,23 @@ 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 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) {
+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');
@@ -205,6 +232,8 @@ void ResourceImporterTexture::_save_stex(const Ref<Image> &p_image, const String
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
@@ -277,7 +306,14 @@ void ResourceImporterTexture::_save_stex(const Ref<Image> &p_image, const String
if (p_force_rgbe && image->get_format() >= Image::FORMAT_R8 && image->get_format() <= Image::FORMAT_RGBE9995) {
image->convert(Image::FORMAT_RGBE9995);
} else {
- image->compress(p_vram_compression, p_texture_flags & VS::TEXTURE_FLAG_CONVERT_TO_LINEAR);
+ 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();
@@ -288,7 +324,6 @@ void ResourceImporterTexture::_save_stex(const Ref<Image> &p_image, const String
int dl = data.size();
PoolVector<uint8_t>::Read r = data.read();
f->store_buffer(r.ptr(), dl);
-
} break;
case COMPRESS_UNCOMPRESSED: {
@@ -329,6 +364,7 @@ Error ResourceImporterTexture::import(const String &p_source_file, const String
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"];
Ref<Image> image;
image.instance();
@@ -376,20 +412,38 @@ Error ResourceImporterTexture::import(const String &p_source_file, const String
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
//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, force_rgbe);
- 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, force_rgbe);
- r_platform_variants->push_back("s3tc");
+ if (GlobalConfig::get_singleton()->get("rendering/vram_formats/use_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 (GlobalConfig::get_singleton()->get("rendering/vram_formats/use_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 (GlobalConfig::get_singleton()->get("rendering/vram_formats/use_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 (GlobalConfig::get_singleton()->get("rendering/vram_formats/use_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_S3TC /*this is ignored */, mipmaps, tex_flags, stream, detect_3d, detect_srgb, force_rgbe);
+ _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;
@@ -402,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 4998ed7657..31bd0f29b0 100644
--- a/editor/import/resource_importer_texture.h
+++ b/editor/import/resource_importer_texture.h
@@ -41,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;
@@ -49,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;
@@ -80,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 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);
+ 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 92c1aa47db..18c4bed5dd 100644
--- a/editor/import/resource_importer_wav.cpp
+++ b/editor/import/resource_importer_wav.cpp
@@ -48,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 {
@@ -153,6 +153,8 @@ Error ResourceImporterWAV::import(const String &p_source_file, const String &p_s
uint16_t compression_code = file->get_16();
+ //Issue: #7755 : Not a bug - usage of other formats (format codes) are unsupported in current importer version.
+ //Consider revision for engine version 3.0
if (compression_code != 1) {
ERR_PRINT("Format not supported for WAVE file (not PCM). Save WAVE files as uncompressed PCM instead.");
break;
@@ -249,6 +251,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!
@@ -485,7 +496,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/io_plugins/editor_font_import_plugin.cpp b/editor/io_plugins/editor_font_import_plugin.cpp
index fa66328887..9831e08cf1 100644
--- a/editor/io_plugins/editor_font_import_plugin.cpp
+++ b/editor/io_plugins/editor_font_import_plugin.cpp
@@ -533,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;
}
@@ -665,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()) {
@@ -1690,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_mesh_import_plugin.cpp b/editor/io_plugins/editor_mesh_import_plugin.cpp
index a8ecc2f10e..0c9f3a3f37 100644
--- a/editor/io_plugins/editor_mesh_import_plugin.cpp
+++ b/editor/io_plugins/editor_mesh_import_plugin.cpp
@@ -262,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_sample_import_plugin.cpp b/editor/io_plugins/editor_sample_import_plugin.cpp
index 7836b60fde..0909b96cdc 100644
--- a/editor/io_plugins/editor_sample_import_plugin.cpp
+++ b/editor/io_plugins/editor_sample_import_plugin.cpp
@@ -299,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);
}
@@ -910,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_texture_import_plugin.cpp b/editor/io_plugins/editor_texture_import_plugin.cpp
index e860866d24..d48675fa30 100644
--- a/editor/io_plugins/editor_texture_import_plugin.cpp
+++ b/editor/io_plugins/editor_texture_import_plugin.cpp
@@ -596,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);
@@ -1097,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;
@@ -1317,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;
diff --git a/editor/io_plugins/editor_translation_import_plugin.cpp b/editor/io_plugins/editor_translation_import_plugin.cpp
index caa0659046..5b15b94006 100644
--- a/editor/io_plugins/editor_translation_import_plugin.cpp
+++ b/editor/io_plugins/editor_translation_import_plugin.cpp
@@ -258,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!"));
diff --git a/editor/pane_drag.h b/editor/pane_drag.h
index 7bd9feb63b..0be017b8f7 100644
--- a/editor/pane_drag.h
+++ b/editor/pane_drag.h
@@ -34,7 +34,7 @@
class PaneDrag : public Control {
- GDCLASS(PaneDrag, Control);
+ GDCLASS(PaneDrag, Control)
bool mouse_over;
diff --git a/editor/plugins/animation_player_editor_plugin.cpp b/editor/plugins/animation_player_editor_plugin.cpp
index 17fb953f3f..c3e1f60ccc 100644
--- a/editor/plugins/animation_player_editor_plugin.cpp
+++ b/editor/plugins/animation_player_editor_plugin.cpp
@@ -254,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);
@@ -1377,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_position(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_position(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_tree_editor_plugin.cpp b/editor/plugins/animation_tree_editor_plugin.cpp
index fccd527ed6..d67832e10b 100644
--- a/editor/plugins/animation_tree_editor_plugin.cpp
+++ b/editor/plugins/animation_tree_editor_plugin.cpp
@@ -744,7 +744,7 @@ void AnimationTreeEditor::_gui_input(Ref<InputEvent> p_event) {
if (mb->is_pressed()) {
if (mb->get_button_index() == 1) {
- click_pos = Point2(mb->get_pos().x, mb->get_pos().y);
+ 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) {
@@ -780,7 +780,7 @@ void AnimationTreeEditor::_gui_input(Ref<InputEvent> p_event) {
} else {
// try to disconnect/remove
- Point2 rclick_pos = Point2(mb->get_pos().x, mb->get_pos().y);
+ 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) {
@@ -820,7 +820,7 @@ void AnimationTreeEditor::_gui_input(Ref<InputEvent> p_event) {
case CLICK_INPUT_SLOT:
case CLICK_OUTPUT_SLOT: {
- Point2 dst_click_pos = Point2(mb->get_pos().x, mb->get_pos().y);
+ 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);
@@ -859,7 +859,7 @@ void AnimationTreeEditor::_gui_input(Ref<InputEvent> p_event) {
if (mm->get_button_mask() & 1 && click_type != CLICK_NONE) {
- click_motion = Point2(mm->get_pos().x, mm->get_pos().y);
+ 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))) {
@@ -876,7 +876,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;
@@ -888,7 +888,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) {
diff --git a/editor/plugins/canvas_item_editor_plugin.cpp b/editor/plugins/canvas_item_editor_plugin.cpp
index a626dffc3c..7ce884a455 100644
--- a/editor/plugins/canvas_item_editor_plugin.cpp
+++ b/editor/plugins/canvas_item_editor_plugin.cpp
@@ -199,6 +199,25 @@ void CanvasItemEditor::_edit_set_pivot(const Vector2 &mouse_pos) {
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();
@@ -536,10 +555,10 @@ 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);
}
@@ -652,7 +671,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
@@ -680,7 +699,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();
@@ -695,13 +714,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() {
@@ -759,18 +778,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[] = {
@@ -842,6 +861,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>()) {
@@ -962,7 +983,7 @@ bool CanvasItemEditor::get_remove_list(List<Node *> *p_list) {
void CanvasItemEditor::_list_select(const Ref<InputEventMouseButton> &b) {
- Point2 click = b->get_pos();
+ Point2 click = b->get_position();
Node *scene = editor->get_edited_scene();
if (!scene)
@@ -1010,13 +1031,12 @@ void CanvasItemEditor::_list_select(const Ref<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->get_shift();
- selection_menu->set_global_position(b->get_global_pos());
+ 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();
@@ -1047,17 +1067,25 @@ void CanvasItemEditor::_viewport_gui_input(const Ref<InputEvent> &p_event) {
if (b->get_button_index() == BUTTON_WHEEL_DOWN) {
- if (zoom < MIN_ZOOM)
- return;
+ if (bool(EditorSettings::get_singleton()->get("editors/2d/scroll_to_pan"))) {
+
+ v_scroll->set_value(v_scroll->get_value() + int(EditorSettings::get_singleton()->get("editors/2d/pan_speed")) / zoom * b->get_factor());
+
+ } else {
- float prev_zoom = zoom;
- zoom = zoom * (1 - (0.05 * b->get_factor()));
- {
- Point2 ofs = b->get_pos();
- 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;
@@ -1065,16 +1093,21 @@ void CanvasItemEditor::_viewport_gui_input(const Ref<InputEvent> &p_event) {
if (b->get_button_index() == BUTTON_WHEEL_UP) {
- if (zoom > MAX_ZOOM)
- return;
+ if (bool(EditorSettings::get_singleton()->get("editors/2d/scroll_to_pan"))) {
+
+ v_scroll->set_value(v_scroll->get_value() - int(EditorSettings::get_singleton()->get("editors/2d/pan_speed")) / zoom * b->get_factor());
+
+ } 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_pos();
- 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);
+ 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);
@@ -1082,6 +1115,22 @@ void CanvasItemEditor::_viewport_gui_input(const Ref<InputEvent> &p_event) {
return;
}
+ if (b->get_button_index() == BUTTON_WHEEL_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->get_button_index() == BUTTON_WHEEL_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())) {
@@ -1121,6 +1170,8 @@ void CanvasItemEditor::_viewport_gui_input(const Ref<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);
}
}
@@ -1156,7 +1207,7 @@ void CanvasItemEditor::_viewport_gui_input(const Ref<InputEvent> &p_event) {
if (b->get_button_index() == BUTTON_LEFT && tool == TOOL_EDIT_PIVOT) {
if (b->is_pressed()) {
- Point2 mouse_pos = b->get_pos();
+ 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);
@@ -1210,12 +1261,18 @@ void CanvasItemEditor::_viewport_gui_input(const Ref<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();
@@ -1274,8 +1331,8 @@ void CanvasItemEditor::_viewport_gui_input(const Ref<InputEvent> &p_event) {
E->get().to
};
- Vector2 p = Geometry::get_closest_point_to_segment_2d(b->get_pos(), s);
- float d = p.distance_to(b->get_pos());
+ 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;
@@ -1342,7 +1399,7 @@ void CanvasItemEditor::_viewport_gui_input(const Ref<InputEvent> &p_event) {
CanvasItemEditorSelectedItem *se = editor_selection->get_node_editor_data<CanvasItemEditorSelectedItem>(canvas_item);
ERR_FAIL_COND(!se);
- Point2 click = b->get_pos();
+ Point2 click = b->get_position();
if ((b->get_control() && tool == TOOL_SELECT) || tool == TOOL_ROTATE) {
@@ -1352,7 +1409,7 @@ void CanvasItemEditor::_viewport_gui_input(const Ref<InputEvent> &p_event) {
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;
}
@@ -1377,6 +1434,8 @@ void CanvasItemEditor::_viewport_gui_input(const Ref<InputEvent> &p_event) {
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;
}
@@ -1388,7 +1447,7 @@ void CanvasItemEditor::_viewport_gui_input(const Ref<InputEvent> &p_event) {
//multi canvas_item edit
- Point2 click = b->get_pos();
+ Point2 click = b->get_position();
if ((b->get_alt() || tool == TOOL_MOVE) && get_item_count()) {
_prepare_drag(click);
@@ -1451,7 +1510,7 @@ void CanvasItemEditor::_viewport_gui_input(const Ref<InputEvent> &p_event) {
if (box_selecting) {
- box_selecting_to = transform.affine_inverse().xform(m->get_pos());
+ box_selecting_to = transform.affine_inverse().xform(m->get_position());
viewport->update();
return;
}
@@ -1494,10 +1553,12 @@ void CanvasItemEditor::_viewport_gui_input(const Ref<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(m->get_pos());
+ Vector2 dto = transform.affine_inverse().xform(m->get_position());
if (canvas_item->has_meta("_edit_lock_"))
continue;
@@ -1552,8 +1613,8 @@ void CanvasItemEditor::_viewport_gui_input(const Ref<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) {
@@ -1631,6 +1692,9 @@ void CanvasItemEditor::_viewport_gui_input(const Ref<InputEvent> &p_event) {
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: {
@@ -1645,7 +1709,7 @@ void CanvasItemEditor::_viewport_gui_input(const Ref<InputEvent> &p_event) {
if (!dragging_bone) {
- local_rect.pos = begin;
+ local_rect.position = begin;
local_rect.size = end - begin;
canvas_item->edit_set_rect(local_rect);
@@ -1868,10 +1932,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);
@@ -1892,6 +1956,14 @@ void CanvasItemEditor::_viewport_draw() {
pivot_found = true;
}
}
+ if (canvas_item->cast_to<Control>()) {
+ Vector2 pivot_ofs = canvas_item->cast_to<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) {
@@ -2080,10 +2152,16 @@ void CanvasItemEditor::_notification(int p_what) {
Transform2D xform = canvas_item->get_transform();
- if (r != se->prev_rect || xform != se->prev_xform) {
+ Vector2 pivot;
+ if (canvas_item->cast_to<Control>()) {
+ pivot = canvas_item->cast_to<Control>()->get_pivot_offset();
+ }
+
+ if (r != se->prev_rect || xform != se->prev_xform || pivot != se->prev_pivot) {
viewport->update();
se->prev_rect = r;
se->prev_xform = xform;
+ se->prev_pivot = pivot;
}
}
@@ -2212,7 +2290,7 @@ 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);
}
@@ -2228,10 +2306,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));
}
}
@@ -2277,19 +2355,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
@@ -2304,12 +2382,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();
}
@@ -2659,11 +2737,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
@@ -2690,11 +2768,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);
}
}
}
@@ -2704,9 +2782,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_position(), 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);
}
}
@@ -2791,10 +2871,10 @@ void CanvasItemEditor::_popup_callback(int p_op) {
if (!n2d)
continue;
undo_redo->add_do_method(n2d, "set_position", E->get().pos);
- undo_redo->add_do_method(n2d, "set_rot", E->get().rot);
+ 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_position", n2d->get_position());
- undo_redo->add_undo_method(n2d, "set_rot", n2d->get_rotation());
+ 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();
@@ -2977,7 +3057,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 {
@@ -2988,7 +3068,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);
@@ -3242,6 +3322,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);
@@ -3263,6 +3344,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");
/*
diff --git a/editor/plugins/canvas_item_editor_plugin.h b/editor/plugins/canvas_item_editor_plugin.h
index 22fa5b5db8..702deb51f9 100644
--- a/editor/plugins/canvas_item_editor_plugin.h
+++ b/editor/plugins/canvas_item_editor_plugin.h
@@ -56,6 +56,7 @@ public:
Transform2D prev_xform;
float prev_rot;
Rect2 prev_rect;
+ Vector2 prev_pivot;
CanvasItemEditorSelectedItem() { prev_rot = 0; }
};
diff --git a/editor/plugins/collision_polygon_2d_editor_plugin.cpp b/editor/plugins/collision_polygon_2d_editor_plugin.cpp
index b7cfcaae02..abee3ead71 100644
--- a/editor/plugins/collision_polygon_2d_editor_plugin.cpp
+++ b/editor/plugins/collision_polygon_2d_editor_plugin.cpp
@@ -104,7 +104,7 @@ bool CollisionPolygon2DEditor::forward_gui_input(const Ref<InputEvent> &p_event)
if (mb.is_valid()) {
Transform2D xform = canvas_item_editor->get_canvas_transform() * node->get_global_transform();
- Vector2 gpoint = mb->get_pos();
+ 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);
@@ -112,7 +112,7 @@ bool CollisionPolygon2DEditor::forward_gui_input(const Ref<InputEvent> &p_event)
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);
+ real_t grab_threshold = EDITOR_DEF("editors/poly_editor/point_grab_radius", 8);
switch (mode) {
@@ -131,7 +131,7 @@ bool CollisionPolygon2DEditor::forward_gui_input(const Ref<InputEvent> &p_event)
return true;
} else {
- if (wip.size() > 1 && xform.xform(wip[0]).distance_to(gpoint) < grab_treshold) {
+ if (wip.size() > 1 && xform.xform(wip[0]).distance_to(gpoint) < grab_threshold) {
//wip closed
_wip_close();
@@ -185,7 +185,7 @@ bool CollisionPolygon2DEditor::forward_gui_input(const Ref<InputEvent> &p_event)
continue; //not valid to reuse point
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;
@@ -214,7 +214,7 @@ bool CollisionPolygon2DEditor::forward_gui_input(const Ref<InputEvent> &p_event)
Vector2 cp = xform.xform(poly[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;
@@ -259,7 +259,7 @@ bool CollisionPolygon2DEditor::forward_gui_input(const Ref<InputEvent> &p_event)
Vector2 cp = xform.xform(poly[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;
@@ -289,7 +289,7 @@ bool CollisionPolygon2DEditor::forward_gui_input(const Ref<InputEvent> &p_event)
if (edited_point != -1 && (wip_active || mm->get_button_mask() & BUTTON_MASK_LEFT)) {
- Vector2 gpoint = mm->get_pos();
+ 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);
diff --git a/editor/plugins/collision_shape_2d_editor_plugin.cpp b/editor/plugins/collision_shape_2d_editor_plugin.cpp
index e2184c6158..9a6ee8153e 100644
--- a/editor/plugins/collision_shape_2d_editor_plugin.cpp
+++ b/editor/plugins/collision_shape_2d_editor_plugin.cpp
@@ -322,7 +322,7 @@ bool CollisionShape2DEditor::forward_gui_input(const Ref<InputEvent> &p_event) {
Transform2D gt = canvas_item_editor->get_canvas_transform() * node->get_global_transform();
- Point2 gpoint(mb->get_pos().x, mb->get_pos().y);
+ Point2 gpoint(mb->get_position().x, mb->get_position().y);
if (mb->get_button_index() == BUTTON_LEFT) {
if (mb->is_pressed()) {
@@ -368,7 +368,7 @@ bool CollisionShape2DEditor::forward_gui_input(const Ref<InputEvent> &p_event) {
return false;
}
- Point2 gpoint = mm->get_pos();
+ 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);
diff --git a/editor/plugins/curve_editor_plugin.cpp b/editor/plugins/curve_editor_plugin.cpp
index 6dd94863a1..2d05c8eba1 100644
--- a/editor/plugins/curve_editor_plugin.cpp
+++ b/editor/plugins/curve_editor_plugin.cpp
@@ -27,528 +27,894 @@
/* 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"
-#include "spatial_editor_plugin.h"
-
-void CurveTextureEdit::_gui_input(const Ref<InputEvent> &p_event) {
- Ref<InputEventKey> k = p_event;
- if (k.is_valid() && k->is_pressed() && k->get_scancode() == KEY_DELETE && grabbed != -1) {
+CurveEditor::CurveEditor() {
+ _selected_point = -1;
+ _hover_point = -1;
+ _selected_tangent = TANGENT_NONE;
+ _hover_radius = 6;
+ _tangents_length = 40;
+ _dragging = false;
+ _has_undo_data = false;
- points.remove(grabbed);
- grabbed = -1;
- update();
- emit_signal("curve_changed");
- accept_event();
- }
+ 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);
+}
- Ref<InputEventMouseButton> mb = p_event;
+void CurveEditor::set_curve(Ref<Curve> curve) {
- if (mb.is_valid() && mb->get_button_index() == 1 && mb->is_pressed()) {
+ if (curve == _curve_ref)
+ return;
- update();
- Ref<Font> font = get_font("font", "Label");
+ 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");
+ }
- int font_h = font->get_height();
+ _curve_ref = curve;
- Vector2 size = get_size();
- size.y -= font_h;
+ 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");
+ }
- Point2 p = Vector2(mb->get_pos().x, mb->get_pos().y) / size;
- p.y = CLAMP(1.0 - p.y, 0, 1) * (max - min) + min;
- grabbed = -1;
- grabbing = true;
+ _selected_point = -1;
+ _hover_point = -1;
+ _selected_tangent = TANGENT_NONE;
- for (int i = 0; i < points.size(); i++) {
+ update();
- Vector2 ps = p * get_size();
- Vector2 pt = Vector2(points[i].offset, points[i].height) * get_size();
- if (ps.distance_to(pt) < 4) {
- grabbed = i;
- }
- }
+ // 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
+}
- //grab or select
- if (grabbed != -1) {
- return;
- }
- //insert
-
- Point np;
- np.offset = p.x;
- np.height = p.y;
-
- points.push_back(np);
- points.sort();
- for (int i = 0; i < points.size(); i++) {
- if (points[i].offset == p.x && points[i].height == p.y) {
- grabbed = i;
- break;
- }
- }
+Size2 CurveEditor::get_minimum_size() const {
+ return Vector2(64, 64);
+}
- emit_signal("curve_changed");
- }
+void CurveEditor::_notification(int p_what) {
+ if (p_what == NOTIFICATION_DRAW)
+ _draw();
+}
- if (mb.is_valid() && mb->get_button_index() == 1 && !mb->is_pressed()) {
+void CurveEditor::on_gui_input(const Ref<InputEvent> &p_event) {
- if (grabbing) {
- grabbing = false;
- emit_signal("curve_changed");
- }
- update();
- }
+ Ref<InputEventMouseButton> mb_ref = p_event;
+ if (mb_ref.is_valid()) {
- Ref<InputEventMouseMotion> mm = p_event;
+ const InputEventMouseButton &mb = **mb_ref;
- if (mm.is_valid() && grabbing && grabbed != -1) {
+ if (mb.is_pressed() && !_dragging) {
- Ref<Font> font = get_font("font", "Label");
- int font_h = font->get_height();
- Vector2 size = get_size();
- size.y -= font_h;
+ Vector2 mpos = mb.get_position();
- Point2 p = mm->get_pos() / size;
- p.y = CLAMP(1.0 - p.y, 0, 1) * (max - min) + min;
- p.x = CLAMP(p.x, 0.0, 1.0);
+ _selected_tangent = get_tangent_at(mpos);
+ if (_selected_tangent == TANGENT_NONE)
+ set_selected_point(get_point_at(mpos));
- bool valid = true;
+ switch (mb.get_button_index()) {
+ case BUTTON_RIGHT:
+ _context_click_pos = mpos;
+ open_context_menu(get_global_transform().xform(mpos));
+ break;
- for (int i = 0; i < points.size(); i++) {
+ case BUTTON_MIDDLE:
+ remove_point(_hover_point);
+ break;
- if (points[i].offset == p.x && points[i].height == p.y && i != grabbed) {
- valid = false;
+ case BUTTON_LEFT:
+ _dragging = true;
+ break;
}
}
- if (!valid)
- return;
+ 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();
- points[grabbed].offset = p.x;
- points[grabbed].height = p.y;
+ 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();
- points.sort();
- for (int i = 0; i < points.size(); i++) {
- if (points[i].offset == p.x && points[i].height == p.y) {
- grabbed = i;
- break;
+ _has_undo_data = false;
}
}
+ }
- emit_signal("curve_changed");
+ Ref<InputEventMouseMotion> mm_ref = p_event;
+ if (mm_ref.is_valid()) {
- update();
- }
-}
+ const InputEventMouseMotion &mm = **mm_ref;
-void CurveTextureEdit::_plot_curve(const Vector2 &p_a, const Vector2 &p_b, const Vector2 &p_c, const Vector2 &p_d) {
+ Vector2 mpos = mm.get_position();
- Ref<Font> font = get_font("font", "Label");
+ if (_dragging && _curve_ref.is_valid()) {
+ Curve &curve = **_curve_ref;
- int font_h = font->get_height();
+ if (_selected_point != -1) {
- float geometry[4][4];
- float tmp1[4][4];
- float tmp2[4][4];
- float deltas[4][4];
- double x, dx, dx2, dx3;
- double y, dy, dy2, dy3;
- double d, d2, d3;
- int lastx, lasty;
- int newx, newy;
- int ntimes;
- int i, j;
+ 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;
+ }
- int xmax = get_size().x;
- int ymax = get_size().y - font_h;
+ if (_selected_tangent == TANGENT_NONE) {
+ // Drag point
- int vsplits = 4;
+ Vector2 point_pos = get_world_pos(mpos);
- int zero_ofs = (1.0 - (0.0 - min) / (max - min)) * ymax;
+ 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);
- draw_line(Vector2(0, zero_ofs), Vector2(xmax, zero_ofs), Color(0.8, 0.8, 0.8, 0.15), 2.0);
+ // 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();
- for (int i = 0; i <= vsplits; i++) {
- float fofs = float(i) / vsplits;
- int yofs = fofs * ymax;
- draw_line(Vector2(xmax, yofs), Vector2(xmax - 4, yofs), Color(0.8, 0.8, 0.8, 0.8), 2.0);
+ curve.set_point_value(_selected_point, point_pos.y);
- String text = rtos((1.0 - fofs) * (max - min) + min);
- int ppos = text.find(".");
- if (ppos != -1) {
- if (text.length() > ppos + 2)
- text = text.substr(0, ppos + 2);
- }
+ } else {
+ // Drag tangent
- int size = font->get_string_size(text).x;
- int xofs = xmax - size - 4;
- yofs -= font_h / 2;
+ Vector2 point_pos = curve.get_point_pos(_selected_point);
+ Vector2 control_pos = get_world_pos(mpos);
- if (yofs < 2) {
- yofs = 2;
- } else if (yofs + font_h > ymax - 2) {
- yofs = ymax - font_h - 2;
- }
+ Vector2 dir = (control_pos - point_pos).normalized();
- draw_string(font, Vector2(xofs, yofs + font->get_ascent()), text, Color(0.8, 0.8, 0.8, 1));
- }
-
- /* construct the geometry matrix from the segment */
- for (i = 0; i < 4; i++) {
- geometry[i][2] = 0;
- geometry[i][3] = 0;
- }
-
- geometry[0][0] = (p_a[0] * xmax);
- geometry[1][0] = (p_b[0] * xmax);
- geometry[2][0] = (p_c[0] * xmax);
- geometry[3][0] = (p_d[0] * xmax);
-
- geometry[0][1] = ((p_a[1] - min) / (max - min) * ymax);
- geometry[1][1] = ((p_b[1] - min) / (max - min) * ymax);
- geometry[2][1] = ((p_c[1] - min) / (max - min) * ymax);
- geometry[3][1] = ((p_d[1] - min) / (max - min) * ymax);
-
- /* subdivide the curve ntimes (1000) times */
- ntimes = 4 * xmax;
- /* ntimes can be adjusted to give a finer or coarser curve */
- d = 1.0 / ntimes;
- d2 = d * d;
- d3 = d * d * d;
-
- /* construct a temporary matrix for determining the forward differencing deltas */
- tmp2[0][0] = 0;
- tmp2[0][1] = 0;
- tmp2[0][2] = 0;
- tmp2[0][3] = 1;
- tmp2[1][0] = d3;
- tmp2[1][1] = d2;
- tmp2[1][2] = d;
- tmp2[1][3] = 0;
- tmp2[2][0] = 6 * d3;
- tmp2[2][1] = 2 * d2;
- tmp2[2][2] = 0;
- tmp2[2][3] = 0;
- tmp2[3][0] = 6 * d3;
- tmp2[3][1] = 0;
- tmp2[3][2] = 0;
- tmp2[3][3] = 0;
-
- /* compose the basis and geometry matrices */
-
- static const float CR_basis[4][4] = {
- { -0.5, 1.5, -1.5, 0.5 },
- { 1.0, -2.5, 2.0, -0.5 },
- { -0.5, 0.0, 0.5, 0.0 },
- { 0.0, 1.0, 0.0, 0.0 },
- };
-
- for (i = 0; i < 4; i++) {
- for (j = 0; j < 4; j++) {
- tmp1[i][j] = (CR_basis[i][0] * geometry[0][j] +
- CR_basis[i][1] * geometry[1][j] +
- CR_basis[i][2] * geometry[2][j] +
- CR_basis[i][3] * geometry[3][j]);
+ 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));
}
}
- /* compose the above results to get the deltas matrix */
- for (i = 0; i < 4; i++) {
- for (j = 0; j < 4; j++) {
- deltas[i][j] = (tmp2[i][0] * tmp1[0][j] +
- tmp2[i][1] * tmp1[1][j] +
- tmp2[i][2] * tmp1[2][j] +
- tmp2[i][3] * tmp1[3][j]);
+ 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);
}
}
+}
- /* extract the x deltas */
- x = deltas[0][0];
- dx = deltas[1][0];
- dx2 = deltas[2][0];
- dx3 = deltas[3][0];
-
- /* extract the y deltas */
- y = deltas[0][1];
- dy = deltas[1][1];
- dy2 = deltas[2][1];
- dy3 = deltas[3][1];
+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;
+ }
- lastx = CLAMP(x, 0, xmax);
- lasty = CLAMP(y, 0, ymax);
+ UndoRedo &ur = *EditorNode::get_singleton()->get_undo_redo();
+ ur.create_action(TTR("Load Curve Preset"));
- /* if (fix255)
- {
- cd->curve[cd->outline][lastx] = lasty;
- }
- else
- {
- cd->curve_ptr[cd->outline][lastx] = lasty;
- if(gb_debug) printf("bender_plot_curve xmax:%d ymax:%d\n", (int)xmax, (int)ymax);
- }
-*/
- /* loop over the curve */
- for (i = 0; i < ntimes; i++) {
- /* increment the x values */
- x += dx;
- dx += dx2;
- dx2 += dx3;
-
- /* increment the y values */
- y += dy;
- dy += dy2;
- dy2 += dy3;
-
- newx = CLAMP((Math::round(x)), 0, xmax);
- newy = CLAMP((Math::round(y)), 0, ymax);
-
- /* if this point is different than the last one...then draw it */
- if ((lastx != newx) || (lasty != newy)) {
-#if 0
- if(fix255)
- {
- /* use fixed array size (for the curve graph) */
- cd->curve[cd->outline][newx] = newy;
- }
- else
- {
- /* use dynamic allocated curve_ptr (for the real curve) */
- cd->curve_ptr[cd->outline][newx] = newy;
+ ur.add_do_method(&curve, "_set_data", curve.get_data());
+ ur.add_undo_method(&curve, "_set_data", previous_data);
- if(gb_debug) printf("outline: %d cX: %d cY: %d\n", (int)cd->outline, (int)newx, (int)newy);
- }
-#endif
- draw_line(Vector2(lastx, ymax - lasty), Vector2(newx, ymax - newy), Color(0.8, 0.8, 0.8, 0.8), 2.0);
- }
+ ur.commit_action();
+}
- lastx = newx;
- lasty = newy;
+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);
}
+}
- int splits = 8;
+void CurveEditor::on_context_menu_item_selected(int action_id) {
+ switch (action_id) {
+ case CONTEXT_ADD_POINT:
+ add_point(_context_click_pos);
+ break;
- draw_line(Vector2(0, ymax - 1), Vector2(xmax, ymax - 1), Color(0.8, 0.8, 0.8, 0.3), 2.0);
+ case CONTEXT_REMOVE_POINT:
+ remove_point(_selected_point);
+ break;
- for (int i = 0; i <= splits; i++) {
- float fofs = float(i) / splits;
- draw_line(Vector2(fofs * xmax, ymax), Vector2(fofs * xmax, ymax - 2), Color(0.8, 0.8, 0.8, 0.8), 2.0);
+ case CONTEXT_LINEAR:
+ toggle_linear();
+ break;
- String text = rtos(fofs);
- int size = font->get_string_size(text).x;
- int ofs = fofs * xmax - size * 0.5;
- if (ofs < 2) {
- ofs = 2;
- } else if (ofs + size > xmax - 2) {
- ofs = xmax - size - 2;
- }
+ case CONTEXT_LEFT_LINEAR:
+ toggle_linear(TANGENT_LEFT);
+ break;
- draw_string(font, Vector2(ofs, ymax + font->get_ascent()), text, Color(0.8, 0.8, 0.8, 1));
+ case CONTEXT_RIGHT_LINEAR:
+ toggle_linear(TANGENT_RIGHT);
+ break;
}
}
-void CurveTextureEdit::_notification(int p_what) {
+void CurveEditor::open_context_menu(Vector2 pos) {
+ _context_menu->set_position(pos);
- if (p_what == NOTIFICATION_DRAW) {
+ _context_menu->clear();
- Ref<Font> font = get_font("font", "Label");
+ if (_curve_ref.is_valid()) {
+ _context_menu->add_item(TTR("Add point"), CONTEXT_ADD_POINT);
- int font_h = font->get_height();
+ if (_selected_point >= 0) {
+ _context_menu->add_item(TTR("Remove point"), CONTEXT_REMOVE_POINT);
- draw_style_box(get_stylebox("bg", "Tree"), Rect2(Point2(), get_size()));
+ if (_selected_tangent != TANGENT_NONE) {
+ _context_menu->add_separator();
- int w = get_size().x;
- int h = get_size().y;
+ _context_menu->add_check_item(TTR("Linear"), CONTEXT_LINEAR);
- Vector2 prev = Vector2(0, 0);
- Vector2 prev2 = Vector2(0, 0);
+ 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;
- for (int i = -1; i < points.size(); i++) {
+ _context_menu->set_item_checked(CONTEXT_LINEAR, is_linear);
- Vector2 next;
- Vector2 next2;
- if (i + 1 >= points.size()) {
- next = Vector2(1, 0);
} else {
- next = Vector2(points[i + 1].offset, points[i + 1].height);
- }
+ _context_menu->add_separator();
- if (i + 2 >= points.size()) {
- next2 = Vector2(1, 0);
- } else {
- next2 = Vector2(points[i + 2].offset, points[i + 2].height);
+ 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);
+ }
}
+ }
- /*if (i==-1 && prev.offset==next.offset) {
- prev=next;
- continue;
- }*/
+ _context_menu->add_separator();
+ }
- _plot_curve(prev2, prev, next, next2);
+ _context_menu->add_submenu_item(TTR("Load preset"), _presets_menu->get_name());
- prev2 = prev;
- prev = next;
- }
+ _context_menu->popup();
+}
- Vector2 size = get_size();
- size.y -= font_h;
- for (int i = 0; i < points.size(); i++) {
+int CurveEditor::get_point_at(Vector2 pos) const {
+ if (_curve_ref.is_null())
+ return -1;
+ const Curve &curve = **_curve_ref;
- Color col = i == grabbed ? Color(1, 0.0, 0.0, 0.9) : Color(1, 1, 1, 0.8);
+ const float r = _hover_radius * _hover_radius;
- float h = (points[i].height - min) / (max - min);
- draw_rect(Rect2(Vector2(points[i].offset, 1.0 - h) * size - Vector2(2, 2), Vector2(5, 5)), col);
+ 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;
+}
- /* if (grabbed!=-1) {
+CurveEditor::TangentIndex CurveEditor::get_tangent_at(Vector2 pos) const {
+ if (_curve_ref.is_null() || _selected_point < 0)
+ return TANGENT_NONE;
- draw_rect(Rect2(total_w+3,0,h,h),points[grabbed].color);
- }
-*/
- if (has_focus()) {
+ 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;
+ }
+ }
- draw_line(Vector2(-1, -1), Vector2(w + 1, -1), Color(1, 1, 1, 0.6));
- draw_line(Vector2(w + 1, -1), Vector2(w + 1, h + 1), Color(1, 1, 1, 0.6));
- draw_line(Vector2(w + 1, h + 1), Vector2(-1, h + 1), Color(1, 1, 1, 0.6));
- draw_line(Vector2(-1, -1), Vector2(-1, h + 1), Color(1, 1, 1, 0.6));
+ 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;
}
-Size2 CurveTextureEdit::get_minimum_size() const {
+void CurveEditor::add_point(Vector2 pos) {
+ ERR_FAIL_COND(_curve_ref.is_null());
- return Vector2(64, 64);
+ 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 CurveTextureEdit::set_range(float p_min, float p_max) {
- max = p_max;
- min = p_min;
- update();
+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 CurveTextureEdit::set_points(const Vector<Vector2> &p_points) {
+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;
- points.clear();
- for (int i = 0; i < p_points.size(); i++) {
- Point p;
- p.offset = p_points[i].x;
- p.height = p_points[i].y;
- points.push_back(p);
+ 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);
}
- points.sort();
- update();
+ ur.commit_action();
+}
+
+void CurveEditor::set_selected_point(int index) {
+ if (index != _selected_point) {
+ _selected_point = index;
+ update();
+ }
}
-Vector<Vector2> CurveTextureEdit::get_points() const {
- Vector<Vector2> ret;
- for (int i = 0; i < points.size(); i++)
- ret.push_back(Vector2(points[i].offset, points[i].height));
- return ret;
+void CurveEditor::set_hover_point_index(int index) {
+ if (index != _hover_point) {
+ _hover_point = index;
+ update();
+ }
}
-void CurveTextureEdit::_bind_methods() {
+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();
+ }
- ClassDB::bind_method(D_METHOD("_gui_input"), &CurveTextureEdit::_gui_input);
+ 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;
- ADD_SIGNAL(MethodInfo("curve_changed"));
+ _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);
}
-CurveTextureEdit::CurveTextureEdit() {
+Vector2 CurveEditor::get_tangent_view_pos(int i, TangentIndex tangent) const {
- grabbed = -1;
- grabbing = false;
- max = 1;
- min = 0;
- set_focus_mode(FOCUS_ALL);
+ 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();
}
-void CurveTextureEditorPlugin::_curve_settings_changed() {
+Vector2 CurveEditor::get_view_pos(Vector2 world_pos) const {
+ return _world_to_view.xform(world_pos);
+}
- if (!curve_texture_ref.is_valid())
- return;
- curve_editor->set_points(Variant(curve_texture_ref->get_points()));
- curve_editor->set_range(curve_texture_ref->get_min(), curve_texture_ref->get_max());
+Vector2 CurveEditor::get_world_pos(Vector2 view_pos) const {
+ return _world_to_view.affine_inverse().xform(view_pos);
}
-CurveTextureEditorPlugin::CurveTextureEditorPlugin(EditorNode *p_node) {
+// 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) {
- editor = p_node;
- curve_editor = memnew(CurveTextureEdit);
+ 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);
- curve_button = editor->add_bottom_panel_item("CurveTexture", curve_editor);
+ } 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;
+ }
- curve_button->hide();
- curve_editor->set_custom_minimum_size(Size2(100, 128 * EDSCALE));
- curve_editor->hide();
- curve_editor->connect("curve_changed", this, "curve_changed");
+ plot_func(prev_pos, b, true);
+ }
+ }
}
-void CurveTextureEditorPlugin::edit(Object *p_object) {
+struct CanvasItemPlotCurve {
- if (curve_texture_ref.is_valid()) {
- curve_texture_ref->disconnect("changed", this, "_curve_settings_changed");
+ 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);
}
- CurveTexture *curve_texture = p_object->cast_to<CurveTexture>();
- if (!curve_texture)
+};
+
+void CurveEditor::_draw() {
+ if (_curve_ref.is_null())
return;
- curve_texture_ref = Ref<CurveTexture>(curve_texture);
- curve_editor->set_points(Variant(curve_texture_ref->get_points()));
- curve_editor->set_range(curve_texture_ref->get_min(), curve_texture_ref->get_max());
- if (!curve_texture_ref->is_connected("changed", this, "_curve_settings_changed")) {
- curve_texture_ref->connect("changed", this, "_curve_settings_changed");
+ 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);
}
}
-bool CurveTextureEditorPlugin::handles(Object *p_object) const {
+// 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);
+}
- return p_object->is_class("CurveTexture");
+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);
}
-void CurveTextureEditorPlugin::make_visible(bool p_visible) {
+//---------------
- if (p_visible) {
- curve_button->show();
- editor->make_bottom_panel_item_visible(curve_editor);
+CurveEditorPlugin::CurveEditorPlugin(EditorNode *p_node) {
+ _editor_node = p_node;
- } else {
+ _view = memnew(CurveEditor);
+ _view->set_custom_minimum_size(Size2(100, 128 * EDSCALE));
+ _view->hide();
- curve_button->hide();
- if (curve_editor->is_visible_in_tree())
- editor->hide_bottom_panel();
- }
+ _toggle_button = _editor_node->add_bottom_panel_item(get_name(), _view);
+ _toggle_button->hide();
+
+ get_resource_previewer()->add_preview_generator(memnew(CurvePreviewGenerator));
}
-void CurveTextureEditorPlugin::_curve_changed() {
+CurveEditorPlugin::~CurveEditorPlugin() {
+}
+
+void CurveEditorPlugin::edit(Object *p_object) {
- if (curve_texture_ref.is_valid()) {
+ Ref<Curve> curve_ref;
- UndoRedo *ur = EditorNode::get_singleton()->get_undo_redo();
+ if (_current_ref.is_valid()) {
+ CurveTexture *ct = _current_ref->cast_to<CurveTexture>();
+ if (ct)
+ ct->disconnect(CoreStringNames::get_singleton()->changed, this, "_curve_texture_changed");
+ }
- Vector<Vector2> points = curve_editor->get_points();
- PoolVector<Vector2> ppoints = Variant(points);
+ 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();
+ }
+ }
+ }
- ur->create_action(TTR("Modify Curve"), UndoRedo::MERGE_ENDS);
- ur->add_do_method(this, "undo_redo_curve_texture", ppoints);
- ur->add_undo_method(this, "undo_redo_curve_texture", curve_texture_ref->get_points());
- ur->commit_action();
+ } else {
+ _current_ref = Ref<Resource>();
}
+
+ _view->set_curve(curve_ref);
}
-void CurveTextureEditorPlugin::_undo_redo_curve_texture(const PoolVector<Vector2> &points) {
+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>();
+}
- curve_texture_ref->set_points(points);
- curve_editor->set_points(Variant(curve_texture_ref->get_points()));
- curve_editor->update();
+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());
+ }
}
-CurveTextureEditorPlugin::~CurveTextureEditorPlugin() {
+void CurveEditorPlugin::_bind_methods() {
+
+ ClassDB::bind_method(D_METHOD("_curve_texture_changed"), &CurveEditorPlugin::_curve_texture_changed);
}
-void CurveTextureEditorPlugin::_bind_methods() {
- ClassDB::bind_method(D_METHOD("curve_changed"), &CurveTextureEditorPlugin::_curve_changed);
- ClassDB::bind_method(D_METHOD("_curve_settings_changed"), &CurveTextureEditorPlugin::_curve_settings_changed);
- ClassDB::bind_method(D_METHOD("undo_redo_curve_texture", "points"), &CurveTextureEditorPlugin::_undo_redo_curve_texture);
+//-----------------------------------
+// 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
index 4e75ba407c..040c298a92 100644
--- a/editor/plugins/curve_editor_plugin.h
+++ b/editor/plugins/curve_editor_plugin.h
@@ -27,69 +27,127 @@
/* 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"
-class CurveTextureEdit : public Control {
+// Edits a y(x) curve
+class CurveEditor : public Control {
+ GDCLASS(CurveEditor, Control)
+public:
+ CurveEditor();
- GDCLASS(CurveTextureEdit, Control);
+ Size2 get_minimum_size() const;
- struct Point {
+ void set_curve(Ref<Curve> curve);
- float offset;
- float height;
- bool operator<(const Point &p_ponit) const {
- return offset < p_ponit.offset;
- }
+ enum PresetID {
+ PRESET_FLAT0 = 0,
+ PRESET_FLAT1,
+ PRESET_LINEAR,
+ PRESET_EASE_IN,
+ PRESET_EASE_OUT,
+ PRESET_SMOOTHSTEP,
+ PRESET_COUNT
};
- bool grabbing;
- int grabbed;
- Vector<Point> points;
- float max, min;
+ enum ContextAction {
+ CONTEXT_ADD_POINT = 0,
+ CONTEXT_REMOVE_POINT,
+ CONTEXT_LINEAR,
+ CONTEXT_LEFT_LINEAR,
+ CONTEXT_RIGHT_LINEAR
+ };
- void _plot_curve(const Vector2 &p_a, const Vector2 &p_b, const Vector2 &p_c, const Vector2 &p_d);
+ enum TangentIndex {
+ TANGENT_NONE = -1,
+ TANGENT_LEFT = 0,
+ TANGENT_RIGHT = 1
+ };
protected:
- void _gui_input(const Ref<InputEvent> &p_event);
void _notification(int p_what);
+
static void _bind_methods();
-public:
- void set_range(float p_min, float p_max);
- void set_points(const Vector<Vector2> &p_points);
- Vector<Vector2> get_points() const;
- virtual Size2 get_minimum_size() const;
- CurveTextureEdit();
-};
+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);
-class CurveTextureEditorPlugin : public EditorPlugin {
+ 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();
- GDCLASS(CurveTextureEditorPlugin, EditorPlugin);
+ 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;
- CurveTextureEdit *curve_editor;
- Ref<CurveTexture> curve_texture_ref;
- EditorNode *editor;
- ToolButton *curve_button;
+ void _draw();
-protected:
- static void _bind_methods();
- void _curve_changed();
- void _undo_redo_curve_texture(const PoolVector<Vector2> &points);
- void _curve_settings_changed();
+ 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:
- virtual String get_name() const { return "CurveTexture"; }
+ CurveEditorPlugin(EditorNode *p_node);
+ ~CurveEditorPlugin();
+
+ String get_name() const { return "Curve"; }
bool has_main_screen() const { return false; }
- virtual void edit(Object *p_node);
- virtual bool handles(Object *p_node) const;
- virtual void make_visible(bool p_visible);
+ void edit(Object *p_object);
+ bool handles(Object *p_object) const;
+ void make_visible(bool p_visible);
- CurveTextureEditorPlugin(EditorNode *p_node);
- ~CurveTextureEditorPlugin();
+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 db8060d591..7f8581535c 100644
--- a/editor/plugins/editor_preview_plugins.cpp
+++ b/editor/plugins/editor_preview_plugins.cpp
@@ -39,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 = GlobalConfig::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;
}
@@ -280,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) \
@@ -364,8 +349,6 @@ EditorMaterialPreviewPlugin::EditorMaterialPreviewPlugin() {
tangents.push_back(1.0); \
}
-
-
ADD_POINT(0);
ADD_POINT(1);
ADD_POINT(2);
@@ -378,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() {
@@ -397,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;
@@ -428,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) {
@@ -795,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);
@@ -905,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 993e36df02..7e7d36eb1e 100644
--- a/editor/plugins/editor_preview_plugins.h
+++ b/editor/plugins/editor_preview_plugins.h
@@ -32,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();
@@ -88,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();
};
@@ -108,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/color_ramp_editor_plugin.cpp b/editor/plugins/gradient_editor_plugin.cpp
index e4172db415..4aaa155cfd 100644
--- a/editor/plugins/color_ramp_editor_plugin.cpp
+++ b/editor/plugins/gradient_editor_plugin.cpp
@@ -27,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);
@@ -44,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) {
- Gradient *color_ramp = p_object->cast_to<Gradient>();
- if (!color_ramp)
+ Gradient *gradient = p_object->cast_to<Gradient>();
+ if (!gradient)
return;
- color_ramp_ref = Ref<Gradient>(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();
@@ -67,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 35446062b5..c319a13a01 100644
--- a/editor/plugins/color_ramp_editor_plugin.h
+++ b/editor/plugins/gradient_editor_plugin.h
@@ -32,21 +32,20 @@
#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<Gradient> 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"; }
@@ -55,8 +54,8 @@ public:
virtual bool handles(Object *p_node) 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/gradient_texture_editor_plugin.cpp b/editor/plugins/gradient_texture_editor_plugin.cpp
deleted file mode 100644
index 40f7de478d..0000000000
--- a/editor/plugins/gradient_texture_editor_plugin.cpp
+++ /dev/null
@@ -1,539 +0,0 @@
-/*************************************************************************/
-/* gradient_texture_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 "gradient_texture_editor_plugin.h"
-
-#include "canvas_item_editor_plugin.h"
-#include "os/keyboard.h"
-#include "scene/resources/default_theme/theme_data.h"
-#include "spatial_editor_plugin.h"
-
-#define POINT_WIDTH 8
-
-GradientTextureEdit::GradientTextureEdit() {
- grabbed = -1;
- grabbing = false;
- set_focus_mode(FOCUS_ALL);
-
- popup = memnew(PopupPanel);
- picker = memnew(ColorPicker);
- popup->add_child(picker);
-
- add_child(popup);
-
- checker = Ref<ImageTexture>(memnew(ImageTexture));
- Ref<Image> checker_bg = memnew(Image(checker_bg_png));
- checker->create_from_image(checker_bg, ImageTexture::FLAG_REPEAT);
-}
-
-int GradientTextureEdit::_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++) {
- //Check if we clicked at point
- if (ABS(x - points[i].offset * total_w + 1) < (POINT_WIDTH / 2 + 1)) {
- result = i;
- }
- }
- return result;
-}
-
-void GradientTextureEdit::_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_position(get_global_position() - Vector2(ms.width - get_size().width, ms.height));
- popup->set_size(ms);
- popup->popup();
-}
-
-GradientTextureEdit::~GradientTextureEdit() {
-}
-
-void GradientTextureEdit::_gui_input(const Ref<InputEvent> &p_event) {
-
- Ref<InputEventKey> k = p_event;
-
- if (k.is_valid() && k->is_pressed() && k->get_scancode() == KEY_DELETE && grabbed != -1) {
-
- points.remove(grabbed);
- grabbed = -1;
- grabbing = false;
- update();
- emit_signal("ramp_changed");
- accept_event();
- }
-
- Ref<InputEventMouseButton> mb = p_event;
- //Show color picker on double click.
- if (mb.is_valid() && mb->get_button_index() == 1 && mb->is_doubleclick() && mb->is_pressed()) {
- grabbed = _get_point_from_pos(mb->get_pos().x);
- _show_color_picker();
- accept_event();
- }
-
- //Delete point on right click
- if (mb.is_valid() && mb->get_button_index() == 2 && mb->is_pressed()) {
- grabbed = _get_point_from_pos(mb->get_pos().x);
- if (grabbed != -1) {
- points.remove(grabbed);
- grabbed = -1;
- grabbing = false;
- update();
- emit_signal("ramp_changed");
- accept_event();
- }
- }
-
- //Hold alt key to duplicate selected color
- if (mb.is_valid() && mb->get_button_index() == 1 && mb->is_pressed() && mb->get_alt()) {
-
- int x = mb->get_pos().x;
- grabbed = _get_point_from_pos(x);
-
- if (grabbed != -1) {
- int total_w = get_size().width - get_size().height - 3;
- GradientTexture::Point newPoint = points[grabbed];
- newPoint.offset = CLAMP(x / float(total_w), 0, 1);
-
- points.push_back(newPoint);
- points.sort();
- for (int i = 0; i < points.size(); ++i) {
- if (points[i].offset == newPoint.offset) {
- grabbed = i;
- break;
- }
- }
-
- emit_signal("ramp_changed");
- update();
- }
- }
-
- if (mb.is_valid() && mb->get_button_index() == 1 && mb->is_pressed()) {
-
- update();
- int x = mb->get_pos().x;
- int total_w = get_size().width - get_size().height - 3;
-
- //Check if color selector was clicked.
- if (x > total_w + 3) {
- _show_color_picker();
- return;
- }
-
- grabbing = true;
-
- grabbed = _get_point_from_pos(x);
- //grab or select
- if (grabbed != -1) {
- return;
- }
-
- //insert
- GradientTexture::Point newPoint;
- newPoint.offset = CLAMP(x / float(total_w), 0, 1);
-
- GradientTexture::Point prev;
- GradientTexture::Point next;
-
- int pos = -1;
- for (int i = 0; i < points.size(); i++) {
- if (points[i].offset < newPoint.offset)
- pos = i;
- }
-
- if (pos == -1) {
-
- prev.color = Color(0, 0, 0);
- prev.offset = 0;
- if (points.size()) {
- next = points[0];
- } else {
- next.color = Color(1, 1, 1);
- next.offset = 1.0;
- }
- } else {
-
- if (pos == points.size() - 1) {
- next.color = Color(1, 1, 1);
- next.offset = 1.0;
- } else {
- next = points[pos + 1];
- }
- prev = points[pos];
- }
-
- newPoint.color = prev.color.linear_interpolate(next.color, (newPoint.offset - prev.offset) / (next.offset - prev.offset));
-
- points.push_back(newPoint);
- points.sort();
- for (int i = 0; i < points.size(); i++) {
- if (points[i].offset == newPoint.offset) {
- grabbed = i;
- break;
- }
- }
-
- emit_signal("ramp_changed");
- }
-
- if (mb.is_valid() && mb->get_button_index() == 1 && !mb->is_pressed()) {
-
- if (grabbing) {
- grabbing = false;
- emit_signal("ramp_changed");
- }
- update();
- }
-
- Ref<InputEventMouseMotion> mm = p_event;
-
- if (mm.is_valid() && grabbing) {
-
- int total_w = get_size().width - get_size().height - 3;
-
- int x = mm->get_pos().x;
- float newofs = CLAMP(x / float(total_w), 0, 1);
-
- //Snap to nearest point if holding shift
- if (mm->get_shift()) {
- float snap_treshhold = 0.03;
- float smallest_ofs = snap_treshhold;
- bool founded = false;
- int nearest_point;
- for (int i = 0; i < points.size(); ++i) {
- if (i != grabbed) {
- float temp_ofs = ABS(points[i].offset - newofs);
- if (temp_ofs < smallest_ofs) {
- smallest_ofs = temp_ofs;
- nearest_point = i;
- if (founded)
- break;
- founded = true;
- }
- }
- }
- if (founded) {
- if (points[nearest_point].offset < newofs)
- newofs = points[nearest_point].offset + 0.00001;
- else
- newofs = points[nearest_point].offset - 0.00001;
- newofs = CLAMP(newofs, 0, 1);
- }
- }
-
- bool valid = true;
- for (int i = 0; i < points.size(); i++) {
-
- if (points[i].offset == newofs && i != grabbed) {
- valid = false;
- }
- }
-
- if (!valid)
- return;
-
- points[grabbed].offset = newofs;
-
- points.sort();
- for (int i = 0; i < points.size(); i++) {
- if (points[i].offset == newofs) {
- grabbed = i;
- break;
- }
- }
-
- emit_signal("ramp_changed");
-
- update();
- }
-}
-
-void GradientTextureEdit::_notification(int p_what) {
-
- if (p_what == NOTIFICATION_ENTER_TREE) {
- if (!picker->is_connected("color_changed", this, "_color_changed")) {
- picker->connect("color_changed", this, "_color_changed");
- }
- }
- if (p_what == NOTIFICATION_DRAW) {
-
- int w = get_size().x;
- int h = get_size().y;
-
- if (w == 0 || h == 0)
- return; //Safety check. We have division by 'h'. And in any case there is nothing to draw with such size
-
- int total_w = get_size().width - get_size().height - 3;
-
- //Draw checker pattern for ramp
- _draw_checker(0, 0, total_w, h);
-
- //Draw color ramp
- GradientTexture::Point prev;
- prev.offset = 0;
- if (points.size() == 0)
- prev.color = Color(0, 0, 0); //Draw black rectangle if we have no points
- else
- prev.color = points[0].color; //Extend color of first point to the beginning.
-
- for (int i = -1; i < points.size(); i++) {
-
- GradientTexture::Point next;
- //If there is no next point
- if (i + 1 == points.size()) {
- if (points.size() == 0)
- next.color = Color(0, 0, 0); //Draw black rectangle if we have no points
- else
- next.color = points[i].color; //Extend color of last point to the end.
- next.offset = 1;
- } else {
- next = points[i + 1];
- }
-
- if (prev.offset == next.offset) {
- prev = next;
- continue;
- }
-
- Vector<Vector2> points;
- Vector<Color> colors;
- points.push_back(Vector2(prev.offset * total_w, h));
- points.push_back(Vector2(prev.offset * total_w, 0));
- points.push_back(Vector2(next.offset * total_w, 0));
- points.push_back(Vector2(next.offset * total_w, h));
- colors.push_back(prev.color);
- colors.push_back(prev.color);
- colors.push_back(next.color);
- colors.push_back(next.color);
- draw_primitive(points, colors, Vector<Point2>());
- prev = next;
- }
-
- //Draw point markers
- for (int i = 0; i < points.size(); i++) {
-
- Color col = i == grabbed ? Color(1, 0.0, 0.0, 0.9) : points[i].color.contrasted();
- col.a = 0.9;
-
- draw_line(Vector2(points[i].offset * total_w, 0), Vector2(points[i].offset * total_w, h / 2), col);
- draw_rect(Rect2(points[i].offset * total_w - POINT_WIDTH / 2, h / 2, POINT_WIDTH, h / 2), Color(0.6, 0.6, 0.6, i == grabbed ? 0.9 : 0.4));
- draw_line(Vector2(points[i].offset * total_w - POINT_WIDTH / 2, h / 2), Vector2(points[i].offset * total_w - POINT_WIDTH / 2, h - 1), col);
- draw_line(Vector2(points[i].offset * total_w + POINT_WIDTH / 2, h / 2), Vector2(points[i].offset * total_w + POINT_WIDTH / 2, h - 1), col);
- draw_line(Vector2(points[i].offset * total_w - POINT_WIDTH / 2, h / 2), Vector2(points[i].offset * total_w + POINT_WIDTH / 2, h / 2), col);
- draw_line(Vector2(points[i].offset * total_w - POINT_WIDTH / 2, h - 1), Vector2(points[i].offset * total_w + POINT_WIDTH / 2, h - 1), col);
- }
-
- //Draw "button" for color selector
- _draw_checker(total_w + 3, 0, h, h);
- if (grabbed != -1) {
- //Draw with selection color
- draw_rect(Rect2(total_w + 3, 0, h, h), points[grabbed].color);
- } else {
- //if no color selected draw grey color with 'X' on top.
- draw_rect(Rect2(total_w + 3, 0, h, h), Color(0.5, 0.5, 0.5, 1));
- draw_line(Vector2(total_w + 3, 0), Vector2(total_w + 3 + h, h), Color(1, 1, 1, 0.6));
- draw_line(Vector2(total_w + 3, h), Vector2(total_w + 3 + h, 0), Color(1, 1, 1, 0.6));
- }
-
- //Draw borders around color ramp if in focus
- if (has_focus()) {
-
- draw_line(Vector2(-1, -1), Vector2(total_w + 1, -1), Color(1, 1, 1, 0.6));
- draw_line(Vector2(total_w + 1, -1), Vector2(total_w + 1, h + 1), Color(1, 1, 1, 0.6));
- draw_line(Vector2(total_w + 1, h + 1), Vector2(-1, h + 1), Color(1, 1, 1, 0.6));
- draw_line(Vector2(-1, -1), Vector2(-1, h + 1), Color(1, 1, 1, 0.6));
- }
- }
-}
-
-void GradientTextureEdit::_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));
- backPoints.push_back(Vector2(x, y + h));
- backPoints.push_back(Vector2(x + w, y + h));
- backPoints.push_back(Vector2(x + w, y));
- Vector<Color> colorPoints;
- colorPoints.push_back(Color(1, 1, 1, 1));
- colorPoints.push_back(Color(1, 1, 1, 1));
- colorPoints.push_back(Color(1, 1, 1, 1));
- colorPoints.push_back(Color(1, 1, 1, 1));
- Vector<Vector2> uvPoints;
- //Draw checker pattern pixel-perfect and scale it by 2.
- uvPoints.push_back(Vector2(x, y));
- uvPoints.push_back(Vector2(x, y + h * .5f / checker->get_height()));
- uvPoints.push_back(Vector2(x + w * .5f / checker->get_width(), y + h * .5f / checker->get_height()));
- uvPoints.push_back(Vector2(x + w * .5f / checker->get_width(), y));
- draw_polygon(backPoints, colorPoints, uvPoints, checker);
-}
-
-Size2 GradientTextureEdit::get_minimum_size() const {
-
- return Vector2(0, 16);
-}
-
-void GradientTextureEdit::_color_changed(const Color &p_color) {
-
- if (grabbed == -1)
- return;
- points[grabbed].color = p_color;
- update();
- emit_signal("ramp_changed");
-}
-
-void GradientTextureEdit::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++) {
- GradientTexture::Point p;
- p.offset = p_offsets[i];
- p.color = p_colors[i];
- points.push_back(p);
- }
-
- points.sort();
- update();
-}
-
-Vector<float> GradientTextureEdit::get_offsets() const {
- Vector<float> ret;
- for (int i = 0; i < points.size(); i++)
- ret.push_back(points[i].offset);
- return ret;
-}
-
-Vector<Color> GradientTextureEdit::get_colors() const {
- Vector<Color> ret;
- for (int i = 0; i < points.size(); i++)
- ret.push_back(points[i].color);
- return ret;
-}
-
-void GradientTextureEdit::set_points(Vector<GradientTexture::Point> &p_points) {
- if (points.size() != p_points.size())
- grabbed = -1;
- points.clear();
- points = p_points;
-}
-
-Vector<GradientTexture::Point> &GradientTextureEdit::get_points() {
- return points;
-}
-
-void GradientTextureEdit::_bind_methods() {
- ClassDB::bind_method(D_METHOD("_gui_input"), &GradientTextureEdit::_gui_input);
- ClassDB::bind_method(D_METHOD("_color_changed"), &GradientTextureEdit::_color_changed);
- ADD_SIGNAL(MethodInfo("ramp_changed"));
-}
-
-GradientTextureEditorPlugin::GradientTextureEditorPlugin(EditorNode *p_node) {
-
- editor = p_node;
- ramp_editor = memnew(GradientTextureEdit);
-
- gradient_button = editor->add_bottom_panel_item("GradientTexture", ramp_editor);
-
- gradient_button->hide();
- ramp_editor->set_custom_minimum_size(Size2(100, 100 * EDSCALE));
- ramp_editor->hide();
- ramp_editor->connect("ramp_changed", this, "ramp_changed");
-}
-
-void GradientTextureEditorPlugin::edit(Object *p_object) {
-
- GradientTexture *gradient_texture = p_object->cast_to<GradientTexture>();
- if (!gradient_texture)
- return;
- gradient_texture_ref = Ref<GradientTexture>(gradient_texture);
- ramp_editor->set_points(gradient_texture_ref->get_points());
-}
-
-bool GradientTextureEditorPlugin::handles(Object *p_object) const {
-
- return p_object->is_class("GradientTexture");
-}
-
-void GradientTextureEditorPlugin::make_visible(bool p_visible) {
-
- if (p_visible) {
- gradient_button->show();
- editor->make_bottom_panel_item_visible(ramp_editor);
-
- } else {
-
- gradient_button->hide();
- if (ramp_editor->is_visible_in_tree())
- editor->hide_bottom_panel();
- }
-}
-
-void GradientTextureEditorPlugin::_ramp_changed() {
-
- if (gradient_texture_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 = gradient_texture_ref->get_offsets();
- Vector<Color> old_colors = gradient_texture_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_gradient_texture", new_offsets, new_colors);
- ur->add_undo_method(this, "undo_redo_gradient_texture", old_offsets, old_colors);
- ur->commit_action();
-
- //gradient_texture_ref->set_points(ramp_editor->get_points());
- }
-}
-
-void GradientTextureEditorPlugin::_undo_redo_gradient_texture(const Vector<float> &offsets,
- const Vector<Color> &colors) {
-
- gradient_texture_ref->set_offsets(offsets);
- gradient_texture_ref->set_colors(colors);
- ramp_editor->set_points(gradient_texture_ref->get_points());
- ramp_editor->update();
-}
-
-GradientTextureEditorPlugin::~GradientTextureEditorPlugin() {
-}
-
-void GradientTextureEditorPlugin::_bind_methods() {
- ClassDB::bind_method(D_METHOD("ramp_changed"), &GradientTextureEditorPlugin::_ramp_changed);
- ClassDB::bind_method(D_METHOD("undo_redo_gradient_texture", "offsets", "colors"), &GradientTextureEditorPlugin::_undo_redo_gradient_texture);
-}
diff --git a/editor/plugins/gradient_texture_editor_plugin.h b/editor/plugins/gradient_texture_editor_plugin.h
deleted file mode 100644
index 842d586541..0000000000
--- a/editor/plugins/gradient_texture_editor_plugin.h
+++ /dev/null
@@ -1,98 +0,0 @@
-/*************************************************************************/
-/* gradient_texture_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 GRADIENT_TEXTURE_EDITOR_PLUGIN_H
-#define GRADIENT_TEXTURE_EDITOR_PLUGIN_H
-
-#include "editor/editor_node.h"
-#include "editor/editor_plugin.h"
-#include "scene/resources/texture.h"
-
-class GradientTextureEdit : public Control {
-
- GDCLASS(GradientTextureEdit, Control);
-
- PopupPanel *popup;
- ColorPicker *picker;
-
- Ref<ImageTexture> checker;
-
- bool grabbing;
- int grabbed;
- Vector<GradientTexture::Point> points;
-
- void _draw_checker(int x, int y, int w, int h);
- void _color_changed(const Color &p_color);
- int _get_point_from_pos(int x);
- void _show_color_picker();
-
-protected:
- void _gui_input(const Ref<InputEvent> &p_event);
- void _notification(int p_what);
- static void _bind_methods();
-
-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<GradientTexture::Point> &p_points);
- Vector<GradientTexture::Point> &get_points();
- virtual Size2 get_minimum_size() const;
-
- GradientTextureEdit();
- virtual ~GradientTextureEdit();
-};
-
-class GradientTextureEditorPlugin : public EditorPlugin {
-
- GDCLASS(GradientTextureEditorPlugin, EditorPlugin);
-
- bool _2d;
- Ref<GradientTexture> gradient_texture_ref;
- GradientTextureEdit *ramp_editor;
- EditorNode *editor;
- ToolButton *gradient_button;
-
-protected:
- static void _bind_methods();
- void _ramp_changed();
- void _undo_redo_gradient_texture(const Vector<float> &offsets, const Vector<Color> &colors);
-
-public:
- virtual String get_name() const { return "GradientTexture"; }
- bool has_main_screen() const { return false; }
- virtual void edit(Object *p_node);
- virtual bool handles(Object *p_node) const;
- virtual void make_visible(bool p_visible);
-
- GradientTextureEditorPlugin(EditorNode *p_node);
- ~GradientTextureEditorPlugin();
-};
-
-#endif // GRADIENT_TEXTURE_EDITOR_PLUGIN_H
diff --git a/editor/plugins/item_list_editor_plugin.cpp b/editor/plugins/item_list_editor_plugin.cpp
index 7f56286f08..f567abc5b1 100644
--- a/editor/plugins/item_list_editor_plugin.cpp
+++ b/editor/plugins/item_list_editor_plugin.cpp
@@ -193,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;
+}
+
+///////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////
@@ -373,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 042e88839f..4fed8e49f5 100644
--- a/editor/plugins/item_list_editor_plugin.h
+++ b/editor/plugins/item_list_editor_plugin.h
@@ -167,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);
diff --git a/editor/plugins/light_occluder_2d_editor_plugin.cpp b/editor/plugins/light_occluder_2d_editor_plugin.cpp
index 9c9e010b47..a7a20e71fe 100644
--- a/editor/plugins/light_occluder_2d_editor_plugin.cpp
+++ b/editor/plugins/light_occluder_2d_editor_plugin.cpp
@@ -118,7 +118,7 @@ bool LightOccluder2DEditor::forward_gui_input(const Ref<InputEvent> &p_event) {
Transform2D xform = canvas_item_editor->get_canvas_transform() * node->get_global_transform();
- Vector2 gpoint = mb->get_pos();
+ 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);
@@ -126,7 +126,7 @@ bool LightOccluder2DEditor::forward_gui_input(const Ref<InputEvent> &p_event) {
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);
+ real_t grab_threshold = EDITOR_DEF("editors/poly_editor/point_grab_radius", 8);
switch (mode) {
@@ -145,12 +145,12 @@ bool LightOccluder2DEditor::forward_gui_input(const Ref<InputEvent> &p_event) {
return true;
} else {
- if (wip.size() > 1 && xform.xform(wip[0]).distance_to(gpoint) < grab_treshold) {
+ 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) {
+ } else if (wip.size() > 1 && xform.xform(wip[wip.size() - 1]).distance_to(gpoint) < grab_threshold) {
//wip closed
_wip_close(false);
return true;
@@ -204,7 +204,7 @@ bool LightOccluder2DEditor::forward_gui_input(const Ref<InputEvent> &p_event) {
continue; //not valid to reuse point
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;
@@ -233,7 +233,7 @@ bool LightOccluder2DEditor::forward_gui_input(const Ref<InputEvent> &p_event) {
Vector2 cp = xform.xform(poly[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;
@@ -278,7 +278,7 @@ bool LightOccluder2DEditor::forward_gui_input(const Ref<InputEvent> &p_event) {
Vector2 cp = xform.xform(poly[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;
@@ -308,7 +308,7 @@ bool LightOccluder2DEditor::forward_gui_input(const Ref<InputEvent> &p_event) {
if (edited_point != -1 && (wip_active || mm->get_button_mask() & BUTTON_MASK_LEFT)) {
- Vector2 gpoint = mm->get_pos();
+ 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);
diff --git a/editor/plugins/line_2d_editor_plugin.cpp b/editor/plugins/line_2d_editor_plugin.cpp
index 3497af3602..4a7ad74fbe 100644
--- a/editor/plugins/line_2d_editor_plugin.cpp
+++ b/editor/plugins/line_2d_editor_plugin.cpp
@@ -62,12 +62,12 @@ Vector2 Line2DEditor::mouse_to_local_pos(Vector2 gpoint, bool alt) {
int Line2DEditor::get_point_index_at(Vector2 gpos) {
ERR_FAIL_COND_V(node == 0, -1);
- real_t grab_treshold = EDITOR_DEF("editors/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;
}
}
@@ -87,7 +87,7 @@ bool Line2DEditor::forward_gui_input(const Ref<InputEvent> &p_event) {
if (mb.is_valid()) {
- Vector2 gpoint = mb->get_pos();
+ Vector2 gpoint = mb->get_position();
Vector2 cpoint = mouse_to_local_pos(gpoint, mb->get_alt());
if (mb->is_pressed() && _dragging == false) {
@@ -146,7 +146,7 @@ bool Line2DEditor::forward_gui_input(const Ref<InputEvent> &p_event) {
if (mm.is_valid()) {
if (_dragging) {
- Vector2 cpoint = mouse_to_local_pos(mm->get_pos(), mm->get_alt());
+ 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;
diff --git a/editor/plugins/navigation_polygon_editor_plugin.cpp b/editor/plugins/navigation_polygon_editor_plugin.cpp
index a7fc1d5adb..725e57fe0b 100644
--- a/editor/plugins/navigation_polygon_editor_plugin.cpp
+++ b/editor/plugins/navigation_polygon_editor_plugin.cpp
@@ -134,13 +134,13 @@ bool NavigationPolygonEditor::forward_gui_input(const Ref<InputEvent> &p_event)
Transform2D xform = canvas_item_editor->get_canvas_transform() * node->get_global_transform();
- Vector2 gpoint = mb->get_pos();
+ 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);
//first check if a point is to be added (segment split)
- real_t grab_treshold = EDITOR_DEF("editors/poly_editor/point_grab_radius", 8);
+ real_t grab_threshold = EDITOR_DEF("editors/poly_editor/point_grab_radius", 8);
switch (mode) {
@@ -160,7 +160,7 @@ bool NavigationPolygonEditor::forward_gui_input(const Ref<InputEvent> &p_event)
return true;
} else {
- if (wip.size() > 1 && xform.xform(wip[0]).distance_to(gpoint) < grab_treshold) {
+ if (wip.size() > 1 && xform.xform(wip[0]).distance_to(gpoint) < grab_threshold) {
//wip closed
_wip_close();
@@ -211,7 +211,7 @@ bool NavigationPolygonEditor::forward_gui_input(const Ref<InputEvent> &p_event)
continue; //not valid to reuse point
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_outline = j;
closest_pos = cp;
@@ -252,7 +252,7 @@ bool NavigationPolygonEditor::forward_gui_input(const Ref<InputEvent> &p_event)
Vector2 cp = xform.xform(poly[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_outline = j;
@@ -312,7 +312,7 @@ bool NavigationPolygonEditor::forward_gui_input(const Ref<InputEvent> &p_event)
Vector2 cp = xform.xform(poly[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_outline = j;
@@ -361,7 +361,7 @@ bool NavigationPolygonEditor::forward_gui_input(const Ref<InputEvent> &p_event)
if (edited_point != -1 && (wip_active || mm->get_button_mask() & BUTTON_MASK_LEFT)) {
- Vector2 gpoint = mm->get_pos();
+ 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);
diff --git a/editor/plugins/particles_2d_editor_plugin.cpp b/editor/plugins/particles_2d_editor_plugin.cpp
index c6c85d8be2..a759e5892f 100644
--- a/editor/plugins/particles_2d_editor_plugin.cpp
+++ b/editor/plugins/particles_2d_editor_plugin.cpp
@@ -31,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) {
@@ -62,78 +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));
+
+ 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(p_file, img);
- ERR_EXPLAIN(TTR("Error loading image:") + " " + p_file);
+ 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);
+ 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);
+
+ } else {
- uint8_t a = r[i * 2 + 1];
- if (a > 128) {
- valid_positions[vpc++] = Point2i(i % s.width, i / s.width);
+ 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) {
@@ -150,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) {
@@ -165,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);
@@ -185,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 e532157c35..cea60fbeaf 100644
--- a/editor/plugins/particles_2d_editor_plugin.h
+++ b/editor/plugins/particles_2d_editor_plugin.h
@@ -44,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;
@@ -58,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);
diff --git a/editor/plugins/particles_editor_plugin.cpp b/editor/plugins/particles_editor_plugin.cpp
index dc2da80b06..d918a3e24e 100644
--- a/editor/plugins/particles_editor_plugin.cpp
+++ b/editor/plugins/particles_editor_plugin.cpp
@@ -254,7 +254,7 @@ void ParticlesEditor::_generate_emission_points() {
for (int j = 0; j < 3; j++) {
if (i == 0 && j == 0)
- aabb.pos = r[i].vertex[j];
+ aabb.position = r[i].vertex[j];
else
aabb.expand_to(r[i].vertex[j]);
}
@@ -272,7 +272,7 @@ void ParticlesEditor::_generate_emission_points() {
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;
+ ofs += aabb.position;
Vector3 ofsv = ofs + aabb.size * dir;
diff --git a/editor/plugins/path_2d_editor_plugin.cpp b/editor/plugins/path_2d_editor_plugin.cpp
index 73d5b28886..f9f16fea16 100644
--- a/editor/plugins/path_2d_editor_plugin.cpp
+++ b/editor/plugins/path_2d_editor_plugin.cpp
@@ -74,7 +74,7 @@ bool Path2DEditor::forward_gui_input(const Ref<InputEvent> &p_event) {
Transform2D xform = canvas_item_editor->get_canvas_transform() * node->get_global_transform();
- Vector2 gpoint = mb->get_pos();
+ Vector2 gpoint = mb->get_position();
Vector2 cpoint =
!mb->get_alt() ?
canvas_item_editor->snap_point(xform.affine_inverse().xform(gpoint)) :
@@ -431,7 +431,7 @@ bool Path2DEditor::forward_gui_input(const Ref<InputEvent> &p_event) {
if (action != ACTION_NONE) {
// Handle point/control movement.
Transform2D xform = canvas_item_editor->get_canvas_transform() * node->get_global_transform();
- Vector2 gpoint = mm->get_pos();
+ Vector2 gpoint = mm->get_position();
Vector2 cpoint =
!mm->get_alt() ?
canvas_item_editor->snap_point(xform.affine_inverse().xform(gpoint)) :
diff --git a/editor/plugins/path_editor_plugin.cpp b/editor/plugins/path_editor_plugin.cpp
index 20535d796e..3524c34d62 100644
--- a/editor/plugins/path_editor_plugin.cpp
+++ b/editor/plugins/path_editor_plugin.cpp
@@ -104,7 +104,7 @@ void PathSpatialGizmo::set_handle(int p_idx, Camera *p_camera, const Point2 &p_p
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);
@@ -285,7 +285,7 @@ bool PathEditorPlugin::forward_spatial_gui_input(Camera *p_camera, const Ref<Inp
if (mb.is_valid()) {
- Point2 mbpos(mb->get_pos().x, mb->get_pos().y);
+ Point2 mbpos(mb->get_position().x, mb->get_position().y);
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
diff --git a/editor/plugins/polygon_2d_editor_plugin.cpp b/editor/plugins/polygon_2d_editor_plugin.cpp
index c2edc608ab..24ccdcd445 100644
--- a/editor/plugins/polygon_2d_editor_plugin.cpp
+++ b/editor/plugins/polygon_2d_editor_plugin.cpp
@@ -212,7 +212,7 @@ bool Polygon2DEditor::forward_gui_input(const Ref<InputEvent> &p_event) {
Transform2D xform = canvas_item_editor->get_canvas_transform() * node->get_global_transform();
- Vector2 gpoint = mb->get_pos();
+ 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);
@@ -220,7 +220,7 @@ bool Polygon2DEditor::forward_gui_input(const Ref<InputEvent> &p_event) {
Vector<Vector2> poly = Variant(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);
+ real_t grab_threshold = EDITOR_DEF("editors/poly_editor/point_grab_radius", 8);
switch (mode) {
@@ -239,7 +239,7 @@ bool Polygon2DEditor::forward_gui_input(const Ref<InputEvent> &p_event) {
return true;
} else {
- if (wip.size() > 1 && xform.xform(wip[0] + node->get_offset()).distance_to(gpoint) < grab_treshold) {
+ if (wip.size() > 1 && xform.xform(wip[0] + node->get_offset()).distance_to(gpoint) < grab_threshold) {
//wip closed
_wip_close();
@@ -293,7 +293,7 @@ bool Polygon2DEditor::forward_gui_input(const Ref<InputEvent> &p_event) {
continue; //not valid to reuse point
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;
@@ -322,7 +322,7 @@ bool Polygon2DEditor::forward_gui_input(const Ref<InputEvent> &p_event) {
Vector2 cp = xform.xform(poly[i] + node->get_offset());
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;
@@ -367,7 +367,7 @@ bool Polygon2DEditor::forward_gui_input(const Ref<InputEvent> &p_event) {
Vector2 cp = xform.xform(poly[i] + node->get_offset());
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;
@@ -397,7 +397,7 @@ bool Polygon2DEditor::forward_gui_input(const Ref<InputEvent> &p_event) {
if (edited_point != -1 && (wip_active || mm->get_button_mask() & BUTTON_MASK_LEFT)) {
- Vector2 gpoint = mm->get_pos();
+ 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);
@@ -465,7 +465,7 @@ void Polygon2DEditor::_uv_input(const Ref<InputEvent> &p_input) {
if (mb->is_pressed()) {
- uv_drag_from = Vector2(mb->get_pos().x, mb->get_pos().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;
@@ -485,7 +485,7 @@ void Polygon2DEditor::_uv_input(const Ref<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->get_pos().x, mb->get_pos().y)) < 8) {
+ if (tuv.distance_to(Vector2(mb->get_position().x, mb->get_position().y)) < 8) {
uv_drag_from = tuv;
uv_drag_index = i;
}
@@ -537,7 +537,7 @@ void Polygon2DEditor::_uv_input(const Ref<InputEvent> &p_input) {
} else if (uv_drag) {
- Vector2 uv_drag_to = mm->get_pos();
+ 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) {
@@ -675,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/script_editor_plugin.cpp b/editor/plugins/script_editor_plugin.cpp
index fde6d83aa8..dc2eddda39 100644
--- a/editor/plugins/script_editor_plugin.cpp
+++ b/editor/plugins/script_editor_plugin.cpp
@@ -313,6 +313,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;
@@ -410,7 +417,9 @@ 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) {
@@ -500,9 +509,8 @@ void ScriptEditor::_close_tab(int p_idx, bool p_save) {
if (p_save) {
apply_scripts();
}
- if (current->get_edit_menu()) {
- memdelete(current->get_edit_menu());
- }
+ current->clear_edit_menu();
+
} else {
EditorHelp *help = tab_container->get_child(selected)->cast_to<EditorHelp>();
_add_recent_script(help->get_class());
@@ -540,6 +548,7 @@ void ScriptEditor::_close_tab(int p_idx, bool p_save) {
_update_history_arrows();
_update_script_names();
+ _update_members_overview_visibility();
_save_layout();
}
@@ -863,6 +872,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();
@@ -1025,6 +1042,7 @@ void ScriptEditor::_notification(int p_what) {
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");
{
@@ -1273,6 +1291,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
@@ -1342,6 +1370,37 @@ struct _ScriptEditorItemData {
}
};
+void ScriptEditor::_update_members_overview_visibility() {
+ 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();
+
+ 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");
@@ -1485,6 +1544,7 @@ void ScriptEditor::_update_script_names() {
}
}
+ _update_members_overview();
_update_script_colors();
}
@@ -1499,13 +1559,10 @@ bool ScriptEditor::edit(const Ref<Script> &p_script, int p_line, int p_col, bool
bool open_dominant = EditorSettings::get_singleton()->get("text_editor/files/open_dominant_script_on_scene_change");
- Error err = p_script->get_language()->open_in_external_editor(p_script, p_line >= 0 ? p_line : 0, p_col);
- if (err == OK)
- return false;
- if (err != ERR_UNAVAILABLE)
- WARN_PRINT("Couldn't open in custom external text editor");
-
- 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");
@@ -1733,6 +1790,9 @@ void ScriptEditor::_editor_settings_changed() {
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);
@@ -1827,6 +1887,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);
}
@@ -2084,6 +2147,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);
@@ -2105,6 +2169,7 @@ 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;
menu_hb = memnew(HBoxContainer);
@@ -2114,10 +2179,21 @@ ScriptEditor::ScriptEditor(EditorNode *p_editor) {
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"));
@@ -2162,6 +2238,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);
@@ -2184,6 +2262,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);
diff --git a/editor/plugins/script_editor_plugin.h b/editor/plugins/script_editor_plugin.h
index 455a888f0e..7f17365931 100644
--- a/editor/plugins/script_editor_plugin.h
+++ b/editor/plugins/script_editor_plugin.h
@@ -102,8 +102,11 @@ public:
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() {}
};
@@ -131,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,
@@ -139,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,
@@ -179,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;
@@ -278,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);
@@ -354,6 +365,8 @@ public:
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);
diff --git a/editor/plugins/script_text_editor.cpp b/editor/plugins/script_text_editor.cpp
index 2d3a14e525..83741c7fb8 100644
--- a/editor/plugins/script_text_editor.cpp
+++ b/editor/plugins/script_text_editor.cpp
@@ -218,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();
@@ -553,6 +557,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();
@@ -1087,6 +1093,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();
@@ -1236,8 +1246,8 @@ void ScriptTextEditor::_text_edit_gui_input(const Ref<InputEvent> &ev) {
int col, row;
TextEdit *tx = code_editor->get_text_edit();
- tx->_get_mouse_pos(mb->get_global_pos() - tx->get_global_position(), row, col);
- Vector2 mpos = mb->get_global_pos() - tx->get_global_position();
+ 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) {
diff --git a/editor/plugins/script_text_editor.h b/editor/plugins/script_text_editor.h
index fdae03949c..e55847832f 100644
--- a/editor/plugins/script_text_editor.h
+++ b/editor/plugins/script_text_editor.h
@@ -149,12 +149,14 @@ public:
virtual void add_callback(const String &p_function, PoolStringArray p_args);
virtual void update_settings();
+ 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 8ae7d55bdd..bad88979ac 100644
--- a/editor/plugins/shader_editor_plugin.cpp
+++ b/editor/plugins/shader_editor_plugin.cpp
@@ -188,7 +188,7 @@ void ShaderTextEditor::_validate_script() {
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++)
@@ -552,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_graph_editor_plugin.cpp b/editor/plugins/shader_graph_editor_plugin.cpp
index 9c65ef667a..5506c035ec 100644
--- a/editor/plugins/shader_graph_editor_plugin.cpp
+++ b/editor/plugins/shader_graph_editor_plugin.cpp
@@ -1382,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);
diff --git a/editor/plugins/spatial_editor_plugin.cpp b/editor/plugins/spatial_editor_plugin.cpp
index ff4b5e430e..995d13f6a8 100644
--- a/editor/plugins/spatial_editor_plugin.cpp
+++ b/editor/plugins/spatial_editor_plugin.cpp
@@ -636,7 +636,7 @@ void SpatialEditorViewport::_smouseenter() {
void SpatialEditorViewport::_list_select(Ref<InputEventMouseButton> b) {
- _find_items_at_pos(b->get_pos(), clicked_includes_current, selection_results, b->get_shift());
+ _find_items_at_pos(b->get_position(), clicked_includes_current, selection_results, b->get_shift());
Node *scene = editor->get_edited_scene();
@@ -684,7 +684,7 @@ void SpatialEditorViewport::_list_select(Ref<InputEventMouseButton> b) {
selection_menu->set_item_tooltip(i, String(spat->get_name()) + "\nType: " + spat->get_class() + "\nPath: " + node_path);
}
- selection_menu->set_global_position(b->get_global_pos());
+ 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();
@@ -696,12 +696,19 @@ void SpatialEditorViewport::_sinput(const Ref<InputEvent> &p_event) {
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;
}
@@ -768,6 +775,11 @@ void SpatialEditorViewport::_sinput(const Ref<InputEvent> &p_event) {
}
freelook_active = b->is_pressed();
+ 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();
+ }
} break;
case BUTTON_MIDDLE: {
@@ -818,7 +830,7 @@ void SpatialEditorViewport::_sinput(const Ref<InputEvent> &p_event) {
break;
}
- _edit.mouse_pos = b->get_pos();
+ _edit.mouse_pos = b->get_position();
_edit.snap = false;
_edit.mode = TRANSFORM_NONE;
@@ -863,7 +875,7 @@ void SpatialEditorViewport::_sinput(const Ref<InputEvent> &p_event) {
break; //bye
//handle rotate
_edit.mode = TRANSFORM_ROTATE;
- _compute_edit(b->get_pos());
+ _compute_edit(b->get_position());
break;
}
@@ -873,7 +885,7 @@ void SpatialEditorViewport::_sinput(const Ref<InputEvent> &p_event) {
break; //bye
//handle rotate
_edit.mode = TRANSFORM_TRANSLATE;
- _compute_edit(b->get_pos());
+ _compute_edit(b->get_position());
break;
}
@@ -883,7 +895,7 @@ void SpatialEditorViewport::_sinput(const Ref<InputEvent> &p_event) {
break; //bye
//handle rotate
_edit.mode = TRANSFORM_SCALE;
- _compute_edit(b->get_pos());
+ _compute_edit(b->get_position());
break;
}
@@ -891,7 +903,7 @@ void SpatialEditorViewport::_sinput(const Ref<InputEvent> &p_event) {
int gizmo_handle = -1;
- clicked = _select_ray(b->get_pos(), b->get_shift(), clicked_includes_current, &gizmo_handle, b->get_shift());
+ clicked = _select_ray(b->get_position(), b->get_shift(), clicked_includes_current, &gizmo_handle, b->get_shift());
//clicking is always deferred to either move or release
@@ -904,8 +916,8 @@ void SpatialEditorViewport::_sinput(const Ref<InputEvent> &p_event) {
//default to regionselect
cursor.region_select = true;
- cursor.region_begin = b->get_pos();
- cursor.region_end = b->get_pos();
+ cursor.region_begin = b->get_position();
+ cursor.region_end = b->get_position();
}
if (clicked && gizmo_handle >= 0) {
@@ -989,7 +1001,7 @@ void SpatialEditorViewport::_sinput(const Ref<InputEvent> &p_event) {
if (m.is_valid()) {
- _edit.mouse_pos = m->get_pos();
+ _edit.mouse_pos = m->get_position();
if (spatial_editor->get_selected()) {
@@ -1026,7 +1038,7 @@ void SpatialEditorViewport::_sinput(const Ref<InputEvent> &p_event) {
if (_edit.gizmo.is_valid()) {
- _edit.gizmo->set_handle(_edit.gizmo_handle, camera, m->get_pos());
+ _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));
@@ -1058,7 +1070,7 @@ void SpatialEditorViewport::_sinput(const Ref<InputEvent> &p_event) {
if (cursor.region_select && nav_mode == NAVIGATION_NONE) {
- cursor.region_end = m->get_pos();
+ cursor.region_end = m->get_position();
surface->update();
return;
}
@@ -1066,8 +1078,8 @@ void SpatialEditorViewport::_sinput(const Ref<InputEvent> &p_event) {
if (_edit.mode == TRANSFORM_NONE && nav_mode == NAVIGATION_NONE)
return;
- Vector3 ray_pos = _get_ray_pos(m->get_pos());
- Vector3 ray = _get_ray(m->get_pos());
+ Vector3 ray_pos = _get_ray_pos(m->get_position());
+ Vector3 ray = _get_ray(m->get_position());
switch (_edit.mode) {
@@ -1168,7 +1180,7 @@ void SpatialEditorViewport::_sinput(const Ref<InputEvent> &p_event) {
if (_edit.snap || spatial_editor->is_snap_enabled()) {
snap = spatial_editor->get_translate_snap();
- motion.snap(snap);
+ motion.snap(Vector3(snap, snap, snap));
}
//set_message("Translating: "+motion);
@@ -1676,7 +1688,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;
@@ -1724,6 +1736,33 @@ void SpatialEditorViewport::_notification(int p_what) {
bool hdr = GlobalConfig::get_singleton()->get("rendering/quality/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) {
@@ -1731,6 +1770,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);
}
@@ -1752,10 +1792,10 @@ static void stroke_rect(CanvasItem *ci, Rect2 rect, Color color, real_t width =
// a---b
// | |
// c---d
- Vector2 a(rect.pos);
- Vector2 b(rect.pos.x + rect.size.x, rect.pos.y);
- Vector2 c(rect.pos.x, rect.pos.y + rect.size.y);
- Vector2 d(rect.pos + rect.size);
+ 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);
@@ -1804,15 +1844,15 @@ 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;
}
@@ -1846,7 +1886,7 @@ void SpatialEditorViewport::_draw() {
real_t sy = r.size.y * logscale_t;
surface->draw_rect(r, Color(1, 1, 1, 0.2));
- surface->draw_rect(Rect2(r.pos.x, r.pos.y + r.size.y - sy, r.size.x, sy), Color(1, 1, 1, 0.6));
+ 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));
}
}
@@ -1997,6 +2037,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;
}
}
@@ -2273,6 +2359,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));
@@ -2296,12 +2383,18 @@ 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()->set_item_checked(view_menu->get_popup()->get_item_index(VIEW_GIZMOS), true);
view_menu->get_popup()->add_separator();
@@ -2322,6 +2415,13 @@ 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);
@@ -2341,6 +2441,305 @@ SpatialEditorViewport::SpatialEditorViewport(SpatialEditor *p_spatial_editor, Ed
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() {
@@ -2379,7 +2778,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;
@@ -2392,7 +2791,7 @@ 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;
@@ -2719,12 +3118,7 @@ void SpatialEditor::_menu_item_pressed(int p_option) {
} 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);
@@ -2736,17 +3130,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);
@@ -2758,17 +3142,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);
@@ -2780,21 +3154,7 @@ void SpatialEditor::_menu_item_pressed(int p_option) {
} break;
case MENU_VIEW_USE_3_VIEWPORTS: {
- for (int i = 1; i < VIEWPORTS_COUNT; 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);
@@ -2806,21 +3166,7 @@ void SpatialEditor::_menu_item_pressed(int p_option) {
} break;
case MENU_VIEW_USE_3_VIEWPORTS_ALT: {
- for (int i = 1; i < VIEWPORTS_COUNT; 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);
@@ -2832,22 +3178,7 @@ void SpatialEditor::_menu_item_pressed(int p_option) {
} break;
case MENU_VIEW_USE_4_VIEWPORTS: {
- for (int i = 1; i < VIEWPORTS_COUNT; 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);
@@ -2857,43 +3188,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));
@@ -3055,8 +3349,8 @@ void SpatialEditor::_init_indicators() {
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<SpatialMaterial> mat = memnew(SpatialMaterial);
mat->set_flag(SpatialMaterial::FLAG_UNSHADED, true);
@@ -3242,17 +3536,6 @@ void SpatialEditor::_unhandled_key_input(Ref<InputEvent> p_event) {
else if (ED_IS_SHORTCUT("spatial_editor/tool_scale", p_event))
_menu_item_pressed(MENU_TOOL_SCALE);
-
- else if (ED_IS_SHORTCUT("spatial_editor/display_wireframe", p_event)) {
- if (k->get_shift() || k->get_control() || k->get_command())
- return;
-
- 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);
- }
- }
}
}
}
@@ -3411,7 +3694,7 @@ 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));
@@ -3419,9 +3702,6 @@ void SpatialEditor::clear() {
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) {
@@ -3566,17 +3846,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_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);
@@ -3591,7 +3865,7 @@ 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 < VIEWPORTS_COUNT; i++) {
@@ -3638,7 +3912,7 @@ SpatialEditor::SpatialEditor(EditorNode *p_editor) {
settings_fov->set_max(179);
settings_fov->set_min(1);
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);
diff --git a/editor/plugins/spatial_editor_plugin.h b/editor/plugins/spatial_editor_plugin.h
index 88245ad0dc..6b05a8b370 100644
--- a/editor/plugins/spatial_editor_plugin.h
+++ b/editor/plugins/spatial_editor_plugin.h
@@ -84,6 +84,11 @@ class SpatialEditorViewport : public Control {
VIEW_ORTHOGONAL,
VIEW_AUDIO_LISTENER,
VIEW_GIZMOS,
+ VIEW_INFORMATION,
+ VIEW_DISPLAY_NORMAL,
+ VIEW_DISPLAY_WIREFRAME,
+ VIEW_DISPLAY_OVERDRAW,
+ VIEW_DISPLAY_SHADELESS,
};
public:
@@ -116,6 +121,9 @@ private:
bool freelook_active;
+ PanelContainer *info;
+ Label *info_label;
+
struct _RayResult {
Spatial *item;
@@ -287,6 +295,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);
@@ -309,7 +354,7 @@ private:
EditorNode *editor;
EditorSelection *editor_selection;
- Control *viewport_base;
+ SpatialEditorViewportContainer *viewport_base;
SpatialEditorViewport *viewports[VIEWPORTS_COUNT];
VSplitContainer *shader_split;
HSplitContainer *palette_split;
@@ -330,13 +375,13 @@ private:
bool grid_enable[3]; //should be always visible if true
bool grid_enabled;
- Ref<Mesh> move_gizmo[3], rotate_gizmo[3];
+ 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;
@@ -379,10 +424,6 @@ private:
MENU_VIEW_USE_3_VIEWPORTS,
MENU_VIEW_USE_3_VIEWPORTS_ALT,
MENU_VIEW_USE_4_VIEWPORTS,
- 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,
@@ -472,8 +513,8 @@ 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]; }
+ 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();
diff --git a/editor/plugins/texture_editor_plugin.cpp b/editor/plugins/texture_editor_plugin.cpp
index 676e50d61c..c4fe15e61c 100644
--- a/editor/plugins/texture_editor_plugin.cpp
+++ b/editor/plugins/texture_editor_plugin.cpp
@@ -61,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");
diff --git a/editor/plugins/texture_region_editor_plugin.cpp b/editor/plugins/texture_region_editor_plugin.cpp
index 799bfbf358..8a7dcea393 100644
--- a/editor/plugins/texture_region_editor_plugin.cpp
+++ b/editor/plugins/texture_region_editor_plugin.cpp
@@ -114,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;
@@ -132,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++) {
@@ -162,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);
@@ -208,17 +208,17 @@ void TextureRegionEditor::_region_input(const Ref<InputEvent> &p_input) {
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)
};
- Ref<InputEventMouseButton> mb;
+ Ref<InputEventMouseButton> mb = p_input;
if (mb.is_valid()) {
if (mb->get_button_index() == BUTTON_LEFT) {
@@ -239,31 +239,31 @@ void TextureRegionEditor::_region_input(const Ref<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->get_pos().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->get_pos().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->get_pos().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->get_pos().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->get_pos().x, mb->get_pos().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->get_pos().x, mb->get_pos().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 Ref<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 Ref<InputEvent> &p_input) {
}
}
} else if (edited_margin < 0) {
- drag_from = mtx.affine_inverse().xform(Vector2(mb->get_pos().x, mb->get_pos().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 Ref<InputEvent> &p_input) {
for (int i = 0; i < 8; i++) {
Vector2 tuv = endpoints[i];
- if (tuv.distance_to(Vector2(mb->get_pos().x, mb->get_pos().y)) < 8) {
+ if (tuv.distance_to(Vector2(mb->get_position().x, mb->get_position().y)) < 8) {
drag_index = i;
}
}
@@ -408,13 +408,13 @@ void TextureRegionEditor::_region_input(const Ref<InputEvent> &p_input) {
if (edited_margin >= 0) {
float new_margin;
if (edited_margin == 0)
- new_margin = prev_margin + (mm->get_pos().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->get_pos().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->get_pos().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->get_pos().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 };
@@ -423,7 +423,7 @@ void TextureRegionEditor::_region_input(const Ref<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(mm->get_pos());
+ 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)
@@ -439,49 +439,49 @@ void TextureRegionEditor::_region_input(const Ref<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);
@@ -693,7 +693,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;
@@ -706,8 +706,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());
@@ -792,6 +792,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);
diff --git a/editor/plugins/tile_map_editor_plugin.cpp b/editor/plugins/tile_map_editor_plugin.cpp
index 9f7a41b8b6..d12b979121 100644
--- a/editor/plugins/tile_map_editor_plugin.cpp
+++ b/editor/plugins/tile_map_editor_plugin.cpp
@@ -98,8 +98,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);
}
@@ -333,7 +333,7 @@ PoolVector<Vector2> TileMapEditor::_bucket_fill(const Point2i &p_start, bool era
}
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();
@@ -349,7 +349,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;
}
@@ -380,7 +380,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;
@@ -441,7 +441,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();
@@ -460,7 +460,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();
@@ -490,42 +490,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())
@@ -560,9 +560,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;
@@ -737,8 +737,8 @@ bool TileMapEditor::forward_gui_input(const Ref<InputEvent> &p_event) {
if (id != TileMap::INVALID_CELL) {
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++) {
+ 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), id, flip_h, flip_v, transpose, true);
}
@@ -749,7 +749,7 @@ bool TileMapEditor::forward_gui_input(const Ref<InputEvent> &p_event) {
}
} else if (tool == TOOL_DUPLICATING) {
- Point2 ofs = over_tile - rectangle.pos;
+ Point2 ofs = over_tile - rectangle.position;
undo_redo->create_action(TTR("Duplicate"));
for (List<TileData>::Element *E = copydata.front(); E; E = E->next()) {
@@ -826,7 +826,7 @@ bool TileMapEditor::forward_gui_input(const Ref<InputEvent> &p_event) {
paint_undo.clear();
- Point2 local = node->world_to_map(xform_inv.xform(mb->get_pos()));
+ Point2 local = node->world_to_map(xform_inv.xform(mb->get_position()));
if (mb->get_shift()) {
@@ -900,7 +900,7 @@ bool TileMapEditor::forward_gui_input(const Ref<InputEvent> &p_event) {
if (mm.is_valid()) {
- Point2i new_over_tile = node->world_to_map(xform_inv.xform(mm->get_pos()));
+ Point2i new_over_tile = node->world_to_map(xform_inv.xform(mm->get_position()));
if (new_over_tile != over_tile) {
@@ -985,8 +985,8 @@ bool TileMapEditor::forward_gui_input(const Ref<InputEvent> &p_event) {
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);
@@ -1103,7 +1103,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)));
@@ -1113,10 +1113,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);
@@ -1127,9 +1127,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) {
@@ -1151,10 +1151,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);
@@ -1164,9 +1164,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) {
@@ -1188,10 +1188,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));
}
@@ -1248,8 +1248,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);
}
@@ -1264,7 +1264,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()) {
@@ -1277,13 +1277,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));
diff --git a/editor/plugins/tile_set_editor_plugin.cpp b/editor/plugins/tile_set_editor_plugin.cpp
index 0b088f7171..3563f70d0b 100644
--- a/editor/plugins/tile_set_editor_plugin.cpp
+++ b/editor/plugins/tile_set_editor_plugin.cpp
@@ -53,6 +53,7 @@ void TileSetEditor::_import_node(Node *p_node, Ref<TileSet> p_library) {
Sprite *mi = child->cast_to<Sprite>();
Ref<Texture> texture = mi->get_texture();
+ Ref<Texture> normal_map = mi->get_normal_map();
Ref<ShaderMaterial> material = mi->get_material();
if (texture.is_null())
@@ -67,6 +68,7 @@ void TileSetEditor::_import_node(Node *p_node, Ref<TileSet> p_library) {
}
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());
@@ -88,9 +90,10 @@ void TileSetEditor::_import_node(Node *p_node, Ref<TileSet> p_library) {
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++) {
@@ -104,24 +107,36 @@ void TileSetEditor::_import_node(Node *p_node, Ref<TileSet> p_library) {
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());
diff --git a/editor/project_export.cpp b/editor/project_export.cpp
index d58454a223..355f8ba22e 100644
--- a/editor/project_export.cpp
+++ b/editor/project_export.cpp
@@ -235,7 +235,7 @@ void ProjectExportDialog::_edit_preset(int p_index) {
export_button->set_disabled(true);
} else {
- export_error->show();
+ export_error->hide();
export_templates_error->hide();
export_button->set_disabled(false);
}
diff --git a/editor/project_manager.cpp b/editor/project_manager.cpp
index a4e8ef70ce..a3d3d42110 100644
--- a/editor/project_manager.cpp
+++ b/editor/project_manager.cpp
@@ -914,8 +914,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) {
@@ -1469,7 +1470,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_settings.cpp b/editor/project_settings.cpp
index 1c4ca3cb58..4000b3e05c 100644
--- a/editor/project_settings.cpp
+++ b/editor/project_settings.cpp
@@ -119,6 +119,7 @@ void ProjectSettings::_action_selected() {
return;
add_at = "input/" + ti->get_text(0);
+ edit_idx = -1;
}
void ProjectSettings::_action_edited() {
@@ -180,6 +181,7 @@ void ProjectSettings::_device_input_add() {
Ref<InputEvent> ie;
String name = add_at;
+ int idx = edit_idx;
Variant old_val = GlobalConfig::get_singleton()->get(name);
Array arr = old_val;
// ie.device = device_id->get_value();
@@ -251,7 +253,11 @@ void ProjectSettings::_device_input_add() {
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);
@@ -279,6 +285,7 @@ void ProjectSettings::_press_a_key_confirm() {
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);
Array arr = old_val;
@@ -293,7 +300,11 @@ void ProjectSettings::_press_a_key_confirm() {
}
}
- 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);
@@ -362,7 +373,7 @@ void ProjectSettings::_wait_for_key(const Ref<InputEvent> &p_event) {
}
}
-void ProjectSettings::_add_item(int p_item) {
+void ProjectSettings::_add_item(int p_item, Ref<InputEvent> p_exiting_event) {
add_type = InputType(p_item);
@@ -377,7 +388,6 @@ void ProjectSettings::_add_item(int p_item) {
} break;
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"));
@@ -390,10 +400,19 @@ void ProjectSettings::_add_item(int p_item) {
device_index->add_item(TTR("Button 8"));
device_index->add_item(TTR("Button 9"));
device_input->popup_centered_minsize(Size2(350, 95));
+
+ 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 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++) {
@@ -403,10 +422,18 @@ void ProjectSettings::_add_item(int p_item) {
}
device_input->popup_centered_minsize(Size2(350, 95));
+ 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 INPUT_JOY_BUTTON: {
- device_id->set_value(0);
device_index_label->set_text(TTR("Joypad Button Index:"));
device_index->clear();
@@ -416,11 +443,66 @@ void ProjectSettings::_add_item(int p_item) {
}
device_input->popup_centered_minsize(Size2(350, 95));
+ 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::_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 ProjectSettings::_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 = GlobalConfig::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 ProjectSettings::_action_button_pressed(Object *p_obj, int p_column, int p_id) {
TreeItem *ti = p_obj->cast_to<TreeItem>();
@@ -430,12 +512,13 @@ void ProjectSettings::_action_button_pressed(Object *p_obj, int p_column, int p_
if (p_id == 1) {
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_position(ofs);
popup_add->popup();
add_at = "input/" + ti->get_text(0);
+ edit_idx = -1;
} else if (p_id == 2) {
//remove
@@ -484,6 +567,32 @@ void ProjectSettings::_action_button_pressed(Object *p_obj, int p_column, int p_
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 = GlobalConfig::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);
+ }
}
}
@@ -589,6 +698,7 @@ void ProjectSettings::_update_actions() {
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);
@@ -1174,10 +1284,11 @@ void ProjectSettings::_bind_methods() {
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_activated"), &ProjectSettings::_action_activated);
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("_add_item"), &ProjectSettings::_add_item, DEFVAL(Variant()));
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);
@@ -1383,6 +1494,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);
diff --git a/editor/project_settings.h b/editor/project_settings.h
index 47fb45cf8e..03140a854b 100644
--- a/editor/project_settings.h
+++ b/editor/project_settings.h
@@ -55,6 +55,7 @@ class ProjectSettings : public AcceptDialog {
Timer *timer;
InputType add_type;
String add_at;
+ int edit_idx;
EditorData *data;
UndoRedo *undo_redo;
@@ -105,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();
@@ -114,6 +116,7 @@ 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 Ref<InputEvent> &p_event);
void _press_a_key_confirm();
diff --git a/editor/property_editor.cpp b/editor/property_editor.cpp
index 1c8a1c0ee0..8a9fd2cde5 100644
--- a/editor/property_editor.cpp
+++ b/editor/property_editor.cpp
@@ -65,6 +65,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) {
@@ -678,8 +681,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;
@@ -733,9 +736,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));
@@ -821,7 +824,7 @@ bool CustomPropertyEditor::edit(Object *p_owner, const String &p_name, Variant::
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));
+ set_size(Size2(307 * EDSCALE, 460 * EDSCALE));
color_picker->set_focus_on_line_edit();
/*
int ofs=80;
@@ -1539,13 +1542,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();
}
@@ -2310,6 +2313,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;
@@ -2319,6 +2323,7 @@ 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");
@@ -2691,20 +2696,20 @@ void PropertyEditor::_notification(int p_what) {
}
}
-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;
@@ -2715,10 +2720,22 @@ TreeItem *PropertyEditor::get_parent_node(String p_path, HashMap<String, TreeIte
}
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"));
@@ -2930,17 +2947,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;
@@ -2971,6 +2992,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
}
@@ -3000,7 +3023,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;
@@ -3540,17 +3563,21 @@ 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");
@@ -3668,13 +3695,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();
@@ -3854,6 +3891,16 @@ void PropertyEditor::_item_edited() {
_edit_set(name, NodePath(item->get_text(1)), refresh_all);
} break;
+ case Variant::OBJECT: {
+ if (!item->is_custom_set_as_button(1))
+ break;
+
+ RES res = obj->get(name);
+ if (res.is_valid()) {
+ emit_signal("resource_selected", res.get_ref_ptr(), name);
+ }
+
+ } break;
case Variant::DICTIONARY: {
@@ -3926,7 +3973,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_position(where.pos);
+ custom_editor->set_position(where.position);
if (custom_editor->edit(obj, name, type, v, hint, hint_text)) {
custom_editor->popup();
@@ -4033,9 +4080,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_position();
- custom_editor->set_position(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) {
@@ -4046,9 +4093,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_position();
- custom_editor->set_position(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();
@@ -4124,7 +4171,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);
@@ -4168,6 +4215,7 @@ void PropertyEditor::_bind_methods() {
ClassDB::bind_method("_item_edited", &PropertyEditor::_item_edited);
ClassDB::bind_method("_item_selected", &PropertyEditor::_item_selected);
+ 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(""));
@@ -4273,11 +4321,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;
+ use_folding = false;
undo_redo = NULL;
obj = NULL;
@@ -4310,6 +4365,7 @@ PropertyEditor::PropertyEditor() {
tree->connect("item_edited", this, "_item_edited", varray(), CONNECT_DEFERRED);
tree->connect("cell_selected", this, "_item_selected");
+ tree->connect("item_collapsed", this, "_item_folded");
tree->set_drag_forwarding(this);
@@ -4339,6 +4395,7 @@ PropertyEditor::PropertyEditor() {
show_categories = false;
refresh_countdown = 0;
use_doc_hints = false;
+ updating_folding = true;
use_filter = false;
subsection_selectable = false;
show_type_icons = EDITOR_DEF("interface/show_type_icons", false);
@@ -4405,7 +4462,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 + "/")) {
diff --git a/editor/property_editor.h b/editor/property_editor.h
index c02c301acf..47bd807c3f 100644
--- a/editor/property_editor.h
+++ b/editor/property_editor.h
@@ -190,6 +190,9 @@ class PropertyEditor : public Control {
bool use_filter;
bool subsection_selectable;
bool hide_script;
+ bool use_folding;
+
+ bool updating_folding;
HashMap<String, String> pending;
String selected_property;
@@ -206,7 +209,7 @@ class PropertyEditor : public Control {
void _item_selected();
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 = "");
@@ -244,6 +247,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;
@@ -285,6 +289,7 @@ public:
void set_subsection_selectable(bool p_selectable);
+ void set_use_folding(bool p_enable);
PropertyEditor();
~PropertyEditor();
};
diff --git a/editor/property_selector.cpp b/editor/property_selector.cpp
index 47e5994e3f..c6af993676 100644
--- a/editor/property_selector.cpp
+++ b/editor/property_selector.cpp
@@ -167,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)
diff --git a/editor/scene_tree_dock.cpp b/editor/scene_tree_dock.cpp
index 0f05cc79ff..886474200e 100644
--- a/editor/scene_tree_dock.cpp
+++ b/editor/scene_tree_dock.cpp
@@ -658,6 +658,105 @@ 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);
+ editable = !editable;
+
+ EditorNode::get_singleton()->get_edited_scene()->set_editable_instance(node, editable);
+ menu->set_item_checked(18, editable);
+ if (editable) {
+ node->set_scene_instance_load_placeholder(false);
+ menu->set_item_checked(19, 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;
+ if (placeholder)
+ EditorNode::get_singleton()->get_edited_scene()->set_editable_instance(node, false);
+
+ node->set_scene_instance_load_placeholder(placeholder);
+ menu->set_item_checked(18, false);
+ menu->set_item_checked(19, 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);
+ }
+ }
}
}
@@ -687,6 +786,29 @@ void SceneTreeDock::_notification(int p_what) {
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);
}
}
@@ -1662,6 +1784,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()) {
@@ -1683,6 +1846,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();
@@ -1707,6 +1876,26 @@ 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) {
+ 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(18, editable);
+ menu->set_item_checked(19, 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);
@@ -1916,6 +2105,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 f190025dd6..5872c5a25d 100644
--- a/editor/scene_tree_dock.h
+++ b/editor/scene_tree_dock.h
@@ -70,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;
@@ -106,6 +119,7 @@ class SceneTreeDock : public VBoxContainer {
TextureRect *filter_icon;
PopupMenu *menu;
+ ConfirmationDialog *clear_inherit_confirm;
bool first_enter;
@@ -114,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);
diff --git a/editor/scene_tree_editor.cpp b/editor/scene_tree_editor.cpp
index 2945abbd8c..d12d8b5528 100644
--- a/editor/scene_tree_editor.cpp
+++ b/editor/scene_tree_editor.cpp
@@ -44,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>();
@@ -159,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_position();
-
if (n == get_scene_node()) {
- inheritance_menu->set_position(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_position(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())
@@ -472,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);
}
@@ -633,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");
@@ -649,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");
}
@@ -1059,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);
@@ -1145,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 ec7115afed..c6283af7b5 100644
--- a/editor/scene_tree_editor.h
+++ b/editor/scene_tree_editor.h
@@ -56,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;
@@ -119,7 +106,6 @@ class SceneTreeEditor : public Control {
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 2220e3330f..4a9b64639b 100644
--- a/editor/script_create_dialog.cpp
+++ b/editor/script_create_dialog.cpp
@@ -116,6 +116,20 @@ void ScriptCreateDialog::_parent_name_changed(const String &p_parent) {
_update_dialog();
}
+void ScriptCreateDialog::_template_changed(int p_template) {
+
+ 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 (is_new_script_created) {
@@ -134,10 +148,20 @@ void ScriptCreateDialog::_create_new() {
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);
@@ -175,7 +199,8 @@ void ScriptCreateDialog::_load_exist() {
void ScriptCreateDialog::_lang_changed(int l) {
l = language_menu->get_selected();
- if (ScriptServer::get_language(l)->has_named_classes()) {
+ ScriptLanguage *language = ScriptServer::get_language(l);
+ if (language->has_named_classes()) {
has_named_classes = true;
} else {
has_named_classes = false;
@@ -187,7 +212,7 @@ void ScriptCreateDialog::_lang_changed(int l) {
can_inherit_from_file = false;
}
- String selected_ext = "." + ScriptServer::get_language(l)->get_extension();
+ String selected_ext = "." + language->get_extension();
String path = file_path->get_text();
String extension = "";
if (path != "") {
@@ -204,7 +229,7 @@ void ScriptCreateDialog::_lang_changed(int l) {
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);
+ language->get_recognized_extensions(&extensions);
}
for (List<String>::Element *E = extensions.front(); E; E = E->next()) {
@@ -218,6 +243,33 @@ void ScriptCreateDialog::_lang_changed(int l) {
file_path->set_text(path);
}
+ 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();
}
@@ -240,10 +292,8 @@ void ScriptCreateDialog::_browse_path(bool browse_parent) {
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());
@@ -471,13 +521,12 @@ void ScriptCreateDialog::_bind_methods() {
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() {
- editor_settings = EditorSettings::get_singleton();
-
GridContainer *gc = memnew(GridContainer);
VBoxContainer *vb = memnew(VBoxContainer);
HBoxContainer *hb = memnew(HBoxContainer);
@@ -583,7 +632,7 @@ ScriptCreateDialog::ScriptCreateDialog() {
}
}
- String last_selected_language = editor_settings->get_project_metadata("script_setup", "last_selected_language", "");
+ 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) {
@@ -629,6 +678,16 @@ ScriptCreateDialog::ScriptCreateDialog() {
gc->add_child(l);
gc->add_child(class_name);
+ /* Templates */
+
+ 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");
+
/* Built-in Script */
internal = memnew(CheckButton);
diff --git a/editor/script_create_dialog.h b/editor/script_create_dialog.h
index 862d4f88f2..f503b878f5 100644
--- a/editor/script_create_dialog.h
+++ b/editor/script_create_dialog.h
@@ -48,6 +48,7 @@ class ScriptCreateDialog : public ConfirmationDialog {
LineEdit *parent_name;
Button *parent_browse_button;
OptionButton *language_menu;
+ OptionButton *template_menu;
LineEdit *file_path;
Button *path_button;
EditorFileDialog *file_browse;
@@ -58,7 +59,6 @@ class ScriptCreateDialog : public ConfirmationDialog {
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;
@@ -68,6 +68,8 @@ class ScriptCreateDialog : public ConfirmationDialog {
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);
@@ -75,6 +77,7 @@ class ScriptCreateDialog : public ConfirmationDialog {
bool _validate(const String &p_strin);
void _class_name_changed(const String &p_name);
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();
diff --git a/editor/script_editor_debugger.cpp b/editor/script_editor_debugger.cpp
index a2bb3a0879..9dce48937c 100644
--- a/editor/script_editor_debugger.cpp
+++ b/editor/script_editor_debugger.cpp
@@ -790,19 +790,19 @@ 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);
c.set_hsv(Math::fmod(c.get_h() + pi * 0.7654, 1), c.get_s(), c.get_v());
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;
@@ -819,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;
@@ -1035,14 +1035,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);
}
@@ -1134,8 +1137,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());
@@ -1519,6 +1523,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());
@@ -1868,6 +1887,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 49a4abb6ac..907c267d49 100644
--- a/editor/script_editor_debugger.h
+++ b/editor/script_editor_debugger.h
@@ -84,6 +84,8 @@ class ScriptEditorDebugger : public Control {
int last_error_count;
bool hide_on_stop;
+ bool enable_external_editor;
+ Ref<Script> stack_script;
TabContainer *tabs;
@@ -201,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 563de78415..6f613981b8 100644
--- a/editor/settings_config_dialog.cpp
+++ b/editor/settings_config_dialog.cpp
@@ -382,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/spatial_editor_gizmos.cpp b/editor/spatial_editor_gizmos.cpp
index 4781bb6a3b..62fa93ac23 100644
--- a/editor/spatial_editor_gizmos.cpp
+++ b/editor/spatial_editor_gizmos.cpp
@@ -79,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;
@@ -100,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);
@@ -162,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;
@@ -219,7 +219,7 @@ 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;
@@ -1029,7 +1029,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
@@ -1248,7 +1248,7 @@ void SkeletonSpatialGizmo::redraw() {
*/
}
- Ref<Mesh> m = surface_tool->commit();
+ Ref<ArrayMesh> m = surface_tool->commit();
add_mesh(m, false, skel->get_skeleton());
}
@@ -1279,8 +1279,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);
@@ -1439,20 +1439,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 {
@@ -1722,8 +1708,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;
@@ -1953,7 +1939,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;
@@ -1964,7 +1950,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);
}
@@ -2002,7 +1988,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);
}
@@ -2053,7 +2039,7 @@ void ParticlesGizmo::set_handle(int p_idx, Camera *p_camera, const Point2 &p_poi
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;
@@ -2065,7 +2051,7 @@ void ParticlesGizmo::set_handle(int p_idx, Camera *p_camera, const Point2 &p_poi
float d = ra[p_idx];
- aabb.pos[p_idx] = d - 1.0 - aabb.size[p_idx] * 0.5;
+ aabb.position[p_idx] = d - 1.0 - aabb.size[p_idx] * 0.5;
particles->set_visibility_aabb(aabb);
} else {
@@ -2076,7 +2062,7 @@ void ParticlesGizmo::set_handle(int p_idx, Camera *p_camera, const Point2 &p_poi
if (d < 0.001)
d = 0.001;
//resize
- 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;
particles->set_visibility_aabb(aabb);
}
@@ -2115,13 +2101,13 @@ void ParticlesGizmo::redraw() {
for (int i = 0; i < 3; i++) {
Vector3 ax;
- ax[i] = aabb.pos[i] + aabb.size[i];
- ax[(i + 1) % 3] = aabb.pos[(i + 1) % 3] + aabb.size[(i + 1) % 3] * 0.5;
- ax[(i + 2) % 3] = aabb.pos[(i + 2) % 3] + aabb.size[(i + 2) % 3] * 0.5;
+ 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.pos + aabb.size * 0.5;
+ Vector3 center = aabb.position + aabb.size * 0.5;
for (int i = 0; i < 3; i++) {
Vector3 ax;
@@ -2218,7 +2204,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;
}
@@ -2227,7 +2213,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();
}
@@ -2241,7 +2227,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++) {
@@ -2262,7 +2248,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);
}
@@ -2392,7 +2378,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;
@@ -2421,7 +2407,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);
}
@@ -2477,8 +2463,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);
@@ -2511,7 +2497,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;
@@ -3045,12 +3031,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>()));
@@ -3213,7 +3193,7 @@ SpatialEditorGizmos::SpatialEditorGizmos() {
//position 3D Shared mesh
- pos3d_mesh = Ref<Mesh>(memnew(Mesh));
+ pos3d_mesh = Ref<ArrayMesh>(memnew(ArrayMesh));
{
PoolVector<Vector3> cursor_points;
@@ -3246,7 +3226,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;
diff --git a/editor/spatial_editor_gizmos.h b/editor/spatial_editor_gizmos.h
index 095586ab91..a8ace87530 100644
--- a/editor/spatial_editor_gizmos.h
+++ b/editor/spatial_editor_gizmos.h
@@ -46,7 +46,6 @@
#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/vehicle_body.h"
#include "scene/3d/visibility_notifier.h"
@@ -59,7 +58,7 @@ class EditorSpatialGizmo : public SpatialEditorGizmo {
struct Instance {
RID instance;
- Ref<Mesh> mesh;
+ Ref<ArrayMesh> mesh;
RID skeleton;
bool billboard;
bool unscaled;
@@ -97,7 +96,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);
@@ -187,17 +186,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);
@@ -454,8 +442,8 @@ public:
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 867302b657..d617f55dfd 100644
--- a/editor/translations/ar.po
+++ b/editor/translations/ar.po
@@ -1,6 +1,5 @@
# Arabic translation of the Godot Engine editor
-# Copyright (C) 2007-2017 Juan Linietsky, Ariel Manzur
-# Copyright (C) 2014-2017 Godot Engine contributors (cf. AUTHORS.md)
+# 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.
@@ -535,7 +534,8 @@ msgid "Search:"
msgstr ""
#: editor/asset_library_editor_plugin.cpp editor/code_editor.cpp
-#: editor/editor_help.cpp editor/plugins/script_editor_plugin.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"
@@ -581,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 "مجتمع"
@@ -724,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 ""
@@ -829,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 ""
@@ -929,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 ""
@@ -940,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 ""
@@ -1008,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 ""
@@ -1200,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 ""
@@ -1217,7 +1219,6 @@ msgid "Class:"
msgstr ""
#: editor/editor_help.cpp editor/scene_tree_editor.cpp
-#: editor/script_create_dialog.cpp
msgid "Inherits:"
msgstr ""
@@ -1388,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
@@ -1443,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 ""
@@ -1499,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 ""
@@ -1537,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 ""
@@ -1589,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 ""
@@ -1617,35 +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"
+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
@@ -1653,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
@@ -1764,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
@@ -1785,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
@@ -1873,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 ""
@@ -1900,6 +1929,30 @@ 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
+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 ""
@@ -2143,6 +2196,10 @@ msgid "Collapse all"
msgstr ""
#: editor/filesystem_dock.cpp
+msgid "Show In File Manager"
+msgstr ""
+
+#: editor/filesystem_dock.cpp
msgid "Instance"
msgstr ""
@@ -2171,10 +2228,6 @@ msgid "Info"
msgstr ""
#: editor/filesystem_dock.cpp
-msgid "Show In File Manager"
-msgstr ""
-
-#: editor/filesystem_dock.cpp
msgid "Re-Import.."
msgstr ""
@@ -2340,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
@@ -2815,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
@@ -3476,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 ""
@@ -3525,17 +3578,6 @@ msgstr ""
msgid "Set Handle"
msgstr ""
-#: editor/plugins/color_ramp_editor_plugin.cpp
-#: editor/plugins/gradient_texture_editor_plugin.cpp
-msgid "Add/Remove Color Ramp Point"
-msgstr ""
-
-#: editor/plugins/color_ramp_editor_plugin.cpp
-#: editor/plugins/gradient_texture_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 ""
@@ -3567,9 +3609,31 @@ 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 ""
@@ -3839,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 ""
@@ -3851,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
@@ -3862,20 +3939,33 @@ msgstr ""
msgid "Generated Point Count:"
msgstr ""
+#: editor/plugins/particles_2d_editor_plugin.cpp
#: editor/plugins/particles_editor_plugin.cpp
-msgid "Node does not contain geometry."
+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 (faces)."
+msgid "Node does not contain geometry."
msgstr ""
#: editor/plugins/particles_editor_plugin.cpp
-msgid "A processor material of type 'ParticlesMaterial' is required."
+msgid "Node does not contain geometry (faces)."
msgstr ""
#: editor/plugins/particles_editor_plugin.cpp
-msgid "Generating AABB"
+msgid "A processor material of type 'ParticlesMaterial' is required."
msgstr ""
#: editor/plugins/particles_editor_plugin.cpp
@@ -3930,12 +4020,16 @@ msgstr ""
msgid "Generate Visibility AABB"
msgstr ""
-#: editor/plugins/particles_editor_plugin.cpp
-msgid "Generation Time (sec):"
+#: editor/plugins/path_2d_editor_plugin.cpp
+msgid "Remove Point from Curve"
msgstr ""
#: editor/plugins/path_2d_editor_plugin.cpp
-msgid "Remove Point from Curve"
+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
@@ -3993,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 ""
@@ -4146,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 ""
@@ -4233,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 ""
@@ -4270,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
@@ -4333,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"
@@ -4412,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 ""
@@ -4434,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 ""
@@ -4651,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 "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
@@ -4739,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
@@ -4827,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 ""
@@ -5247,11 +5418,11 @@ msgid "Invalid project path, the path must exist!"
msgstr ""
#: editor/project_manager.cpp
-msgid "Invalid project path, *.godot must not exist."
+msgid "Invalid project path, project.godot must not exist."
msgstr ""
#: editor/project_manager.cpp
-msgid "Invalid project path, *.godot must exist."
+msgid "Invalid project path, project.godot must exist."
msgstr ""
#: editor/project_manager.cpp
@@ -5263,7 +5434,7 @@ msgid "Invalid project path (changed anything?)."
msgstr ""
#: editor/project_manager.cpp
-msgid "Couldn't create *.godot project file in project path."
+msgid "Couldn't create project.godot in project path."
msgstr ""
#: editor/project_manager.cpp
@@ -5479,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 ""
@@ -5544,7 +5719,7 @@ msgid "Remove Resource Remap Option"
msgstr ""
#: editor/project_settings.cpp
-msgid "Project Settings "
+msgid "Project Settings (project.godot)"
msgstr ""
#: editor/project_settings.cpp editor/settings_config_dialog.cpp
@@ -5660,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 ""
@@ -5848,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 ""
@@ -5923,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 ""
@@ -5971,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
@@ -6711,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
@@ -6780,12 +7012,6 @@ msgid ""
"Nothing is visible because meshes have not been assigned to draw passes."
msgstr ""
-#: scene/3d/particles.cpp
-msgid ""
-"A material to process the particles is not assigned, so no behavior is "
-"imprinted."
-msgstr ""
-
#: scene/3d/remote_transform.cpp
msgid "Path property must point to a valid Spatial node to work."
msgstr ""
@@ -6801,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 ""
@@ -6843,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 f884b33773..7ca3987827 100644
--- a/editor/translations/bg.po
+++ b/editor/translations/bg.po
@@ -1,6 +1,5 @@
# Bulgarian translation of the Godot Engine editor
-# Copyright (C) 2007-2017 Juan Linietsky, Ariel Manzur
-# Copyright (C) 2014-2017 Godot Engine contributors (cf. AUTHORS.md)
+# 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.
#
# Bojidar Marinov <bojidar.marinov.bg@gmail.com>, 2016.
@@ -535,7 +534,8 @@ msgid "Search:"
msgstr ""
#: editor/asset_library_editor_plugin.cpp editor/code_editor.cpp
-#: editor/editor_help.cpp editor/plugins/script_editor_plugin.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"
@@ -581,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 ""
@@ -724,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 ""
@@ -829,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 ""
@@ -929,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 ""
@@ -940,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 ""
@@ -1009,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 "Път:"
@@ -1202,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 ""
@@ -1219,7 +1221,6 @@ msgid "Class:"
msgstr ""
#: editor/editor_help.cpp editor/scene_tree_editor.cpp
-#: editor/script_create_dialog.cpp
msgid "Inherits:"
msgstr ""
@@ -1389,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
@@ -1444,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 ""
@@ -1500,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 ""
@@ -1538,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 "Сцена"
@@ -1590,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 ""
@@ -1618,84 +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 "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 "Възпроизвеждане на проекта."
-
-#: 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"
@@ -1765,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"
@@ -1786,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 ""
@@ -1874,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"
@@ -1901,6 +1932,31 @@ 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 "ИнÑталирани приÑтавки:"
@@ -2149,6 +2205,10 @@ msgid "Collapse all"
msgstr ""
#: editor/filesystem_dock.cpp
+msgid "Show In File Manager"
+msgstr ""
+
+#: editor/filesystem_dock.cpp
msgid "Instance"
msgstr ""
@@ -2177,10 +2237,6 @@ msgid "Info"
msgstr ""
#: editor/filesystem_dock.cpp
-msgid "Show In File Manager"
-msgstr ""
-
-#: editor/filesystem_dock.cpp
msgid "Re-Import.."
msgstr "Повторно внаÑÑне.."
@@ -2349,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
@@ -2824,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
@@ -3486,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 "Добре"
@@ -3535,17 +3591,6 @@ msgstr ""
msgid "Set Handle"
msgstr ""
-#: editor/plugins/color_ramp_editor_plugin.cpp
-#: editor/plugins/gradient_texture_editor_plugin.cpp
-msgid "Add/Remove Color Ramp Point"
-msgstr ""
-
-#: editor/plugins/color_ramp_editor_plugin.cpp
-#: editor/plugins/gradient_texture_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 ""
@@ -3577,9 +3622,30 @@ 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 ""
@@ -3849,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 ""
@@ -3861,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
@@ -3872,20 +3951,33 @@ msgstr ""
msgid "Generated Point Count:"
msgstr ""
+#: editor/plugins/particles_2d_editor_plugin.cpp
#: editor/plugins/particles_editor_plugin.cpp
-msgid "Node does not contain geometry."
+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 (faces)."
+msgid "Node does not contain geometry."
msgstr ""
#: editor/plugins/particles_editor_plugin.cpp
-msgid "A processor material of type 'ParticlesMaterial' is required."
+msgid "Node does not contain geometry (faces)."
msgstr ""
#: editor/plugins/particles_editor_plugin.cpp
-msgid "Generating AABB"
+msgid "A processor material of type 'ParticlesMaterial' is required."
msgstr ""
#: editor/plugins/particles_editor_plugin.cpp
@@ -3940,12 +4032,16 @@ msgstr ""
msgid "Generate Visibility AABB"
msgstr ""
-#: editor/plugins/particles_editor_plugin.cpp
-msgid "Generation Time (sec):"
+#: editor/plugins/path_2d_editor_plugin.cpp
+msgid "Remove Point from Curve"
msgstr ""
#: editor/plugins/path_2d_editor_plugin.cpp
-msgid "Remove Point from Curve"
+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
@@ -4003,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 ""
@@ -4156,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 ""
@@ -4244,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 ""
@@ -4281,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
@@ -4344,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"
@@ -4423,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 ""
@@ -4445,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 ""
@@ -4662,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 "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
@@ -4750,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
@@ -4818,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 ""
@@ -4838,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 ""
@@ -5262,11 +5435,11 @@ msgid "Invalid project path, the path must exist!"
msgstr ""
#: editor/project_manager.cpp
-msgid "Invalid project path, *.godot must not exist."
+msgid "Invalid project path, project.godot must not exist."
msgstr ""
#: editor/project_manager.cpp
-msgid "Invalid project path, *.godot must exist."
+msgid "Invalid project path, project.godot must exist."
msgstr ""
#: editor/project_manager.cpp
@@ -5278,7 +5451,7 @@ msgid "Invalid project path (changed anything?)."
msgstr ""
#: editor/project_manager.cpp
-msgid "Couldn't create *.godot project file in project path."
+msgid "Couldn't create project.godot in project path."
msgstr ""
#: editor/project_manager.cpp
@@ -5494,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 "УÑтройÑтво"
@@ -5560,7 +5737,7 @@ msgstr ""
#: editor/project_settings.cpp
#, fuzzy
-msgid "Project Settings "
+msgid "Project Settings (project.godot)"
msgstr "ÐаÑтройки на проекта"
#: editor/project_settings.cpp editor/settings_config_dialog.cpp
@@ -5677,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 "ПоÑтавÑне"
@@ -5868,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 ""
@@ -5945,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 ""
@@ -5993,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 "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
@@ -6755,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."
@@ -6830,12 +7064,6 @@ msgid ""
"Nothing is visible because meshes have not been assigned to draw passes."
msgstr ""
-#: scene/3d/particles.cpp
-msgid ""
-"A material to process the particles is not assigned, so no behavior is "
-"imprinted."
-msgstr ""
-
#: scene/3d/remote_transform.cpp
#, fuzzy
msgid "Path property must point to a valid Spatial node to work."
@@ -6854,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 "Тревога!"
@@ -6896,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 "
@@ -6907,9 +7149,13 @@ msgstr ""
#~ msgid "Import assets to the project."
#~ msgstr "ВнаÑÑне на обекти в проекта."
-#, fuzzy
-#~ msgid "Project Settings (godot.cfg)"
-#~ 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 "
diff --git a/editor/translations/bn.po b/editor/translations/bn.po
index 3e4dec7656..abf7b8c8b9 100644
--- a/editor/translations/bn.po
+++ b/editor/translations/bn.po
@@ -1,6 +1,5 @@
# Bengali translation of the Godot Engine editor
-# Copyright (C) 2007-2017 Juan Linietsky, Ariel Manzur
-# Copyright (C) 2014-2017 Godot Engine contributors (cf. AUTHORS.md)
+# 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.
#
# Abu Md. Maruf Sarker <maruf.webdev@gmail.com>, 2016-2017.
@@ -545,7 +544,8 @@ msgid "Search:"
msgstr "অনà§à¦¸à¦¨à§à¦§à¦¾à¦¨ করà§à¦¨:"
#: editor/asset_library_editor_plugin.cpp editor/code_editor.cpp
-#: editor/editor_help.cpp editor/plugins/script_editor_plugin.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"
@@ -591,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 "কমিউনিটি/যৌথ-সামাজিক উৎস"
@@ -737,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 "অপসারণ করà§à¦¨"
@@ -846,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 "পথ"
@@ -950,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 "লোড"
@@ -961,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 "সাধারণ/ডিফলà§à¦Ÿ"
@@ -1035,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 "পথ:"
@@ -1228,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 "সাহাযà§à¦¯ অনà§à¦¸à¦¨à§à¦§à¦¾à¦¨ করà§à¦¨"
@@ -1245,7 +1247,6 @@ msgid "Class:"
msgstr "কà§à¦²à¦¾à¦¸:"
#: editor/editor_help.cpp editor/scene_tree_editor.cpp
-#: editor/script_create_dialog.cpp
msgid "Inherits:"
msgstr "গà§à¦°à¦¹à¦£ করে:"
@@ -1415,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)' বিভাগের \\\"পà§à¦°à¦•লà§à¦ªà§‡à¦° সেটিংস "
@@ -1483,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 "à¦à¦‡ দৃশà§à¦¯à¦Ÿà¦¿ কখনোই সংরকà§à¦·à¦£ করা হয় নি। চালানোর পূরà§à¦¬à§‡ সংরকà§à¦·à¦£ করবেন?"
@@ -1541,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 "আহà§â€Œ"
@@ -1581,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 "দৃশà§à¦¯"
@@ -1634,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 "সামà§à¦ªà§à¦°à¦¤à¦¿à¦•সমূহ খà§à¦²à§à¦¨"
@@ -1662,84 +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 "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"
@@ -1829,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"
@@ -1851,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!"
@@ -1939,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 ফাইল হতে টেমপà§à¦²à§‡à¦Ÿ-সমূহ ইমà§à¦ªà§‹à¦°à§à¦Ÿ করà§à¦¨"
@@ -1966,6 +2000,36 @@ 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 "ইনà§à¦¸à¦Ÿà¦²-কৃত পà§à¦²à¦¾à¦—ইন-সমূহ:"
@@ -2225,6 +2289,10 @@ msgid "Collapse all"
msgstr ""
#: editor/filesystem_dock.cpp
+msgid "Show In File Manager"
+msgstr "ফাইল-মà§à¦¯à¦¾à¦¨à§‡à¦œà¦¾à¦°à§‡ দেখà§à¦¨"
+
+#: editor/filesystem_dock.cpp
msgid "Instance"
msgstr "ইনসà§à¦Ÿà§à¦¯à¦¾à¦¨à§à¦¸"
@@ -2253,10 +2321,6 @@ msgid "Info"
msgstr "তথà§à¦¯"
#: editor/filesystem_dock.cpp
-msgid "Show In File Manager"
-msgstr "ফাইল-মà§à¦¯à¦¾à¦¨à§‡à¦œà¦¾à¦°à§‡ দেখà§à¦¨"
-
-#: editor/filesystem_dock.cpp
msgid "Re-Import.."
msgstr "পà§à¦¨-ইমà§à¦ªà§‹à¦°à§à¦Ÿ.."
@@ -2423,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 বà§à¦¯à¦¬à¦¹à¦¾à¦° করà§à¦¨à¥¤"
@@ -2909,7 +2974,7 @@ msgstr "সঙà§à¦•োচন করà§à¦¨"
#: editor/io_plugins/editor_translation_import_plugin.cpp
#, fuzzy
-msgid "Add to Project (godot.cfg)"
+msgid "Add to Project (project.godot)"
msgstr "পà§à¦°à¦•লà§à¦ªà§‡ সংযà§à¦•à§à¦¤ করà§à¦¨ (engine.cfg)"
#: editor/io_plugins/editor_translation_import_plugin.cpp
@@ -3573,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 "সঠিক"
@@ -3624,17 +3689,6 @@ msgstr "Poly3D তৈরি করà§à¦¨"
msgid "Set Handle"
msgstr "হà§à¦¯à¦¾à¦¨à§à¦¡à§‡à¦² সà§à¦¥à¦¾à¦ªà¦¨ করà§à¦¨"
-#: editor/plugins/color_ramp_editor_plugin.cpp
-#: editor/plugins/gradient_texture_editor_plugin.cpp
-msgid "Add/Remove Color Ramp Point"
-msgstr "রঙà§à¦—ের রâ€à§à¦¯à¦¾à¦®à§à¦ª বিনà§à¦¦à§ সংযোজন/বিয়োজন করà§à¦¨"
-
-#: editor/plugins/color_ramp_editor_plugin.cpp
-#: editor/plugins/gradient_texture_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 "মেস লাইবà§à¦°à§‡à¦°à¦¿ তৈরি হচà§à¦›à§‡"
@@ -3667,9 +3721,33 @@ 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"
@@ -3943,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 "ছবি লোডে সমসà§à¦¯à¦¾ হয়েছে:"
@@ -3955,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"
@@ -3966,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 "নোডে কোনো জà§à¦¯à¦¾à¦®à¦¿à¦¤à¦¿à¦• আকার নেই।"
@@ -3979,11 +4092,6 @@ msgid "A processor material of type 'ParticlesMaterial' is required."
msgstr ""
#: editor/plugins/particles_editor_plugin.cpp
-#, fuzzy
-msgid "Generating AABB"
-msgstr "AABB উৎপনà§à¦¨ করà§à¦¨"
-
-#: editor/plugins/particles_editor_plugin.cpp
msgid "Faces contain no area!"
msgstr "পৃষà§à¦ à¦¸à¦®à§‚হ কোনো আকার নেই!"
@@ -4041,13 +4149,18 @@ msgstr "Emission পূরণ:"
msgid "Generate Visibility AABB"
msgstr "AABB উৎপনà§à¦¨ করà§à¦¨"
-#: editor/plugins/particles_editor_plugin.cpp
+#: editor/plugins/path_2d_editor_plugin.cpp
+msgid "Remove Point from Curve"
+msgstr "বকà§à¦°à¦°à§‡à¦–া হতে বিনà§à¦¦à§ অপসারণ করà§à¦¨"
+
+#: editor/plugins/path_2d_editor_plugin.cpp
#, fuzzy
-msgid "Generation Time (sec):"
-msgstr "গড় সময় (সেঃ)"
+msgid "Remove Out-Control from Curve"
+msgstr "বকà§à¦°à¦°à§‡à¦–া বহিঃ-নিয়নà§à¦¤à§à¦°à¦£à§‡ সরান"
#: editor/plugins/path_2d_editor_plugin.cpp
-msgid "Remove Point from Curve"
+#, fuzzy
+msgid "Remove In-Control from Curve"
msgstr "বকà§à¦°à¦°à§‡à¦–া হতে বিনà§à¦¦à§ অপসারণ করà§à¦¨"
#: editor/plugins/path_2d_editor_plugin.cpp
@@ -4105,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 তৈরি করà§à¦¨"
@@ -4258,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 "থিম সংরকà§à¦·à¦£à§‡ সমসà§à¦¯à¦¾ হয়েছে"
@@ -4345,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 "ধাপ লাফিয়ে যান"
@@ -4382,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."
@@ -4448,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"
@@ -4527,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 "পূরà§à¦¬à§‡ খà§à¦à¦œà§à¦¨"
@@ -4549,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 "সà§à¦•েলার ধà§à¦°à§à¦¬à¦• পরিবরà§à¦¤à¦¨ করà§à¦¨"
@@ -4766,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
+#, fuzzy
+msgid "View Environment"
+msgstr "পরিবেশ (Environment)"
+
+#: editor/plugins/spatial_editor_plugin.cpp
+#, fuzzy
+msgid "View Gizmos"
+msgstr "গিজমোস"
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "No scene selected to instance!"
-msgstr "ইনà§à¦¸à¦Ÿà§à¦¯à¦¾à¦¨à§à¦¸ করার জনà§à¦¯ কোনো দৃশà§à¦¯ নিরà§à¦¬à¦¾à¦šà¦¨ করা হয়নি!"
+msgid "View Information"
+msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Instance at Cursor"
-msgstr "কারà§à¦¸à¦°à§‡à¦° সà§à¦¥à¦¾à¦¨à§‡ ইনà§à¦¸à¦Ÿà§à¦¯à¦¾à¦¨à§à¦¸ করà§à¦¨"
+msgid "Audio Listener"
+msgstr "অডিও শà§à¦°à§‹à¦¤à¦¾"
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Could not instance scene!"
-msgstr "দৃশà§à¦¯ ইনà§à¦¸à¦Ÿà§à¦¯à¦¾à¦¨à§à¦¸ করা সমà§à¦­à¦¬ হয়নি!"
+msgid "XForm Dialog"
+msgstr "XForm à¦à¦° সংলাপ"
#: editor/plugins/spatial_editor_plugin.cpp
msgid "Move Mode (W)"
@@ -4854,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 "রà§à¦ªà¦¾à¦¨à§à¦¤à¦°"
@@ -4866,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"
@@ -4898,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 "অরিজিন দেখà§à¦¨"
@@ -4922,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 "সà§à¦¨à§à¦¯à¦¾à¦ª সেটিংস"
@@ -4942,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 (ডিগà§à¦°à¦¿):"
@@ -5379,12 +5589,12 @@ msgstr "অকারà§à¦¯à¦•র পà§à¦°à¦•লà§à¦ªà§‡à¦° পথ, পথটà¦
#: editor/project_manager.cpp
#, fuzzy
-msgid "Invalid project path, *.godot must not exist."
+msgid "Invalid project path, project.godot must not exist."
msgstr "অকারà§à¦¯à¦•র পà§à¦°à¦•লà§à¦ªà§‡à¦° পথ, engine.cfg অবশà§à¦¯à¦‡ অনà§à¦ªà¦¸à§à¦¥à¦¿à¦¤ হতে হবে।"
#: editor/project_manager.cpp
#, fuzzy
-msgid "Invalid project path, *.godot must exist."
+msgid "Invalid project path, project.godot must exist."
msgstr "অকারà§à¦¯à¦•র পà§à¦°à¦•লà§à¦ªà§‡à¦° পথ, engine.cfg অবশà§à¦¯à¦‡ উপসà§à¦¥à¦¿à¦¤ হতে হবে।"
#: editor/project_manager.cpp
@@ -5397,7 +5607,7 @@ msgstr "অকারà§à¦¯à¦•র পà§à¦°à¦•লà§à¦ªà§‡à¦° পথ (কোনà§
#: editor/project_manager.cpp
#, fuzzy
-msgid "Couldn't create *.godot project file in project path."
+msgid "Couldn't create project.godot in project path."
msgstr "পà§à¦°à¦•লà§à¦ªà§‡à¦° পথে engine.cfg তৈরি করা সমà§à¦­à¦¬ হয়নি।"
#: editor/project_manager.cpp
@@ -5618,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 "ডিভাইস/যনà§à¦¤à§à¦°"
@@ -5684,8 +5899,8 @@ msgstr "রিসোরà§à¦¸à§‡à¦° পà§à¦¨à¦ƒ-নকশার সিদà§à¦§
#: editor/project_settings.cpp
#, fuzzy
-msgid "Project Settings "
-msgstr "পà§à¦°à¦•লà§à¦ªà§‡à¦° সেটিংস"
+msgid "Project Settings (project.godot)"
+msgstr "পà§à¦°à¦•লà§à¦ªà§‡à¦° সেটিংস (engine.cfg)"
#: editor/project_settings.cpp editor/settings_config_dialog.cpp
msgid "General"
@@ -5802,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 "à¦à¦•টি নোড নিরà§à¦¬à¦¾à¦šà¦¨ করà§à¦¨"
@@ -5995,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 "গà§à¦°à§à¦ªà¦¸à¦®à§‚হ সমà§à¦ªà¦¾à¦¦à¦¨ করà§à¦¨"
@@ -6072,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 "অগà§à¦°à¦¹à¦£à¦¯à§‹à¦—à§à¦¯ নোডের নাম, নীমà§à¦¨à§‹à¦•à§à¦¤ অকà§à¦·à¦°à¦¸à¦®à§‚হ গà§à¦°à¦¹à¦£à¦¯à§‹à¦—à§à¦¯ নয়:"
@@ -6120,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
@@ -6883,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."
@@ -6970,12 +7255,6 @@ msgid ""
"Nothing is visible because meshes have not been assigned to draw passes."
msgstr ""
-#: scene/3d/particles.cpp
-msgid ""
-"A material to process the particles is not assigned, so no behavior is "
-"imprinted."
-msgstr ""
-
#: scene/3d/remote_transform.cpp
msgid "Path property must point to a valid Spatial node to work."
msgstr "Path à¦à¦° দিক অবশà§à¦¯à¦‡ à¦à¦•টি কারà§à¦¯à¦•র Spatial নোডের à¦à¦° দিকে নিরà§à¦¦à§‡à¦¶ করাতে হবে।"
@@ -6995,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 "সতরà§à¦•তা!"
@@ -7040,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 "
@@ -7058,9 +7352,62 @@ msgstr ""
#~ msgid "Import assets to the project."
#~ msgstr "উপাদানসমূহ পà§à¦°à¦•লà§à¦ªà§‡ ইমà§à¦ªà§‹à¦°à§à¦Ÿ করà§à¦¨à¥¤"
-#, fuzzy
-#~ msgid "Project Settings (godot.cfg)"
-#~ msgstr "পà§à¦°à¦•লà§à¦ªà§‡à¦° সেটিংস (engine.cfg)"
+#~ 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 "পৃষà§à¦ à¦¤à¦²"
@@ -7282,9 +7629,6 @@ msgstr ""
#~ msgid "Trailing Silence:"
#~ msgstr "পরিশিষà§à¦Ÿ নীরবতা:"
-#~ msgid "Script"
-#~ msgstr "সà§à¦•à§à¦°à¦¿à¦ªà§à¦Ÿ"
-
#~ msgid "Script Export Mode:"
#~ msgstr "সà§à¦•à§à¦°à¦¿à¦ªà§à¦Ÿ à¦à¦•à§à¦¸à¦ªà§‹à¦°à§à¦Ÿ মোড:"
@@ -7318,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 6d7b245e58..7273e877a9 100644
--- a/editor/translations/ca.po
+++ b/editor/translations/ca.po
@@ -1,6 +1,5 @@
# Catalan translation of the Godot Engine editor
-# Copyright (C) 2007-2017 Juan Linietsky, Ariel Manzur
-# Copyright (C) 2014-2017 Godot Engine contributors (cf. AUTHORS.md)
+# 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.
#
# Roger BR <drai_kin@hotmail.com>, 2016.
@@ -545,7 +544,8 @@ msgid "Search:"
msgstr "Cerca:"
#: editor/asset_library_editor_plugin.cpp editor/code_editor.cpp
-#: editor/editor_help.cpp editor/plugins/script_editor_plugin.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"
@@ -591,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"
@@ -735,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"
@@ -845,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í"
@@ -947,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 ""
@@ -958,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"
@@ -1029,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í:"
@@ -1222,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"
@@ -1239,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:"
@@ -1410,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\" "
@@ -1478,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?"
@@ -1537,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..."
@@ -1577,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"
@@ -1630,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"
@@ -1658,84 +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 "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"
@@ -1825,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"
@@ -1848,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!"
@@ -1936,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"
@@ -1963,6 +1995,35 @@ 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:"
@@ -2218,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"
@@ -2246,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..."
@@ -2416,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."
@@ -2902,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
@@ -3564,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"
@@ -3613,17 +3675,6 @@ msgstr ""
msgid "Set Handle"
msgstr ""
-#: editor/plugins/color_ramp_editor_plugin.cpp
-#: editor/plugins/gradient_texture_editor_plugin.cpp
-msgid "Add/Remove Color Ramp Point"
-msgstr ""
-
-#: editor/plugins/color_ramp_editor_plugin.cpp
-#: editor/plugins/gradient_texture_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 ""
@@ -3655,9 +3706,33 @@ 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 ""
@@ -3928,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 ""
@@ -3940,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
@@ -3951,20 +4039,34 @@ msgstr ""
msgid "Generated Point Count:"
msgstr ""
+#: editor/plugins/particles_2d_editor_plugin.cpp
#: editor/plugins/particles_editor_plugin.cpp
-msgid "Node does not contain geometry."
+#, 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 (faces)."
+msgid "Node does not contain geometry."
msgstr ""
#: editor/plugins/particles_editor_plugin.cpp
-msgid "A processor material of type 'ParticlesMaterial' is required."
+msgid "Node does not contain geometry (faces)."
msgstr ""
#: editor/plugins/particles_editor_plugin.cpp
-msgid "Generating AABB"
+msgid "A processor material of type 'ParticlesMaterial' is required."
msgstr ""
#: editor/plugins/particles_editor_plugin.cpp
@@ -4020,16 +4122,19 @@ msgstr ""
msgid "Generate Visibility AABB"
msgstr ""
-#: editor/plugins/particles_editor_plugin.cpp
-#, fuzzy
-msgid "Generation Time (sec):"
-msgstr "Temps Mitjà (s)"
-
#: 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 ""
@@ -4084,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 ""
@@ -4237,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 ""
@@ -4325,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 ""
@@ -4362,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
@@ -4426,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"
@@ -4505,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 ""
@@ -4527,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 ""
@@ -4744,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
@@ -4832,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
@@ -4876,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 ""
@@ -4900,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"
@@ -4920,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 ""
@@ -5349,12 +5542,12 @@ msgstr ""
#: editor/project_manager.cpp
#, fuzzy
-msgid "Invalid project path, *.godot must not exist."
+msgid "Invalid project path, project.godot must not exist."
msgstr "El camí de Destinació ha d'existir."
#: editor/project_manager.cpp
#, fuzzy
-msgid "Invalid project path, *.godot must exist."
+msgid "Invalid project path, project.godot must exist."
msgstr "El camí de Destinació ha d'existir."
#: editor/project_manager.cpp
@@ -5366,7 +5559,7 @@ msgid "Invalid project path (changed anything?)."
msgstr ""
#: editor/project_manager.cpp
-msgid "Couldn't create *.godot project file in project path."
+msgid "Couldn't create project.godot in project path."
msgstr ""
#: editor/project_manager.cpp
@@ -5583,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"
@@ -5649,8 +5846,8 @@ msgstr ""
#: editor/project_settings.cpp
#, fuzzy
-msgid "Project Settings "
-msgstr "Configuració del Projecte"
+msgid "Project Settings (project.godot)"
+msgstr "Configuració del Projecte (engine.cfg)"
#: editor/project_settings.cpp editor/settings_config_dialog.cpp
msgid "General"
@@ -5768,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:"
@@ -5959,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 ""
@@ -6036,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 ""
@@ -6084,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
@@ -6869,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."
@@ -6960,12 +7222,6 @@ msgid ""
"Nothing is visible because meshes have not been assigned to draw passes."
msgstr ""
-#: scene/3d/particles.cpp
-msgid ""
-"A material to process the particles is not assigned, so no behavior is "
-"imprinted."
-msgstr ""
-
#: scene/3d/remote_transform.cpp
#, fuzzy
msgid "Path property must point to a valid Spatial node to work."
@@ -6987,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!"
@@ -7032,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 "
@@ -7050,9 +7320,16 @@ msgstr ""
#~ msgid "Import assets to the project."
#~ msgstr "Importa actius al projecte."
-#, fuzzy
-#~ msgid "Project Settings (godot.cfg)"
-#~ msgstr "Configuració del Projecte (engine.cfg)"
+#~ 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 "
diff --git a/editor/translations/cs.po b/editor/translations/cs.po
index 4643a9ac21..d2420e32ed 100644
--- a/editor/translations/cs.po
+++ b/editor/translations/cs.po
@@ -1,6 +1,5 @@
# Czech translation of the Godot Engine editor
-# Copyright (C) 2007-2017 Juan Linietsky, Ariel Manzur
-# Copyright (C) 2014-2017 Godot Engine contributors (cf. AUTHORS.md)
+# 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.
#
# Jan 'spl!te' Kondelík <j.kondelik@centrum.cz>, 2016.
@@ -542,7 +541,8 @@ msgid "Search:"
msgstr "Hledat:"
#: editor/asset_library_editor_plugin.cpp editor/code_editor.cpp
-#: editor/editor_help.cpp editor/plugins/script_editor_plugin.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"
@@ -588,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"
@@ -732,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"
@@ -841,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"
@@ -943,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 ""
@@ -954,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 ""
@@ -1024,8 +1026,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:"
@@ -1216,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 ""
@@ -1233,7 +1235,6 @@ msgid "Class:"
msgstr ""
#: editor/editor_help.cpp editor/scene_tree_editor.cpp
-#: editor/script_create_dialog.cpp
msgid "Inherits:"
msgstr ""
@@ -1404,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
@@ -1459,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 ""
@@ -1515,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 ""
@@ -1553,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 ""
@@ -1605,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 ""
@@ -1633,84 +1642,40 @@ msgid "Redo"
msgstr "Znovu"
#: editor/editor_node.cpp
-msgid "Run Script"
-msgstr "Spustit skript"
-
-#: editor/editor_node.cpp
-msgid "Project Settings"
-msgstr "Nastavení projektu"
-
-#: 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 "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."
+msgid "Tools"
msgstr ""
#: editor/editor_node.cpp
-msgid "Play Scene"
+msgid "Quit to Project List"
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 "Debug options"
+#: editor/editor_node.cpp editor/plugins/script_editor_plugin.cpp
+msgid "Debug"
msgstr ""
#: editor/editor_node.cpp
@@ -1781,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"
@@ -1802,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 ""
@@ -1890,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 ""
@@ -1917,6 +1948,34 @@ msgstr ""
msgid "Load Errors"
msgstr ""
+#: 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 "Installed Plugins:"
msgstr ""
@@ -2163,6 +2222,10 @@ msgid "Collapse all"
msgstr ""
#: editor/filesystem_dock.cpp
+msgid "Show In File Manager"
+msgstr ""
+
+#: editor/filesystem_dock.cpp
msgid "Instance"
msgstr ""
@@ -2191,10 +2254,6 @@ msgid "Info"
msgstr ""
#: editor/filesystem_dock.cpp
-msgid "Show In File Manager"
-msgstr ""
-
-#: editor/filesystem_dock.cpp
msgid "Re-Import.."
msgstr ""
@@ -2361,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
@@ -2836,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
@@ -3499,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"
@@ -3548,17 +3607,6 @@ msgstr ""
msgid "Set Handle"
msgstr ""
-#: editor/plugins/color_ramp_editor_plugin.cpp
-#: editor/plugins/gradient_texture_editor_plugin.cpp
-msgid "Add/Remove Color Ramp Point"
-msgstr ""
-
-#: editor/plugins/color_ramp_editor_plugin.cpp
-#: editor/plugins/gradient_texture_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 ""
@@ -3590,9 +3638,32 @@ 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 ""
@@ -3863,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 ""
@@ -3875,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
@@ -3886,20 +3970,33 @@ msgstr ""
msgid "Generated Point Count:"
msgstr ""
+#: editor/plugins/particles_2d_editor_plugin.cpp
#: editor/plugins/particles_editor_plugin.cpp
-msgid "Node does not contain geometry."
+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 (faces)."
+msgid "Node does not contain geometry."
msgstr ""
#: editor/plugins/particles_editor_plugin.cpp
-msgid "A processor material of type 'ParticlesMaterial' is required."
+msgid "Node does not contain geometry (faces)."
msgstr ""
#: editor/plugins/particles_editor_plugin.cpp
-msgid "Generating AABB"
+msgid "A processor material of type 'ParticlesMaterial' is required."
msgstr ""
#: editor/plugins/particles_editor_plugin.cpp
@@ -3954,12 +4051,16 @@ msgstr ""
msgid "Generate Visibility AABB"
msgstr ""
-#: editor/plugins/particles_editor_plugin.cpp
-msgid "Generation Time (sec):"
+#: editor/plugins/path_2d_editor_plugin.cpp
+msgid "Remove Point from Curve"
msgstr ""
#: editor/plugins/path_2d_editor_plugin.cpp
-msgid "Remove Point from Curve"
+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
@@ -4017,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 ""
@@ -4170,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 ""
@@ -4258,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 ""
@@ -4295,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
@@ -4359,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"
@@ -4438,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 ""
@@ -4460,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 ""
@@ -4677,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
@@ -4765,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
@@ -4809,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
@@ -4853,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 ""
@@ -5277,11 +5459,11 @@ msgid "Invalid project path, the path must exist!"
msgstr ""
#: editor/project_manager.cpp
-msgid "Invalid project path, *.godot must not exist."
+msgid "Invalid project path, project.godot must not exist."
msgstr ""
#: editor/project_manager.cpp
-msgid "Invalid project path, *.godot must exist."
+msgid "Invalid project path, project.godot must exist."
msgstr ""
#: editor/project_manager.cpp
@@ -5293,7 +5475,7 @@ msgid "Invalid project path (changed anything?)."
msgstr ""
#: editor/project_manager.cpp
-msgid "Couldn't create *.godot project file in project path."
+msgid "Couldn't create project.godot in project path."
msgstr ""
#: editor/project_manager.cpp
@@ -5510,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í"
@@ -5576,7 +5762,7 @@ msgstr ""
#: editor/project_settings.cpp
#, fuzzy
-msgid "Project Settings "
+msgid "Project Settings (project.godot)"
msgstr "Nastavení projektu"
#: editor/project_settings.cpp editor/settings_config_dialog.cpp
@@ -5692,10 +5878,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žit uzly"
@@ -5883,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 ""
@@ -5960,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 ""
@@ -6008,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 ""
@@ -6779,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."
@@ -6867,12 +7114,6 @@ msgid ""
"Nothing is visible because meshes have not been assigned to draw passes."
msgstr ""
-#: scene/3d/particles.cpp
-msgid ""
-"A material to process the particles is not assigned, so no behavior is "
-"imprinted."
-msgstr ""
-
#: scene/3d/remote_transform.cpp
#, fuzzy
msgid "Path property must point to a valid Spatial node to work."
@@ -6895,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!"
@@ -6940,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 "
@@ -6952,9 +7207,10 @@ 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í."
-#, fuzzy
-#~ msgid "Project Settings (godot.cfg)"
-#~ msgstr "Nastavení projektu"
+#~ 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 "
diff --git a/editor/translations/da.po b/editor/translations/da.po
index ba9d018e5a..51a0b05e3b 100644
--- a/editor/translations/da.po
+++ b/editor/translations/da.po
@@ -1,6 +1,5 @@
# Danish translation of the Godot Engine editor
-# Copyright (C) 2007-2017 Juan Linietsky, Ariel Manzur
-# Copyright (C) 2014-2017 Godot Engine contributors (cf. AUTHORS.md)
+# 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.
#
# David Lamhauge <davidlamhauge@gmail.com>, 2016.
@@ -540,7 +539,8 @@ msgid "Search:"
msgstr "Søgning:"
#: editor/asset_library_editor_plugin.cpp editor/code_editor.cpp
-#: editor/editor_help.cpp editor/plugins/script_editor_plugin.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"
@@ -586,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"
@@ -730,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"
@@ -839,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"
@@ -939,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 ""
@@ -950,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 ""
@@ -1018,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:"
@@ -1210,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 ""
@@ -1227,7 +1229,6 @@ msgid "Class:"
msgstr ""
#: editor/editor_help.cpp editor/scene_tree_editor.cpp
-#: editor/script_create_dialog.cpp
msgid "Inherits:"
msgstr ""
@@ -1398,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
@@ -1453,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 ""
@@ -1509,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 ""
@@ -1547,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 ""
@@ -1599,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 ""
@@ -1627,35 +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"
+msgid "Miscellaneous project or scene-wide tools."
msgstr ""
#: editor/editor_node.cpp
-msgid "Distraction Free Mode"
+msgid "Project"
msgstr ""
#: editor/editor_node.cpp
-msgid "Miscellaneous project or scene-wide tools."
-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
@@ -1663,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
@@ -1774,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"
@@ -1795,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
@@ -1883,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 ""
@@ -1910,6 +1940,34 @@ msgstr ""
msgid "Load Errors"
msgstr ""
+#: 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 "Installed Plugins:"
msgstr ""
@@ -2155,6 +2213,10 @@ msgid "Collapse all"
msgstr ""
#: editor/filesystem_dock.cpp
+msgid "Show In File Manager"
+msgstr ""
+
+#: editor/filesystem_dock.cpp
msgid "Instance"
msgstr ""
@@ -2183,10 +2245,6 @@ msgid "Info"
msgstr ""
#: editor/filesystem_dock.cpp
-msgid "Show In File Manager"
-msgstr ""
-
-#: editor/filesystem_dock.cpp
msgid "Re-Import.."
msgstr ""
@@ -2353,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
@@ -2828,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
@@ -3490,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"
@@ -3539,17 +3597,6 @@ msgstr ""
msgid "Set Handle"
msgstr ""
-#: editor/plugins/color_ramp_editor_plugin.cpp
-#: editor/plugins/gradient_texture_editor_plugin.cpp
-msgid "Add/Remove Color Ramp Point"
-msgstr ""
-
-#: editor/plugins/color_ramp_editor_plugin.cpp
-#: editor/plugins/gradient_texture_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 ""
@@ -3581,9 +3628,32 @@ 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 ""
@@ -3854,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 ""
@@ -3866,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
@@ -3877,20 +3960,33 @@ msgstr ""
msgid "Generated Point Count:"
msgstr ""
+#: editor/plugins/particles_2d_editor_plugin.cpp
#: editor/plugins/particles_editor_plugin.cpp
-msgid "Node does not contain geometry."
+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 (faces)."
+msgid "Node does not contain geometry."
msgstr ""
#: editor/plugins/particles_editor_plugin.cpp
-msgid "A processor material of type 'ParticlesMaterial' is required."
+msgid "Node does not contain geometry (faces)."
msgstr ""
#: editor/plugins/particles_editor_plugin.cpp
-msgid "Generating AABB"
+msgid "A processor material of type 'ParticlesMaterial' is required."
msgstr ""
#: editor/plugins/particles_editor_plugin.cpp
@@ -3945,12 +4041,16 @@ msgstr ""
msgid "Generate Visibility AABB"
msgstr ""
-#: editor/plugins/particles_editor_plugin.cpp
-msgid "Generation Time (sec):"
+#: editor/plugins/path_2d_editor_plugin.cpp
+msgid "Remove Point from Curve"
msgstr ""
#: editor/plugins/path_2d_editor_plugin.cpp
-msgid "Remove Point from Curve"
+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
@@ -4008,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 ""
@@ -4161,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 ""
@@ -4249,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 ""
@@ -4286,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
@@ -4350,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"
@@ -4429,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 ""
@@ -4451,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 ""
@@ -4668,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 "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
@@ -4756,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 "Use Default sRGB"
+msgid "Local Coords"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Transform Dialog.."
msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
@@ -4800,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
@@ -4844,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 ""
@@ -5265,11 +5447,11 @@ msgid "Invalid project path, the path must exist!"
msgstr ""
#: editor/project_manager.cpp
-msgid "Invalid project path, *.godot must not exist."
+msgid "Invalid project path, project.godot must not exist."
msgstr ""
#: editor/project_manager.cpp
-msgid "Invalid project path, *.godot must exist."
+msgid "Invalid project path, project.godot must exist."
msgstr ""
#: editor/project_manager.cpp
@@ -5281,7 +5463,7 @@ msgid "Invalid project path (changed anything?)."
msgstr ""
#: editor/project_manager.cpp
-msgid "Couldn't create *.godot project file in project path."
+msgid "Couldn't create project.godot in project path."
msgstr ""
#: editor/project_manager.cpp
@@ -5498,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"
@@ -5563,7 +5749,7 @@ msgid "Remove Resource Remap Option"
msgstr ""
#: editor/project_settings.cpp
-msgid "Project Settings "
+msgid "Project Settings (project.godot)"
msgstr ""
#: editor/project_settings.cpp editor/settings_config_dialog.cpp
@@ -5679,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:"
@@ -5870,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 ""
@@ -5945,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 ""
@@ -5993,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
@@ -6756,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."
@@ -6844,12 +7092,6 @@ msgid ""
"Nothing is visible because meshes have not been assigned to draw passes."
msgstr ""
-#: scene/3d/particles.cpp
-msgid ""
-"A material to process the particles is not assigned, so no behavior is "
-"imprinted."
-msgstr ""
-
#: scene/3d/remote_transform.cpp
#, fuzzy
msgid "Path property must point to a valid Spatial node to work."
@@ -6870,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!"
@@ -6915,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 "
@@ -6927,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 a10eaefa29..894f7b6028 100644
--- a/editor/translations/de.po
+++ b/editor/translations/de.po
@@ -1,6 +1,5 @@
# German translation of the Godot Engine editor
-# Copyright (C) 2007-2017 Juan Linietsky, Ariel Manzur
-# Copyright (C) 2014-2017 Godot Engine contributors (cf. AUTHORS.md)
+# 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.
#
# Alexander Mahr <alex.mahr@gmail.com>, 2016.
@@ -25,8 +24,8 @@ msgid ""
msgstr ""
"Project-Id-Version: Godot Engine editor\n"
"POT-Creation-Date: \n"
-"PO-Revision-Date: 2017-03-25 22:20+0000\n"
-"Last-Translator: Eurocloud KnowHow <tobias.kloy@werde-volunteer.info>\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"
"Language: de\n"
@@ -34,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.12\n"
+"X-Generator: Weblate 2.13-dev\n"
#: editor/animation_editor.cpp
msgid "Disabled"
@@ -562,7 +561,8 @@ msgid "Search:"
msgstr "Suche:"
#: editor/asset_library_editor_plugin.cpp editor/code_editor.cpp
-#: editor/editor_help.cpp editor/plugins/script_editor_plugin.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"
@@ -608,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"
@@ -754,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"
@@ -863,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"
@@ -952,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"
@@ -978,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"
@@ -1052,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:"
@@ -1121,7 +1123,7 @@ msgstr "Packe"
#: 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:"
@@ -1245,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"
@@ -1262,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:"
@@ -1432,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“."
@@ -1499,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?"
@@ -1557,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"
@@ -1600,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"
@@ -1653,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"
@@ -1681,84 +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 "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 "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"
+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"
@@ -1848,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"
@@ -1870,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!"
@@ -1958,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"
@@ -1985,6 +2024,36 @@ 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:"
@@ -2123,7 +2192,7 @@ msgstr "Herunter"
#: editor/export_template_manager.cpp
msgid "(Missing)"
-msgstr ""
+msgstr "(Fehlend)"
#: editor/export_template_manager.cpp
#, fuzzy
@@ -2132,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."
@@ -2140,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
@@ -2208,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."
@@ -2241,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"
@@ -2272,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.."
@@ -2442,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."
@@ -2657,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"
@@ -2927,7 +2999,7 @@ msgstr "Komprimieren"
#: editor/io_plugins/editor_translation_import_plugin.cpp
#, fuzzy
-msgid "Add to Project (godot.cfg)"
+msgid "Add to Project (project.godot)"
msgstr "Zu Projekt hinzufügen (engine.cfg)"
#: editor/io_plugins/editor_translation_import_plugin.cpp
@@ -3594,7 +3666,7 @@ 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"
@@ -3645,17 +3717,6 @@ msgstr "Polygon3D erstellen"
msgid "Set Handle"
msgstr "Wähle Griff"
-#: editor/plugins/color_ramp_editor_plugin.cpp
-#: editor/plugins/gradient_texture_editor_plugin.cpp
-msgid "Add/Remove Color Ramp Point"
-msgstr "Farbverlaufspunkt hinzufügen/entfernen"
-
-#: editor/plugins/color_ramp_editor_plugin.cpp
-#: editor/plugins/gradient_texture_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"
@@ -3688,9 +3749,33 @@ 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"
@@ -3965,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:"
@@ -3977,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"
@@ -3988,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."
@@ -3998,12 +4118,7 @@ msgstr "Knoten 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
-#, fuzzy
-msgid "Generating AABB"
-msgstr "Erzeuge AABB"
+msgstr "Ein Verarbeitungsmaterial des Typs ‚ParticlesMaterial‘ wird benötigt."
#: editor/plugins/particles_editor_plugin.cpp
msgid "Faces contain no area!"
@@ -4047,7 +4162,7 @@ msgstr "Oberfläche %d"
#: editor/plugins/particles_editor_plugin.cpp
msgid "Surface Points+Normal (Directed)"
-msgstr ""
+msgstr "Oberflächenpunkte + Normale (gerichtet)"
#: editor/plugins/particles_editor_plugin.cpp
msgid "Volume"
@@ -4063,13 +4178,18 @@ msgstr "Emissionsfüllung:"
msgid "Generate Visibility AABB"
msgstr "Erzeuge AABB"
-#: editor/plugins/particles_editor_plugin.cpp
+#: 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 "Generation Time (sec):"
-msgstr "Durchschnittszeit (Sek)"
+msgid "Remove Out-Control from Curve"
+msgstr "Ausgangsgriff auf Kurve verschieben"
#: editor/plugins/path_2d_editor_plugin.cpp
-msgid "Remove Point from Curve"
+#, fuzzy
+msgid "Remove In-Control from Curve"
msgstr "Punkt von Kurve entfernen"
#: editor/plugins/path_2d_editor_plugin.cpp
@@ -4127,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"
@@ -4280,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"
@@ -4367,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"
@@ -4404,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."
@@ -4472,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"
@@ -4551,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"
@@ -4573,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"
@@ -4790,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
+#, fuzzy
+msgid "View Environment"
+msgstr "Umgebung"
+
+#: editor/plugins/spatial_editor_plugin.cpp
+#, fuzzy
+msgid "View Gizmos"
+msgstr "Gizmos"
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "No scene selected to instance!"
-msgstr "Keine Szene für Instanz ausgewählt!"
+msgid "View Information"
+msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Instance at Cursor"
-msgstr "Instanz am Mauszeiger"
+msgid "Audio Listener"
+msgstr "Audiosenke"
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Could not instance scene!"
-msgstr "Konnte Szene nicht instantiieren!"
+msgid "XForm Dialog"
+msgstr "Transformationsdialog"
#: editor/plugins/spatial_editor_plugin.cpp
msgid "Move Mode (W)"
@@ -4878,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"
@@ -4890,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"
@@ -4922,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"
@@ -4946,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"
@@ -4966,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):"
@@ -5391,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
@@ -5404,12 +5621,12 @@ msgstr "Ungültiger Projektpfad, der Pfad muss existieren!"
#: editor/project_manager.cpp
#, fuzzy
-msgid "Invalid project path, *.godot must not exist."
+msgid "Invalid project path, project.godot must not exist."
msgstr "Ungültiger Projektpfad, engine.cfg darf nicht existieren."
#: editor/project_manager.cpp
#, fuzzy
-msgid "Invalid project path, *.godot must exist."
+msgid "Invalid project path, project.godot must exist."
msgstr "Ungültiger Projektpfad, engine.cfg muss existieren."
#: editor/project_manager.cpp
@@ -5422,7 +5639,7 @@ msgstr "Ungültiger Projektpfad (etwas geändert?)."
#: editor/project_manager.cpp
#, fuzzy
-msgid "Couldn't create *.godot project file in project path."
+msgid "Couldn't create project.godot in project path."
msgstr "Konnte engine.cfg in Projektpfad nicht erzeugen."
#: editor/project_manager.cpp
@@ -5643,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"
@@ -5709,8 +5931,8 @@ msgstr "Ressourcen-Remap-Option entfernen"
#: editor/project_settings.cpp
#, fuzzy
-msgid "Project Settings "
-msgstr "Projekteinstellungen"
+msgid "Project Settings (project.godot)"
+msgstr "Projekteinstellungen (engine.cfg)"
#: editor/project_settings.cpp editor/settings_config_dialog.cpp
msgid "General"
@@ -5827,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"
@@ -5980,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."
@@ -6023,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"
@@ -6081,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."
@@ -6100,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:"
@@ -6149,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
@@ -6739,7 +7029,7 @@ msgstr "Durchstöbern"
#: platform/javascript/export/export.cpp
msgid "Run exported HTML in the system's default browser."
-msgstr ""
+msgstr "Führe exportiertes HTML im Standard-Browser des Betriebssystems aus."
#: platform/javascript/export/export.cpp
#, fuzzy
@@ -6929,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."
@@ -7020,12 +7312,6 @@ msgid ""
"Nothing is visible because meshes have not been assigned to draw passes."
msgstr ""
-#: scene/3d/particles.cpp
-msgid ""
-"A material to process the particles is not assigned, so no behavior is "
-"imprinted."
-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."
@@ -7045,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!"
@@ -7090,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 ""
@@ -7110,9 +7416,63 @@ msgstr ""
#~ msgid "Import assets to the project."
#~ msgstr "Importiere Medieninhalte ins Projekt."
-#, fuzzy
-#~ msgid "Project Settings (godot.cfg)"
-#~ msgstr "Projekteinstellungen (engine.cfg)"
+#~ 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"
@@ -7334,9 +7694,6 @@ msgstr ""
#~ msgid "Trailing Silence:"
#~ msgstr "Auslaufende Stille:"
-#~ msgid "Script"
-#~ msgstr "Skript"
-
#~ msgid "Script Export Mode:"
#~ msgstr "Skript-Exportmodus:"
@@ -7370,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"
@@ -7408,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 183f09e9a6..15b70b2172 100644
--- a/editor/translations/de_CH.po
+++ b/editor/translations/de_CH.po
@@ -1,6 +1,5 @@
# Swiss High German translation of the Godot Engine editor
-# Copyright (C) 2007-2017 Juan Linietsky, Ariel Manzur
-# Copyright (C) 2014-2017 Godot Engine contributors (cf. AUTHORS.md)
+# 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.
#
# Christian Fisch <christian.fiesel@gmail.com>, 2016.
@@ -536,7 +535,8 @@ msgid "Search:"
msgstr ""
#: editor/asset_library_editor_plugin.cpp editor/code_editor.cpp
-#: editor/editor_help.cpp editor/plugins/script_editor_plugin.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"
@@ -582,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 ""
@@ -726,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 ""
@@ -831,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 ""
@@ -931,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 ""
@@ -942,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 ""
@@ -1010,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 ""
@@ -1202,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 ""
@@ -1219,7 +1221,6 @@ msgid "Class:"
msgstr ""
#: editor/editor_help.cpp editor/scene_tree_editor.cpp
-#: editor/script_create_dialog.cpp
msgid "Inherits:"
msgstr ""
@@ -1389,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
@@ -1444,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 ""
@@ -1500,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 ""
@@ -1538,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 ""
@@ -1591,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 ""
@@ -1619,84 +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 "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
@@ -1770,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
@@ -1791,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 ""
@@ -1879,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 ""
@@ -1906,6 +1937,32 @@ msgstr ""
msgid "Load Errors"
msgstr ""
+#: 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 "Installed Plugins:"
msgstr ""
@@ -2151,6 +2208,10 @@ msgid "Collapse all"
msgstr ""
#: editor/filesystem_dock.cpp
+msgid "Show In File Manager"
+msgstr ""
+
+#: editor/filesystem_dock.cpp
msgid "Instance"
msgstr ""
@@ -2179,10 +2240,6 @@ msgid "Info"
msgstr ""
#: editor/filesystem_dock.cpp
-msgid "Show In File Manager"
-msgstr ""
-
-#: editor/filesystem_dock.cpp
msgid "Re-Import.."
msgstr ""
@@ -2349,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
@@ -2829,7 +2886,7 @@ msgstr ""
#: editor/io_plugins/editor_translation_import_plugin.cpp
#, fuzzy
-msgid "Add to Project (godot.cfg)"
+msgid "Add to Project (project.godot)"
msgstr "Zum Projekt hinzufügen (engine.cfg)"
#: editor/io_plugins/editor_translation_import_plugin.cpp
@@ -3500,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"
@@ -3549,17 +3606,6 @@ msgstr ""
msgid "Set Handle"
msgstr ""
-#: editor/plugins/color_ramp_editor_plugin.cpp
-#: editor/plugins/gradient_texture_editor_plugin.cpp
-msgid "Add/Remove Color Ramp Point"
-msgstr ""
-
-#: editor/plugins/color_ramp_editor_plugin.cpp
-#: editor/plugins/gradient_texture_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 ""
@@ -3591,9 +3637,32 @@ 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 ""
@@ -3864,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 ""
@@ -3876,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"
@@ -3888,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 ""
@@ -3901,10 +4002,6 @@ msgid "A processor material of type 'ParticlesMaterial' is required."
msgstr ""
#: editor/plugins/particles_editor_plugin.cpp
-msgid "Generating AABB"
-msgstr ""
-
-#: editor/plugins/particles_editor_plugin.cpp
msgid "Faces contain no area!"
msgstr "Flächen enthalten keinen Bereich!"
@@ -3958,12 +4055,16 @@ msgstr ""
msgid "Generate Visibility AABB"
msgstr ""
-#: editor/plugins/particles_editor_plugin.cpp
-msgid "Generation Time (sec):"
+#: editor/plugins/path_2d_editor_plugin.cpp
+msgid "Remove Point from Curve"
msgstr ""
#: editor/plugins/path_2d_editor_plugin.cpp
-msgid "Remove Point from Curve"
+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
@@ -4021,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 ""
@@ -4174,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 ""
@@ -4261,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 ""
@@ -4298,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
@@ -4361,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"
@@ -4440,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 ""
@@ -4462,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 ""
@@ -4679,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 "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
@@ -4768,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
@@ -4856,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 ""
@@ -5279,12 +5459,12 @@ msgstr "Ungültiger Projektpfad, Pfad existiert nicht!"
#: editor/project_manager.cpp
#, fuzzy
-msgid "Invalid project path, *.godot must not exist."
+msgid "Invalid project path, project.godot must not exist."
msgstr "Ungültiger Projektpfad, engine.cfg vorhanden!"
#: editor/project_manager.cpp
#, fuzzy
-msgid "Invalid project path, *.godot must exist."
+msgid "Invalid project path, project.godot must exist."
msgstr "Ungültiger Projektpfad, engine.cfg nicht vorhanden!"
#: editor/project_manager.cpp
@@ -5297,7 +5477,7 @@ msgstr "Ungültiger Projektpfad, (wurde was geändert?)!"
#: editor/project_manager.cpp
#, fuzzy
-msgid "Couldn't create *.godot project file in project path."
+msgid "Couldn't create project.godot in project path."
msgstr "Die engine.cfg kann im Projektverzeichnis nicht erstellt werden."
#: editor/project_manager.cpp
@@ -5514,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 ""
@@ -5580,7 +5764,7 @@ msgstr ""
#: editor/project_settings.cpp
#, fuzzy
-msgid "Project Settings "
+msgid "Project Settings (project.godot)"
msgstr "Projekteinstellungen"
#: editor/project_settings.cpp editor/settings_config_dialog.cpp
@@ -5697,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"
@@ -5887,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 ""
@@ -5964,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 ""
@@ -6012,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
@@ -6762,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."
@@ -6838,12 +7080,6 @@ msgid ""
"Nothing is visible because meshes have not been assigned to draw passes."
msgstr ""
-#: scene/3d/particles.cpp
-msgid ""
-"A material to process the particles is not assigned, so no behavior is "
-"imprinted."
-msgstr ""
-
#: scene/3d/remote_transform.cpp
#, fuzzy
msgid "Path property must point to a valid Spatial node to work."
@@ -6860,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!"
@@ -6902,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 "
@@ -6916,9 +7167,12 @@ msgstr ""
#~ msgid "Import assets to the project."
#~ msgstr "Assets zum Projekt importieren."
-#, fuzzy
-#~ msgid "Project Settings (godot.cfg)"
-#~ msgstr "Projekteinstellungen"
+#~ 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"
diff --git a/editor/translations/editor.pot b/editor/translations/editor.pot
index 5f50c159b8..9821ef4e01 100644
--- a/editor/translations/editor.pot
+++ b/editor/translations/editor.pot
@@ -526,7 +526,8 @@ msgid "Search:"
msgstr ""
#: editor/asset_library_editor_plugin.cpp editor/code_editor.cpp
-#: editor/editor_help.cpp editor/plugins/script_editor_plugin.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"
@@ -572,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 ""
@@ -715,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 ""
@@ -820,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 ""
@@ -920,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 ""
@@ -931,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 ""
@@ -999,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 ""
@@ -1191,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 ""
@@ -1208,7 +1211,6 @@ msgid "Class:"
msgstr ""
#: editor/editor_help.cpp editor/scene_tree_editor.cpp
-#: editor/script_create_dialog.cpp
msgid "Inherits:"
msgstr ""
@@ -1378,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
@@ -1433,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 ""
@@ -1489,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 ""
@@ -1527,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 ""
@@ -1579,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 ""
@@ -1607,35 +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"
+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
@@ -1643,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
@@ -1754,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
@@ -1775,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
@@ -1863,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 ""
@@ -1890,6 +1920,30 @@ 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
+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 ""
@@ -2133,6 +2187,10 @@ msgid "Collapse all"
msgstr ""
#: editor/filesystem_dock.cpp
+msgid "Show In File Manager"
+msgstr ""
+
+#: editor/filesystem_dock.cpp
msgid "Instance"
msgstr ""
@@ -2161,10 +2219,6 @@ msgid "Info"
msgstr ""
#: editor/filesystem_dock.cpp
-msgid "Show In File Manager"
-msgstr ""
-
-#: editor/filesystem_dock.cpp
msgid "Re-Import.."
msgstr ""
@@ -2330,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
@@ -2805,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
@@ -3465,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 ""
@@ -3514,17 +3568,6 @@ msgstr ""
msgid "Set Handle"
msgstr ""
-#: editor/plugins/color_ramp_editor_plugin.cpp
-#: editor/plugins/gradient_texture_editor_plugin.cpp
-msgid "Add/Remove Color Ramp Point"
-msgstr ""
-
-#: editor/plugins/color_ramp_editor_plugin.cpp
-#: editor/plugins/gradient_texture_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 ""
@@ -3556,9 +3599,30 @@ 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 ""
@@ -3828,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 ""
@@ -3840,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
@@ -3851,20 +3928,33 @@ msgstr ""
msgid "Generated Point Count:"
msgstr ""
+#: editor/plugins/particles_2d_editor_plugin.cpp
#: editor/plugins/particles_editor_plugin.cpp
-msgid "Node does not contain geometry."
+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 (faces)."
+msgid "Node does not contain geometry."
msgstr ""
#: editor/plugins/particles_editor_plugin.cpp
-msgid "A processor material of type 'ParticlesMaterial' is required."
+msgid "Node does not contain geometry (faces)."
msgstr ""
#: editor/plugins/particles_editor_plugin.cpp
-msgid "Generating AABB"
+msgid "A processor material of type 'ParticlesMaterial' is required."
msgstr ""
#: editor/plugins/particles_editor_plugin.cpp
@@ -3919,12 +4009,16 @@ msgstr ""
msgid "Generate Visibility AABB"
msgstr ""
-#: editor/plugins/particles_editor_plugin.cpp
-msgid "Generation Time (sec):"
+#: editor/plugins/path_2d_editor_plugin.cpp
+msgid "Remove Point from Curve"
msgstr ""
#: editor/plugins/path_2d_editor_plugin.cpp
-msgid "Remove Point from Curve"
+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
@@ -3982,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 ""
@@ -4135,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 ""
@@ -4222,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 ""
@@ -4259,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
@@ -4322,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"
@@ -4401,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 ""
@@ -4423,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 ""
@@ -4640,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 "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
@@ -4728,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
@@ -4816,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 ""
@@ -5236,11 +5406,11 @@ msgid "Invalid project path, the path must exist!"
msgstr ""
#: editor/project_manager.cpp
-msgid "Invalid project path, *.godot must not exist."
+msgid "Invalid project path, project.godot must not exist."
msgstr ""
#: editor/project_manager.cpp
-msgid "Invalid project path, *.godot must exist."
+msgid "Invalid project path, project.godot must exist."
msgstr ""
#: editor/project_manager.cpp
@@ -5252,7 +5422,7 @@ msgid "Invalid project path (changed anything?)."
msgstr ""
#: editor/project_manager.cpp
-msgid "Couldn't create *.godot project file in project path."
+msgid "Couldn't create project.godot in project path."
msgstr ""
#: editor/project_manager.cpp
@@ -5468,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 ""
@@ -5533,7 +5707,7 @@ msgid "Remove Resource Remap Option"
msgstr ""
#: editor/project_settings.cpp
-msgid "Project Settings "
+msgid "Project Settings (project.godot)"
msgstr ""
#: editor/project_settings.cpp editor/settings_config_dialog.cpp
@@ -5649,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 ""
@@ -5837,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 ""
@@ -5911,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 ""
@@ -5959,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 file"
+msgstr ""
+
+#: editor/script_create_dialog.cpp
+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
@@ -6679,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
@@ -6748,12 +6978,6 @@ msgid ""
"Nothing is visible because meshes have not been assigned to draw passes."
msgstr ""
-#: scene/3d/particles.cpp
-msgid ""
-"A material to process the particles is not assigned, so no behavior is "
-"imprinted."
-msgstr ""
-
#: scene/3d/remote_transform.cpp
msgid "Path property must point to a valid Spatial node to work."
msgstr ""
@@ -6769,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 ""
@@ -6811,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
index 0879b693ff..bd95d6e6f6 100644
--- a/editor/translations/el.po
+++ b/editor/translations/el.po
@@ -1,6 +1,5 @@
# Greek translation of the Godot Engine editor
-# Copyright (C) 2007-2017 Juan Linietsky, Ariel Manzur
-# Copyright (C) 2014-2017 Godot Engine contributors (cf. AUTHORS.md)
+# 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.
@@ -8,7 +7,7 @@
msgid ""
msgstr ""
"Project-Id-Version: Godot Engine editor\n"
-"PO-Revision-Date: 2017-02-15 17:48+0000\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"
@@ -16,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.12-dev\n"
+"X-Generator: Weblate 2.15-dev\n"
#: editor/animation_editor.cpp
msgid "Disabled"
@@ -83,9 +82,8 @@ msgid "Anim Track Change Value Mode"
msgstr "Anim ΛειτουÏγία αλλαγής τιμής κομματιοÏ"
#: editor/animation_editor.cpp
-#, fuzzy
msgid "Anim Track Change Wrap Mode"
-msgstr "Anim ΛειτουÏγία αλλαγής τιμής κομματιοÏ"
+msgstr "Αλλαγή λειτουÏγίας αναδίπλωσης ÎºÎ¿Î¼Î¼Î±Ï„Î¹Î¿Ï ÎºÎ¯Î½Î·ÏƒÎ·Ï‚"
#: editor/animation_editor.cpp
msgid "Edit Node Curve"
@@ -255,7 +253,7 @@ msgstr "Βήμα (s):"
#: editor/animation_editor.cpp
msgid "Cursor step snap (in seconds)."
-msgstr "Βήμα κλειδώματος δείκτη (σε δευτεÏόλεπτα)."
+msgstr "Βήμα κουμπώματος δÏομέα (σε δευτεÏόλεπτα)."
#: editor/animation_editor.cpp
msgid "Enable/Disable looping in animation."
@@ -365,7 +363,7 @@ msgstr ""
#: editor/asset_library_editor_plugin.cpp editor/editor_plugin_settings.cpp
msgid "Version:"
-msgstr ""
+msgstr "Έκδοση:"
#: editor/asset_library_editor_plugin.cpp
#, fuzzy
@@ -375,7 +373,7 @@ msgstr "ΣταθεÏές:"
#: editor/asset_library_editor_plugin.cpp
#, fuzzy
msgid "View Files"
-msgstr "ΑÏχείο:"
+msgstr " ΑÏχεία"
#: editor/asset_library_editor_plugin.cpp editor/create_dialog.cpp
#: editor/editor_help.cpp editor/property_selector.cpp
@@ -385,7 +383,7 @@ msgstr "ΠεÏιγÏαφή:"
#: editor/asset_library_editor_plugin.cpp editor/project_manager.cpp
msgid "Install"
-msgstr ""
+msgstr "Εγκατάσταση"
#: editor/asset_library_editor_plugin.cpp editor/call_dialog.cpp
#: editor/connections_dialog.cpp editor/export_template_manager.cpp
@@ -481,8 +479,9 @@ msgid "Fetching:"
msgstr ""
#: editor/asset_library_editor_plugin.cpp
+#, fuzzy
msgid "Resolving.."
-msgstr ""
+msgstr "Αποθήκευση..."
#: editor/asset_library_editor_plugin.cpp
#, fuzzy
@@ -508,8 +507,9 @@ msgid "Retry"
msgstr ""
#: editor/asset_library_editor_plugin.cpp
+#, fuzzy
msgid "Download Error"
-msgstr ""
+msgstr "Λήψη"
#: editor/asset_library_editor_plugin.cpp
msgid "Download for this asset is already in progress!"
@@ -543,7 +543,8 @@ msgid "Search:"
msgstr "Αναζήτηση:"
#: editor/asset_library_editor_plugin.cpp editor/code_editor.cpp
-#: editor/editor_help.cpp editor/plugins/script_editor_plugin.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"
@@ -563,7 +564,7 @@ msgstr "Εισαγωγή"
#: editor/asset_library_editor_plugin.cpp editor/project_settings.cpp
msgid "Plugins"
-msgstr ""
+msgstr "ΠÏόσθετα"
#: editor/asset_library_editor_plugin.cpp
msgid "Sort:"
@@ -589,7 +590,7 @@ msgstr "ΥποστήÏιξη.."
msgid "Official"
msgstr "Επίσημα"
-#: editor/asset_library_editor_plugin.cpp
+#: editor/asset_library_editor_plugin.cpp editor/editor_node.cpp
msgid "Community"
msgstr "Κοινότητα"
@@ -634,7 +635,6 @@ msgid "No Matches"
msgstr "Δεν υπάÏχουν αντιστοιχίες"
#: editor/code_editor.cpp
-#, fuzzy
msgid "Replaced %d occurrence(s)."
msgstr "Αντικαταστάθηκαν %d εμφανίσεις."
@@ -719,8 +719,8 @@ msgid ""
"Target method not found! Specify a valid method or attach a script to target "
"Node."
msgstr ""
-"Η στοχευμένη συνάÏτηση δεν βÏέθηκε! ΟÏίστε μία έγκυÏη μέθοδο ή συνδέστε ένα "
-"script στον στοχευμένο κόμβο."
+"Η στοχευμένη συνάÏτηση δεν βÏέθηκε! ΟÏίστε μία έγκυÏη μέθοδο ή συνδέστε μία "
+"δεσμή ενεÏγειών στον στοχευμένο κόμβο."
#: editor/connections_dialog.cpp
msgid "Connect To Node:"
@@ -735,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 "ΑφαίÏεση"
@@ -844,6 +845,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 "ΔιαδÏομή"
@@ -932,33 +934,33 @@ 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
msgid "Add Bus"
-msgstr ""
+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."
@@ -1027,8 +1029,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 "ΔιαδÏομή:"
@@ -1043,7 +1044,6 @@ msgid "Name"
msgstr "Όνομα"
#: editor/editor_autoload_settings.cpp
-#, fuzzy
msgid "Singleton"
msgstr "ΜονοσÏνολο"
@@ -1088,7 +1088,6 @@ msgid "Choose"
msgstr "Επιλέξτε"
#: editor/editor_export.cpp
-#, fuzzy
msgid "Storing File:"
msgstr "ΑÏχείο αποθήκευσης:"
@@ -1098,7 +1097,7 @@ msgstr "ΠακετάÏισμα"
#: editor/editor_export.cpp platform/javascript/export/export.cpp
msgid "Template file not found:\n"
-msgstr ""
+msgstr "Δεν βÏέθηκε το αÏχείο Ï€ÏοτÏπου:\n"
#: editor/editor_export.cpp
msgid "Added:"
@@ -1181,9 +1180,8 @@ msgid "Toggle Mode"
msgstr "Εναλλαγή λειτουÏγίας"
#: editor/editor_file_dialog.cpp
-#, fuzzy
msgid "Focus Path"
-msgstr "ΕπικέντÏωση στη διαδÏομή"
+msgstr "Εστίαση στη διαδÏομή"
#: editor/editor_file_dialog.cpp
msgid "Move Favorite Up"
@@ -1219,11 +1217,11 @@ 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 "Αναζήτηση βοήθειας"
@@ -1240,7 +1238,6 @@ msgid "Class:"
msgstr "Κλάση:"
#: editor/editor_help.cpp editor/scene_tree_editor.cpp
-#: editor/script_create_dialog.cpp
msgid "Inherits:"
msgstr "ΚληÏονομεί:"
@@ -1338,7 +1335,7 @@ msgstr "ΔημιουÏγία μικÏογÏαφίας"
msgid ""
"Couldn't save scene. Likely dependencies (instances) couldn't be satisfied."
msgstr ""
-"ΑδÏνατη η αποθήκευση σκηνής. Πιθανώς οι εξαÏτήσεις (στιγμιότυπα) να μην "
+"ΑδÏνατη η αποθήκευση σκηνής. Πιθανώς οι εξαÏτήσεις (στιγμιότυπα) να μην "
"μποÏοÏσαν να ικανοποιηθοÏν."
#: editor/editor_node.cpp
@@ -1347,11 +1344,11 @@ msgstr "Απέτυχε η φόÏτωση πόÏου."
#: editor/editor_node.cpp
msgid "Can't load MeshLibrary for merging!"
-msgstr "ΑδÏνατο το φόÏτωμα του MeshLibrary για συγχώνευση!"
+msgstr "ΑδÏνατο το φόÏτωμα της βιβλιοθήκης πλεγμάτων για συγχώνευση!"
#: editor/editor_node.cpp
msgid "Error saving MeshLibrary!"
-msgstr "Σφάλμα κατά την αποθήκευση MeshLibrary!"
+msgstr "Σφάλμα κατά την αποθήκευση της βιβλιοθήκης πλεγμάτων !"
#: editor/editor_node.cpp
msgid "Can't load TileSet for merging!"
@@ -1410,10 +1407,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"
"ΜποÏείτε να την αλλάξετε αÏγότεÏα στις «Ρυθμίσεις έÏγου» κάτω από την "
@@ -1464,7 +1462,7 @@ msgstr "ΓÏήγοÏο άνοιγμα σκηνής..."
#: editor/editor_node.cpp
msgid "Quick Open Script.."
-msgstr "ΓÏήγοÏη ανοιχτό script..."
+msgstr "ΓÏήγοÏη άνοιγμα δεσμής ενεÏγειών..."
#: editor/editor_node.cpp
msgid "Yes"
@@ -1479,13 +1477,17 @@ 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
-#, fuzzy
msgid "Export Mesh Library"
-msgstr "Εξαγωγή βιβλιοθήκης mesh"
+msgstr "Εξαγωγή βιβλιοθήκης πλεγμάτων"
#: editor/editor_node.cpp
msgid "Export Tile Set"
@@ -1539,9 +1541,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 "α..."
@@ -1582,6 +1587,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 "Σκηνή"
@@ -1599,9 +1608,8 @@ msgid "Previous tab"
msgstr "ΠÏοηγοÏμενη καÏτέλα"
#: editor/editor_node.cpp
-#, fuzzy
msgid "Filter Files.."
-msgstr "ΓÏήγοÏο φιλτÏάÏισμα αÏχείων..."
+msgstr "ΦιλτÏάÏισμα αÏχείων..."
#: editor/editor_node.cpp
msgid "Operations with scene files."
@@ -1635,7 +1643,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 "Άνοιγμα Ï€Ïόσφατων"
@@ -1645,7 +1653,7 @@ msgstr "ΜετατÏοπή σε..."
#: editor/editor_node.cpp
msgid "MeshLibrary.."
-msgstr "Βιβλιοθήκη mesh..."
+msgstr "Βιβλιοθήκη πλεγμάτων..."
#: editor/editor_node.cpp
msgid "TileSet.."
@@ -1663,84 +1671,41 @@ msgid "Redo"
msgstr "ΑκÏÏωση αναίÏεσης"
#: editor/editor_node.cpp
-msgid "Run Script"
-msgstr "Εκτέλεση script"
-
-#: 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 "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"
@@ -1795,7 +1760,7 @@ msgid ""
"Navigation meshes and polygons will be visible on the running game if this "
"option is turned on."
msgstr ""
-"Πλέγματα πλοήγησης και πολÏγονα θα είναι οÏατά στο παιχνίδι εάν αυτή η "
+"Τα πλέγματα πλοήγησης και τα πολÏγονα θα είναι οÏατά στο παιχνίδι εάν αυτή η "
"επιλογή είναι ενεÏγοποιημένη."
#: editor/editor_node.cpp
@@ -1816,7 +1781,7 @@ msgstr ""
#: editor/editor_node.cpp
msgid "Sync Script Changes"
-msgstr "ΣυγχÏονισμός αλλαγών στα script"
+msgstr "ΣυγχÏονισμός αλλαγών στις δεσμές ενεÏγειών"
#: editor/editor_node.cpp
msgid ""
@@ -1825,14 +1790,15 @@ msgid ""
"When used remotely on a device, this is more efficient with network "
"filesystem."
msgstr ""
-"Όταν αυτή η επιλογή είναι ενεÏγοποιημένη, όποιο script αποθηκευτεί θα "
-"επαναφοÏτωθεί στο παιχνίδι.\n"
+"Όταν αυτή η επιλογή είναι ενεÏγοποιημένη, όποια δεσμή ενεÏγειών αποθηκευτεί "
+"θα επαναφοÏτωθεί στο παιχνίδι.\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"
@@ -1847,17 +1813,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!"
@@ -1940,6 +1962,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"
@@ -1961,79 +1991,109 @@ msgstr "Κωδικός:"
#: editor/editor_node.cpp
msgid "Open & Run a Script"
-msgstr "Άνοιξε & ΤÏέξε ένα script"
+msgstr "Άνοιξε & ΤÏέξε μία δεσμή ενεÏγειών"
#: editor/editor_node.cpp
msgid "Load Errors"
-msgstr ""
+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 ""
+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"
-msgstr ""
+msgstr "Διακοπή Ï€Ïοφίλ"
#: editor/editor_profiler.cpp
msgid "Start Profiling"
-msgstr ""
+msgstr "ΈναÏξη Ï€Ïοφίλ"
#: editor/editor_profiler.cpp
msgid "Measure:"
-msgstr ""
+msgstr "ΜέτÏο:"
#: editor/editor_profiler.cpp
msgid "Frame Time (sec)"
-msgstr ""
+msgstr "ΧÏόνος καÏέ (sec)"
#: editor/editor_profiler.cpp
msgid "Average Time (sec)"
-msgstr ""
+msgstr "Μέσος ΧÏόνος (sec)"
#: editor/editor_profiler.cpp
msgid "Frame %"
-msgstr ""
+msgstr "ΚαÏέ %"
#: editor/editor_profiler.cpp
msgid "Fixed Frame %"
-msgstr ""
+msgstr "ΣταθεÏÏŒ καÏέ %"
#: editor/editor_profiler.cpp editor/script_editor_debugger.cpp
msgid "Time:"
-msgstr ""
+msgstr "ΧÏόνος:"
#: editor/editor_profiler.cpp
msgid "Inclusive"
-msgstr ""
+msgstr "ΠεÏιοκτικός"
#: editor/editor_profiler.cpp
msgid "Self"
-msgstr ""
+msgstr "Εαυτός"
#: editor/editor_profiler.cpp
msgid "Frame #:"
-msgstr ""
+msgstr "ΚαÏέ #:"
#: editor/editor_reimport_dialog.cpp
msgid "Please wait for scan to complete."
-msgstr ""
+msgstr "ΠαÏακαλώ πεÏιμένετε να ολοκληÏωθεί η σάÏωση."
#: editor/editor_reimport_dialog.cpp
msgid "Current scene must be saved to re-import."
-msgstr ""
+msgstr "Η Ï„Ïέχουσα σκηνή Ï€Ïέπει να αποθηκευτεί για να επαν-εισάγετε."
#: editor/editor_reimport_dialog.cpp
msgid "Save & Re-Import"
-msgstr ""
+msgstr "Αποθήκευση & Επανεισαγωγή"
#: editor/editor_reimport_dialog.cpp
msgid "Re-Importing"
@@ -2041,75 +2101,75 @@ msgstr "Επανεισαγωγή"
#: editor/editor_reimport_dialog.cpp
msgid "Re-Import Changed Resources"
-msgstr ""
+msgstr "Επανεισαγωγή Ï„Ïοποπιημένων πόÏων"
#: editor/editor_run_script.cpp
msgid "Write your logic in the _run() method."
-msgstr ""
+msgstr "ΓÏάψτε τη λογική σας στη μέθοδο _run()."
#: editor/editor_run_script.cpp
msgid "There is an edited scene already."
-msgstr ""
+msgstr "ΥπάÏχει ήδη μία σκηνή για επεξεÏγασία."
#: editor/editor_run_script.cpp
msgid "Couldn't instance script:"
-msgstr ""
+msgstr "ΑδÏνατη η δημιουÏγία στιγμιοτÏπου δεσμής ενεÏγειών:"
#: editor/editor_run_script.cpp
msgid "Did you forget the 'tool' keyword?"
-msgstr ""
+msgstr "Μήπως ξεχάσατε τη λέξη-κλειδί \"tool\"?"
#: editor/editor_run_script.cpp
msgid "Couldn't run script:"
-msgstr ""
+msgstr "ΑδÏνατη η εκτέλεση της δεσμής ενεÏγειών:"
#: editor/editor_run_script.cpp
msgid "Did you forget the '_run' method?"
-msgstr ""
+msgstr "Μήπως ξεχάσατε τη μέθοδο '_run';"
#: editor/editor_settings.cpp
msgid "Default (Same as Editor)"
-msgstr ""
+msgstr "ΠÏοεπιλογή (Το ίδιο με τον επεξεÏγαστή)"
#: editor/editor_sub_scene.cpp
msgid "Select Node(s) to Import"
-msgstr ""
+msgstr "Επιλέξτε κόμβους για εισαγωγή"
#: editor/editor_sub_scene.cpp
msgid "Scene Path:"
-msgstr ""
+msgstr "ΔιαδÏομή σκηνής:"
#: editor/editor_sub_scene.cpp
msgid "Import From Node:"
-msgstr ""
+msgstr "Εισαγωγή σκηνής από κόμβο:"
#: editor/export_template_manager.cpp
msgid "Re-Download"
-msgstr ""
+msgstr "Εκ νέου λήψη"
#: editor/export_template_manager.cpp
msgid "Uninstall"
-msgstr ""
+msgstr "Απεγκατάσταση"
#: editor/export_template_manager.cpp
msgid "(Installed)"
-msgstr ""
+msgstr "(Εγκατεστημένο)"
#: editor/export_template_manager.cpp
msgid "Download"
-msgstr ""
+msgstr "Λήψη"
#: editor/export_template_manager.cpp
msgid "(Missing)"
-msgstr ""
+msgstr "(Λείπει)"
#: editor/export_template_manager.cpp
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."
@@ -2117,27 +2177,27 @@ 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 ""
+"ΆκυÏη μοÏφή version.txt μέσα στα Ï€Ïότυπα. Το Revision δεν είναι έγκυÏο "
+"αναγνωÏιστικό."
#: 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:"
@@ -2149,238 +2209,238 @@ msgstr "ΦόÏτωση Ï€ÏοτÏπων εξαγωγής"
#: editor/export_template_manager.cpp
msgid "Current Version:"
-msgstr ""
+msgstr "ΤÏέχουσα έκδοση:"
#: editor/export_template_manager.cpp
msgid "Installed Versions:"
-msgstr ""
+msgstr "Εγκατεστημένες εκδόσεις:"
#: editor/export_template_manager.cpp
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!"
msgstr ""
+"ΑδÏνατο το άνοιγμα του αÏχείου file_type_cache.cch για εγγÏαφή, παÏάλειψη "
+"αποθήκευσης cache Ï„Ïπου αÏχείου!"
#: editor/filesystem_dock.cpp
msgid "Cannot navigate to '"
-msgstr ""
+msgstr "ΑδÏνατη η πλοήγηση στο '"
#: editor/filesystem_dock.cpp
msgid "Same source and destination files, doing nothing."
-msgstr ""
+msgstr "Ίδια αÏχεία πηγής και Ï€ÏοοÏισμοÏ, παÏάλειψη ενέÏγειας."
#: editor/filesystem_dock.cpp
msgid "Same source and destination paths, doing nothing."
-msgstr ""
+msgstr "Ίδιες διαδÏομές πηγής και Ï€ÏοοÏισμοÏ, παÏάλειψη ενέÏγειας."
#: editor/filesystem_dock.cpp
msgid "Can't move directories to within themselves."
-msgstr ""
+msgstr "ΑδÏνατη η μετακίνηση καταλόγων μέσα στους εαυτοÏÏ‚ τους."
#: editor/filesystem_dock.cpp
msgid "Can't operate on '..'"
-msgstr ""
+msgstr "ΑδÏνατη η λειτουÏγία στο '..'"
#: editor/filesystem_dock.cpp
msgid "Pick New Name and Location For:"
-msgstr ""
+msgstr "Επιλέξτε νέο όνομα και θέση για:"
#: editor/filesystem_dock.cpp
msgid "No files selected!"
-msgstr ""
+msgstr "Δεν επιλέχθηκαν αÏχεία!"
#: editor/filesystem_dock.cpp
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"
-msgstr ""
+msgstr "Στιγμιότυπο"
#: editor/filesystem_dock.cpp
msgid "Edit Dependencies.."
-msgstr ""
+msgstr "ΕπεξεÏγασία εξαÏτήσεων .."
#: editor/filesystem_dock.cpp
msgid "View Owners.."
-msgstr ""
+msgstr "ΠÏοβολή Ιδιοκτητών .."
#: editor/filesystem_dock.cpp
msgid "Copy Path"
-msgstr ""
+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 ""
+msgstr "ΠληÏοφοÏίες"
#: editor/filesystem_dock.cpp
msgid "Re-Import.."
-msgstr ""
+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"
-msgstr ""
+msgstr "Εκ νέου σάÏωση το συστήματος αÏχείων"
#: editor/filesystem_dock.cpp
msgid "Toggle folder status as Favorite"
-msgstr ""
+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 ""
+msgstr "Μετακίνηση"
#: editor/groups_editor.cpp
msgid "Add to Group"
-msgstr ""
+msgstr "ΠÏοσθήκη σε Ομάδα"
#: editor/groups_editor.cpp
msgid "Remove from Group"
-msgstr ""
+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
#: editor/plugins/cube_grid_theme_editor_plugin.cpp
msgid "Import Scene"
-msgstr ""
+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
msgid "Running Custom Script.."
-msgstr ""
+msgstr "Εκτέλεση Ï€ÏοσαÏμοσμένης δέσμης ενεÏγειών..."
#: editor/import/resource_importer_scene.cpp
#: editor/io_plugins/editor_scene_import_plugin.cpp
msgid "Couldn't load post-import script:"
-msgstr ""
+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 ""
+msgstr "Σφάλμα κατά την εκτέλεση της δέσμης ενεÏγειών μετ-εισαγωγής:"
#: editor/import/resource_importer_scene.cpp
#: editor/io_plugins/editor_scene_import_plugin.cpp
msgid "Saving.."
-msgstr ""
+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 ""
+msgstr "ΠÏοκαθοÏισμένο..."
#: editor/import_dock.cpp
-#, fuzzy
msgid "Reimport"
msgstr "Επανεισαγωγή"
#: editor/io_plugins/editor_bitmask_import_plugin.cpp
msgid "No bit masks to import!"
-msgstr ""
+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 ""
+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 ""
+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 ""
+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 ""
+msgstr "Η διαδÏομή αποθήκευσης είναι άδεια!"
#: editor/io_plugins/editor_bitmask_import_plugin.cpp
msgid "Import BitMasks"
-msgstr ""
+msgstr "Εισαγωγή μάσκας bit"
#: editor/io_plugins/editor_bitmask_import_plugin.cpp
#: editor/io_plugins/editor_texture_import_plugin.cpp
msgid "Source Texture(s):"
-msgstr ""
+msgstr "Πηγαίες υφές:"
#: editor/io_plugins/editor_bitmask_import_plugin.cpp
#: editor/io_plugins/editor_mesh_import_plugin.cpp
@@ -2389,7 +2449,7 @@ msgstr ""
#: editor/io_plugins/editor_texture_import_plugin.cpp
#: editor/io_plugins/editor_translation_import_plugin.cpp
msgid "Target Path:"
-msgstr ""
+msgstr "ΔιαδÏομή Ï€ÏοοÏισμοÏ:"
#: editor/io_plugins/editor_bitmask_import_plugin.cpp
#: editor/io_plugins/editor_font_import_plugin.cpp
@@ -2398,74 +2458,79 @@ msgstr ""
#: editor/io_plugins/editor_texture_import_plugin.cpp
#: editor/io_plugins/editor_translation_import_plugin.cpp
msgid "Accept"
-msgstr ""
+msgstr "Αποδοχή"
#: editor/io_plugins/editor_bitmask_import_plugin.cpp
msgid "Bit Mask"
-msgstr ""
+msgstr "Μάσκα bit"
#: editor/io_plugins/editor_font_import_plugin.cpp
msgid "No source font file!"
-msgstr ""
+msgstr "Δεν δόθηκε πηγαίο αÏχείο γÏαμματοσειÏάς!"
#: editor/io_plugins/editor_font_import_plugin.cpp
msgid "No target font resource!"
-msgstr ""
+msgstr "Δε δόθηκε πόÏος γÏαμματοσειÏάς Ï€ÏοοÏισμοÏ!"
#: editor/io_plugins/editor_font_import_plugin.cpp
+#, fuzzy
msgid ""
"Invalid file extension.\n"
-"Please use .fnt."
+"Please use .font."
msgstr ""
+"ΆκυÏη επέκταση αÏχείου.\n"
+"ΠαÏακαλώ χÏησιμοποιήστε .fnt."
#: editor/io_plugins/editor_font_import_plugin.cpp
msgid "Can't load/process source font."
-msgstr ""
+msgstr "Δεν ήταν δυνατή η φόÏτωση/επεξεÏγασία της πηγαίας γÏαμματοσειÏάς."
#: editor/io_plugins/editor_font_import_plugin.cpp
msgid "Couldn't save font."
-msgstr ""
+msgstr "Δεν ήταν δυνατή η αποθήκευση της γÏαμματοσειÏάς."
#: editor/io_plugins/editor_font_import_plugin.cpp
msgid "Source Font:"
-msgstr ""
+msgstr "Πηγαία γÏαμματοσειÏά:"
#: editor/io_plugins/editor_font_import_plugin.cpp
msgid "Source Font Size:"
-msgstr ""
+msgstr "Μέγεθος πηγαίας γÏαμματοσειÏάς:"
#: editor/io_plugins/editor_font_import_plugin.cpp
msgid "Dest Resource:"
-msgstr ""
+msgstr "ΠόÏος Ï€ÏοοÏισμοÏ:"
#: editor/io_plugins/editor_font_import_plugin.cpp
msgid "The quick brown fox jumps over the lazy dog."
-msgstr ""
+msgstr "Γαζέες καὶ μυÏτιὲς δὲν θὰ βÏá¿¶ πιὰ στὸ χÏυσαφὶ ξέφωτο."
#: editor/io_plugins/editor_font_import_plugin.cpp
msgid "Test:"
-msgstr ""
+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 ""
+msgstr "Επιλογές:"
#: editor/io_plugins/editor_font_import_plugin.cpp
msgid "Font Import"
-msgstr ""
+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 ""
+msgstr "Απέτυχε το άνοιγμα ως αÏχείο BMFont."
#: editor/io_plugins/editor_font_import_plugin.cpp
#: scene/resources/dynamic_font.cpp
@@ -2489,158 +2554,159 @@ 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
msgid "Font"
-msgstr ""
+msgstr "ΓÏαμματοσειÏά"
#: editor/io_plugins/editor_mesh_import_plugin.cpp
msgid "No meshes to import!"
-msgstr ""
+msgstr "Δεν υπάÏχουν πλέγματα για εισαγωγή!"
#: editor/io_plugins/editor_mesh_import_plugin.cpp
msgid "Single Mesh Import"
-msgstr ""
+msgstr "Εισαγωγή ενός πλέγματος"
#: editor/io_plugins/editor_mesh_import_plugin.cpp
msgid "Source Mesh(es):"
-msgstr ""
+msgstr "Πηγαία πλέγματα:"
#: editor/io_plugins/editor_mesh_import_plugin.cpp
#: editor/plugins/mesh_instance_editor_plugin.cpp
msgid "Mesh"
-msgstr ""
+msgstr "Πλέγμα"
#: editor/io_plugins/editor_sample_import_plugin.cpp
msgid "No samples to import!"
-msgstr ""
+msgstr "Δεν υπάÏχουν δείγματα για εισαγωγή!"
#: editor/io_plugins/editor_sample_import_plugin.cpp
msgid "Import Audio Samples"
-msgstr ""
+msgstr "Εισαγωγή δειγμάτων ήχου"
#: editor/io_plugins/editor_sample_import_plugin.cpp
msgid "Source Sample(s):"
-msgstr ""
+msgstr "Πηγαία δείγματα:"
#: editor/io_plugins/editor_sample_import_plugin.cpp
msgid "Audio Sample"
-msgstr ""
+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"
-msgstr ""
+msgstr "Επιλογές κίνησης"
#: editor/io_plugins/editor_scene_import_plugin.cpp
msgid "Flags"
-msgstr ""
+msgstr "Σημαίες"
#: editor/io_plugins/editor_scene_import_plugin.cpp
msgid "Bake FPS:"
-msgstr ""
+msgstr "Ψήστε FPS:"
#: editor/io_plugins/editor_scene_import_plugin.cpp
msgid "Optimizer"
-msgstr ""
+msgstr "ΕÏγαλείο βελτιστοποίησης"
#: editor/io_plugins/editor_scene_import_plugin.cpp
msgid "Max Linear Error"
-msgstr ""
+msgstr "Μέγιστο γÏαμμικό σφάλμα"
#: editor/io_plugins/editor_scene_import_plugin.cpp
msgid "Max Angular Error"
-msgstr ""
+msgstr "Μέγιστο γωνιακό σφάλμα"
#: editor/io_plugins/editor_scene_import_plugin.cpp
msgid "Max Angle"
-msgstr ""
+msgstr "Ανώτατη Γωνία"
#: editor/io_plugins/editor_scene_import_plugin.cpp
msgid "Clips"
-msgstr ""
+msgstr "Αποσπάσματα"
#: editor/io_plugins/editor_scene_import_plugin.cpp
msgid "Start(s)"
-msgstr ""
+msgstr "ΑÏχή"
#: editor/io_plugins/editor_scene_import_plugin.cpp
msgid "End(s)"
-msgstr ""
+msgstr "Τέλος"
#: editor/io_plugins/editor_scene_import_plugin.cpp
#: editor/plugins/sprite_frames_editor_plugin.cpp
msgid "Loop"
-msgstr ""
+msgstr "Επανάληψη"
#: editor/io_plugins/editor_scene_import_plugin.cpp
msgid "Filters"
-msgstr ""
+msgstr "ΦίλτÏα"
#: editor/io_plugins/editor_scene_import_plugin.cpp
msgid "Source path is empty."
-msgstr ""
+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 ""
+"ΆκυÏη / χαλασμένη δεσμή ενεÏγειών για την διαδικασία της μετ-εισαγωγής."
#: editor/io_plugins/editor_scene_import_plugin.cpp
msgid "Error importing scene."
-msgstr ""
+msgstr "Σφάλμα κατά την εισαγωγή της σκηνής."
#: editor/io_plugins/editor_scene_import_plugin.cpp
msgid "Import 3D Scene"
-msgstr ""
+msgstr "Εισαγωγή 3D σκηνής"
#: editor/io_plugins/editor_scene_import_plugin.cpp
msgid "Source Scene:"
-msgstr ""
+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:"
-msgstr ""
+msgstr "Επιλεγμένος φάκλος υφών:"
#: editor/io_plugins/editor_scene_import_plugin.cpp
msgid "Post-Process Script:"
-msgstr ""
+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"
-msgstr ""
+msgstr "Αυτόματο"
#: editor/io_plugins/editor_scene_import_plugin.cpp
msgid "Root Node Name:"
-msgstr ""
+msgstr "Όνομα ÏÎ¹Î¶Î¹ÎºÎ¿Ï ÎºÏŒÎ¼Î²Î¿Ï…:"
#: editor/io_plugins/editor_scene_import_plugin.cpp
msgid "The Following Files are Missing:"
-msgstr ""
+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"
@@ -2648,422 +2714,427 @@ msgstr "ΑκÏÏωση"
#: editor/io_plugins/editor_scene_import_plugin.cpp
msgid "Import & Open"
-msgstr ""
+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 ""
+msgstr "Εισαγωγή εικόνας:"
#: editor/io_plugins/editor_scene_import_plugin.cpp
msgid "Can't import a file over itself:"
-msgstr ""
+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 ""
+msgstr "Κίνηση Ï„Ïισδιάστατης σκηνής"
#: editor/io_plugins/editor_texture_import_plugin.cpp
msgid "Uncompressed"
-msgstr ""
+msgstr "Ασυμπίεστο"
#: editor/io_plugins/editor_texture_import_plugin.cpp
msgid "Compress Lossless (PNG)"
-msgstr ""
+msgstr "Συμπίεση χωÏίς απώλειες (PNG)"
#: editor/io_plugins/editor_texture_import_plugin.cpp
msgid "Compress Lossy (WebP)"
-msgstr ""
+msgstr "Συμπίεση με απώλειες (WebP)"
#: editor/io_plugins/editor_texture_import_plugin.cpp
msgid "Compress (VRAM)"
-msgstr ""
+msgstr "Συμπίεση (VRAM)"
#: editor/io_plugins/editor_texture_import_plugin.cpp
msgid "Texture Format"
-msgstr ""
+msgstr "ΜοÏφή υφής"
#: editor/io_plugins/editor_texture_import_plugin.cpp
msgid "Texture Compression Quality (WebP):"
-msgstr ""
+msgstr "Ποιότητα συμπίεσης υφής (WebP):"
#: editor/io_plugins/editor_texture_import_plugin.cpp
msgid "Texture Options"
-msgstr ""
+msgstr "Επιλογές υφής"
#: editor/io_plugins/editor_texture_import_plugin.cpp
msgid "Please specify some files!"
-msgstr ""
+msgstr "ΠαÏακαλώ καθοÏίστε κάποια αÏχεία!"
#: editor/io_plugins/editor_texture_import_plugin.cpp
msgid "At least one file needed for Atlas."
-msgstr ""
+msgstr "Τουλάχιστον ένα αÏχείο απαιτείται για τον άτλαντα."
#: editor/io_plugins/editor_texture_import_plugin.cpp
msgid "Error importing:"
-msgstr ""
+msgstr "Σφάλμα κατά την εισαγωγή:"
#: editor/io_plugins/editor_texture_import_plugin.cpp
msgid "Only one file is required for large texture."
-msgstr ""
+msgstr "Μόνο ένα αÏχείο είναι απαÏαίτητη για μεγάλη υφή."
#: editor/io_plugins/editor_texture_import_plugin.cpp
msgid "Max Texture Size:"
-msgstr ""
+msgstr "Μέγιστο μέγεθος υφής:"
#: editor/io_plugins/editor_texture_import_plugin.cpp
msgid "Import Textures for Atlas (2D)"
-msgstr ""
+msgstr "Εισαγωγή υφών για τον άτλαντα (2D)"
#: editor/io_plugins/editor_texture_import_plugin.cpp
msgid "Cell Size:"
-msgstr ""
+msgstr "Μέγεθος κελιοÏ:"
#: editor/io_plugins/editor_texture_import_plugin.cpp
msgid "Large Texture"
-msgstr ""
+msgstr "Μεγάλη υφή"
#: editor/io_plugins/editor_texture_import_plugin.cpp
msgid "Import Large Textures (2D)"
-msgstr ""
+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"
-msgstr ""
+msgstr "Βασική υφή άτλαντα"
#: editor/io_plugins/editor_texture_import_plugin.cpp
msgid "Source Texture(s)"
-msgstr ""
+msgstr "Υφές Ï€Ïοέλευσης"
#: editor/io_plugins/editor_texture_import_plugin.cpp
msgid "Import Textures for 2D"
-msgstr ""
+msgstr "Εισαγωγή υφών για 2 διαστάσεις"
#: editor/io_plugins/editor_texture_import_plugin.cpp
msgid "Import Textures for 3D"
-msgstr ""
+msgstr "Εισαγωγή υφών για 3 διαστάσεις"
#: editor/io_plugins/editor_texture_import_plugin.cpp
msgid "Import Textures"
-msgstr ""
+msgstr "Εισαγωγή υφών"
#: editor/io_plugins/editor_texture_import_plugin.cpp
msgid "2D Texture"
-msgstr ""
+msgstr "Υφή 2 διαστάσεων"
#: editor/io_plugins/editor_texture_import_plugin.cpp
msgid "3D Texture"
-msgstr ""
+msgstr "Υφή 3 διαστάσεων"
#: editor/io_plugins/editor_texture_import_plugin.cpp
msgid "Atlas Texture"
-msgstr ""
+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 ""
+msgstr "ΠεÏικοπή άδειου χώÏου."
#: editor/io_plugins/editor_texture_import_plugin.cpp
msgid "Texture"
-msgstr ""
+msgstr "Υφή"
#: editor/io_plugins/editor_texture_import_plugin.cpp
msgid "Import Large Texture"
-msgstr ""
+msgstr "Εισαγωγή μεγάλης υφής"
#: editor/io_plugins/editor_texture_import_plugin.cpp
msgid "Load Source Image"
-msgstr ""
+msgstr "ΦόÏτωση εικόνας Ï€Ïοέλευσης"
#: editor/io_plugins/editor_texture_import_plugin.cpp
msgid "Slicing"
-msgstr ""
+msgstr "Κατάτμηση"
#: editor/io_plugins/editor_texture_import_plugin.cpp
msgid "Inserting"
-msgstr ""
+msgstr "Εισαγωγή"
#: editor/io_plugins/editor_texture_import_plugin.cpp
msgid "Saving"
-msgstr ""
+msgstr "Αποθήκευση"
#: editor/io_plugins/editor_texture_import_plugin.cpp
msgid "Couldn't save large texture:"
-msgstr ""
+msgstr "Δεν ήταν δυνατή η αποθήκευση μεγάλης υφής:"
#: editor/io_plugins/editor_texture_import_plugin.cpp
msgid "Build Atlas For:"
-msgstr ""
+msgstr "Κατασκευή άτλαντα για:"
#: editor/io_plugins/editor_texture_import_plugin.cpp
msgid "Loading Image:"
-msgstr ""
+msgstr "ΦόÏτωση εικόνας:"
#: editor/io_plugins/editor_texture_import_plugin.cpp
msgid "Couldn't load image:"
-msgstr ""
+msgstr "Δεν ήταν δυνατή η φόÏτωση της εικόνας:"
#: editor/io_plugins/editor_texture_import_plugin.cpp
msgid "Converting Images"
-msgstr ""
+msgstr "ΜετατÏοπή Εικόνων"
#: editor/io_plugins/editor_texture_import_plugin.cpp
msgid "Cropping Images"
-msgstr ""
+msgstr "ΠεÏικοπή Εικόνων"
#: editor/io_plugins/editor_texture_import_plugin.cpp
msgid "Blitting Images"
-msgstr ""
+msgstr "Συνδυασμός εικόνων"
#: editor/io_plugins/editor_texture_import_plugin.cpp
msgid "Couldn't save atlas image:"
-msgstr ""
+msgstr "Δεν ήταν δυνατή η αποθήκευση εικόνας άτλαντα:"
#: editor/io_plugins/editor_texture_import_plugin.cpp
msgid "Couldn't save converted texture:"
-msgstr ""
+msgstr "Δεν ήταν δυνατή η αποθήκευση υφής που έχει μετατÏαπεί:"
#: editor/io_plugins/editor_translation_import_plugin.cpp
msgid "Invalid source!"
-msgstr ""
+msgstr "Μη έγκυÏη πηγή!"
#: editor/io_plugins/editor_translation_import_plugin.cpp
msgid "Invalid translation source!"
-msgstr ""
+msgstr "Μη έγκυÏη πηγή μετάφÏασης!"
#: editor/io_plugins/editor_translation_import_plugin.cpp
msgid "Column"
-msgstr ""
+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!"
-msgstr ""
+msgstr "Δεν υπάÏχουν στοιχεία για εισαγωγή!"
#: editor/io_plugins/editor_translation_import_plugin.cpp
msgid "No target path!"
-msgstr ""
+msgstr "Καμία διαδÏομή Ï€ÏοοÏισμοÏ!"
#: editor/io_plugins/editor_translation_import_plugin.cpp
msgid "Import Translations"
-msgstr ""
+msgstr "Εισαγωγή μεταφÏάσεων"
#: editor/io_plugins/editor_translation_import_plugin.cpp
msgid "Couldn't import!"
-msgstr ""
+msgstr "Δεν ήταν δυνατή η εισαγωγή!"
#: editor/io_plugins/editor_translation_import_plugin.cpp
msgid "Import Translation"
-msgstr ""
+msgstr "Εισαγωγή μετάφÏασης"
#: editor/io_plugins/editor_translation_import_plugin.cpp
msgid "Source CSV:"
-msgstr ""
+msgstr "CSV Ï€Ïοέλευσης:"
#: editor/io_plugins/editor_translation_import_plugin.cpp
msgid "Ignore First Row"
-msgstr ""
+msgstr "Αγνόησε την Ï€Ïώτη γÏαμμή"
#: editor/io_plugins/editor_translation_import_plugin.cpp
msgid "Compress"
-msgstr ""
+msgstr "Συμπίεση"
#: editor/io_plugins/editor_translation_import_plugin.cpp
-msgid "Add to Project (godot.cfg)"
-msgstr ""
+#, fuzzy
+msgid "Add to Project (project.godot)"
+msgstr "ΠÏόσθεσε στο έÏγο (godot.cfg)"
#: editor/io_plugins/editor_translation_import_plugin.cpp
msgid "Import Languages:"
-msgstr ""
+msgstr "Εισαγωγή γλωσσών:"
#: editor/io_plugins/editor_translation_import_plugin.cpp
msgid "Translation"
-msgstr ""
+msgstr "ΜετάφÏαση"
#: editor/multi_node_edit.cpp
msgid "MultiNode Set"
-msgstr ""
+msgstr "Σετ πολλαπλών κόμβων"
#: editor/node_dock.cpp
msgid "Groups"
-msgstr ""
+msgstr "Ομάδες"
#: editor/node_dock.cpp
msgid "Select a Node to edit Signals and Groups."
-msgstr ""
+msgstr "Επιλέξτε ένα κόμβο για να επεξεÏγαστείτε τα σήματα και τις ομάδες."
#: editor/plugins/animation_player_editor_plugin.cpp
msgid "Toggle Autoplay"
-msgstr ""
+msgstr "Εναλλαγή αυτόματης αναπαÏαγωγής"
#: editor/plugins/animation_player_editor_plugin.cpp
msgid "New Animation Name:"
-msgstr ""
+msgstr "Όνομα νέας κίνησης:"
#: editor/plugins/animation_player_editor_plugin.cpp
msgid "New Anim"
-msgstr ""
+msgstr "Îέα κίνηση"
#: editor/plugins/animation_player_editor_plugin.cpp
msgid "Change Animation Name:"
-msgstr ""
+msgstr "Αλλαγή ονόματος κίνησης:"
#: editor/plugins/animation_player_editor_plugin.cpp
-#, fuzzy
msgid "Delete Animation?"
-msgstr "Βελτιστοποίηση animation"
+msgstr "ΔιαγÏαφή κίνησης;"
#: editor/plugins/animation_player_editor_plugin.cpp
#: editor/plugins/sprite_frames_editor_plugin.cpp
msgid "Remove Animation"
-msgstr ""
+msgstr "ΚατάÏγηση κίνησης"
#: editor/plugins/animation_player_editor_plugin.cpp
msgid "ERROR: Invalid animation name!"
-msgstr ""
+msgstr "ΣΦΑΛΜΑ: Μη έγκυÏο όνομα κίνησης!"
#: editor/plugins/animation_player_editor_plugin.cpp
msgid "ERROR: Animation name already exists!"
-msgstr ""
+msgstr "ΣΦΑΛΜΑ: Αυτό το όνομα κίνησης υπάÏχει ήδη!"
#: editor/plugins/animation_player_editor_plugin.cpp
#: editor/plugins/sprite_frames_editor_plugin.cpp
msgid "Rename Animation"
-msgstr ""
+msgstr "Μετονομασία κίνησης"
#: editor/plugins/animation_player_editor_plugin.cpp
#: editor/plugins/sprite_frames_editor_plugin.cpp
msgid "Add Animation"
-msgstr ""
+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"
-msgstr ""
+msgstr "Αλλαγή χÏόνου ανάμειξης"
#: editor/plugins/animation_player_editor_plugin.cpp
msgid "Load Animation"
-msgstr ""
+msgstr "ΦόÏτωση κίνησης"
#: editor/plugins/animation_player_editor_plugin.cpp
msgid "Duplicate Animation"
-msgstr ""
+msgstr "ΑναπαÏαγωγή κίνησης"
#: editor/plugins/animation_player_editor_plugin.cpp
msgid "ERROR: No animation to copy!"
-msgstr ""
+msgstr "ΣΦΑΛΜΑ: Δεν υπάÏχει κίνηση για αντÏιγÏαφή!"
#: editor/plugins/animation_player_editor_plugin.cpp
msgid "ERROR: No animation resource on clipboard!"
-msgstr ""
+msgstr "ΣΦΑΛΜΑ: Δεν υπάÏχει πόÏος κίνησης στο Ï€ÏόχειÏο!"
#: editor/plugins/animation_player_editor_plugin.cpp
msgid "Pasted Animation"
-msgstr ""
+msgstr "Επικολλημένη κίνηση"
#: editor/plugins/animation_player_editor_plugin.cpp
msgid "Paste Animation"
-msgstr ""
+msgstr "Επικόλληση κίνησης"
#: editor/plugins/animation_player_editor_plugin.cpp
msgid "ERROR: No animation to edit!"
-msgstr ""
+msgstr "ΣΦΑΛΜΑ: Δεν υπάÏχει κίνηση για επεξεÏγασία!"
#: editor/plugins/animation_player_editor_plugin.cpp
msgid "Play selected animation backwards from current pos. (A)"
-msgstr ""
+msgstr "ΑναπαÏαγωγή της επιλεγμένης κίνησης ανάποδα από την Ï„Ïέχουσα θέση. (A)"
#: editor/plugins/animation_player_editor_plugin.cpp
msgid "Play selected animation backwards from end. (Shift+A)"
-msgstr ""
+msgstr "ΑναπαÏαγωγή της επιλεγμένης κίνησης ανάποδα από το τέλος. (Shift + A)"
#: editor/plugins/animation_player_editor_plugin.cpp
msgid "Stop animation playback. (S)"
-msgstr ""
+msgstr "Πάυση αναπαÏγωγής κίνησης. (S)"
#: editor/plugins/animation_player_editor_plugin.cpp
msgid "Play selected animation from start. (Shift+D)"
-msgstr ""
+msgstr "ΑναπαÏαγωγή της επιλεγμένης κίνησης από την αÏχή. (Shift + D)"
#: editor/plugins/animation_player_editor_plugin.cpp
msgid "Play selected animation from current pos. (D)"
-msgstr ""
+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."
-msgstr ""
+msgstr "ΔημιουÏγία νέας κίνησης στον αναπαÏαγωγέα."
#: editor/plugins/animation_player_editor_plugin.cpp
msgid "Load animation from disk."
-msgstr ""
+msgstr "ΦόÏτωση κίνησης από τον δίσκο."
#: editor/plugins/animation_player_editor_plugin.cpp
msgid "Load an animation from disk."
-msgstr ""
+msgstr "ΦόÏτωση μίας κίνησης από τον δίσκο."
#: editor/plugins/animation_player_editor_plugin.cpp
msgid "Save the current animation"
-msgstr ""
+msgstr "Αποθήκεση της Ï„Ïέχουσας κίνησης"
#: editor/plugins/animation_player_editor_plugin.cpp
msgid "Display list of animations in player."
-msgstr ""
+msgstr "Εμφάνιση λίστας κινήσεων στον αναπαÏαγωγέα."
#: editor/plugins/animation_player_editor_plugin.cpp
msgid "Autoplay on Load"
-msgstr ""
+msgstr "Αυτόματη αναπαÏαγωγή"
#: editor/plugins/animation_player_editor_plugin.cpp
msgid "Edit Target Blend Times"
-msgstr ""
+msgstr "ΕπεξεÏγασία χÏόνων ανάμειξης κινήσεων"
#: editor/plugins/animation_player_editor_plugin.cpp
msgid "Animation Tools"
-msgstr ""
+msgstr "ΕÏγαλεία κινήσεων"
#: editor/plugins/animation_player_editor_plugin.cpp
msgid "Copy Animation"
-msgstr ""
+msgstr "ΑνιγÏαφή κίνησης"
#: editor/plugins/animation_player_editor_plugin.cpp
msgid "Create New Animation"
-msgstr ""
+msgstr "ΔημιουÏγία νέας κίνησης"
#: editor/plugins/animation_player_editor_plugin.cpp
msgid "Animation Name:"
-msgstr ""
+msgstr "Όνομα κίνησης:"
#: editor/plugins/animation_player_editor_plugin.cpp
#: editor/plugins/resource_preloader_editor_plugin.cpp
@@ -3071,305 +3142,308 @@ msgstr ""
#: editor/plugins/sprite_frames_editor_plugin.cpp editor/property_editor.cpp
#: editor/script_create_dialog.cpp
msgid "Error!"
-msgstr ""
+msgstr "Σφάλμα!"
#: editor/plugins/animation_player_editor_plugin.cpp
msgid "Blend Times:"
-msgstr ""
+msgstr "ΧÏόνοι ανάμειξης:"
#: editor/plugins/animation_player_editor_plugin.cpp
msgid "Next (Auto Queue):"
-msgstr ""
+msgstr "Επόμενο (Αυτόματη σειÏά):"
#: editor/plugins/animation_player_editor_plugin.cpp
msgid "Cross-Animation Blend Times"
-msgstr ""
+msgstr "ΧÏόνοι ανάμειξης κινήσεων"
#: editor/plugins/animation_player_editor_plugin.cpp
#: editor/plugins/canvas_item_editor_plugin.cpp
msgid "Animation"
-msgstr ""
+msgstr "Κίνηση"
#: editor/plugins/animation_tree_editor_plugin.cpp
msgid "New name:"
-msgstr ""
+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"
-msgstr ""
+msgstr "Ανάμειξη"
#: editor/plugins/animation_tree_editor_plugin.cpp
msgid "Mix"
-msgstr ""
+msgstr "Μείξη"
#: editor/plugins/animation_tree_editor_plugin.cpp
msgid "Auto Restart:"
-msgstr ""
+msgstr "Αυτόματη επανεκκίνηση:"
#: editor/plugins/animation_tree_editor_plugin.cpp
msgid "Restart (s):"
-msgstr ""
+msgstr "Επανεκκίνηση (δευτεÏόλεπτα):"
#: editor/plugins/animation_tree_editor_plugin.cpp
msgid "Random Restart (s):"
-msgstr ""
+msgstr "Τυχαία επανεκκίνηση (δευτεÏόλεπτα):"
#: editor/plugins/animation_tree_editor_plugin.cpp
msgid "Start!"
-msgstr ""
+msgstr "Εκκινιση!"
#: editor/plugins/animation_tree_editor_plugin.cpp
#: editor/plugins/multimesh_editor_plugin.cpp
msgid "Amount:"
-msgstr ""
+msgstr "Ποσότητα:"
#: editor/plugins/animation_tree_editor_plugin.cpp
msgid "Blend:"
-msgstr ""
+msgstr "Ανάμειξη:"
#: editor/plugins/animation_tree_editor_plugin.cpp
msgid "Blend 0:"
-msgstr ""
+msgstr "Ανάμειξη 0:"
#: editor/plugins/animation_tree_editor_plugin.cpp
msgid "Blend 1:"
-msgstr ""
+msgstr "Ανάμειξη 1:"
#: editor/plugins/animation_tree_editor_plugin.cpp
msgid "X-Fade Time (s):"
-msgstr ""
+msgstr "ΧÏόνος ÏƒÏ…Î½Î´Î¹Î±ÏƒÎ¼Î¿Ï (s):"
#: editor/plugins/animation_tree_editor_plugin.cpp
msgid "Current:"
-msgstr ""
+msgstr "ΤÏέχων:"
#: editor/plugins/animation_tree_editor_plugin.cpp
msgid "Add Input"
-msgstr ""
+msgstr "ΠÏοσθήκη εισόδου"
#: editor/plugins/animation_tree_editor_plugin.cpp
msgid "Clear Auto-Advance"
-msgstr ""
+msgstr "ΕκκαθάÏιση αυτόματης Ï€Ïοέλασης"
#: editor/plugins/animation_tree_editor_plugin.cpp
msgid "Set Auto-Advance"
-msgstr ""
+msgstr "ΟÏισμός αυτόματης Ï€Ïοέλασης"
#: editor/plugins/animation_tree_editor_plugin.cpp
msgid "Delete Input"
-msgstr ""
+msgstr "ΔιαγÏαφή εισόδου"
#: editor/plugins/animation_tree_editor_plugin.cpp
msgid "Rename"
-msgstr ""
+msgstr "Μετονομασία"
#: editor/plugins/animation_tree_editor_plugin.cpp
msgid "Animation tree is valid."
-msgstr ""
+msgstr "Το δέντÏο κίνησης είναι έγκυÏο."
#: editor/plugins/animation_tree_editor_plugin.cpp
msgid "Animation tree is invalid."
-msgstr ""
+msgstr "Το δέντÏο κίνησης δεν είναι έγκυÏο."
#: editor/plugins/animation_tree_editor_plugin.cpp
msgid "Animation Node"
-msgstr ""
+msgstr "Κόμβος κίνησης"
#: editor/plugins/animation_tree_editor_plugin.cpp
msgid "OneShot Node"
-msgstr ""
+msgstr "Κόμβος OneShot"
#: editor/plugins/animation_tree_editor_plugin.cpp
msgid "Mix Node"
-msgstr ""
+msgstr "Κόμβος μείξης"
#: editor/plugins/animation_tree_editor_plugin.cpp
msgid "Blend2 Node"
-msgstr ""
+msgstr "Κόμβος Ανάμειξης 2"
#: editor/plugins/animation_tree_editor_plugin.cpp
msgid "Blend3 Node"
-msgstr ""
+msgstr "Κόμβος Ανάμειξης 3"
#: editor/plugins/animation_tree_editor_plugin.cpp
msgid "Blend4 Node"
-msgstr ""
+msgstr "Κόμβος Ανάμειξης 4"
#: editor/plugins/animation_tree_editor_plugin.cpp
msgid "TimeScale Node"
-msgstr ""
+msgstr "Κόμβος κλιμάκωσης χÏόνου"
#: editor/plugins/animation_tree_editor_plugin.cpp
msgid "TimeSeek Node"
-msgstr ""
+msgstr "Κόμβος εÏÏεσης χÏόνου"
#: editor/plugins/animation_tree_editor_plugin.cpp
msgid "Transition Node"
-msgstr ""
+msgstr "Κόμβος μετάβασης"
#: editor/plugins/animation_tree_editor_plugin.cpp
msgid "Import Animations.."
-msgstr ""
+msgstr "Εισαγωγή κινήσεων.."
#: editor/plugins/animation_tree_editor_plugin.cpp
msgid "Edit Node Filters"
-msgstr ""
+msgstr "ΕπεξεÏγασία φίλτÏων κόμβων"
#: editor/plugins/animation_tree_editor_plugin.cpp
msgid "Filters.."
-msgstr ""
+msgstr "ΦίλτÏα.."
#: editor/plugins/baked_light_baker.cpp
msgid "Parsing %d Triangles:"
-msgstr ""
+msgstr "Ανάλυση %d ΤÏιγώνων:"
#: editor/plugins/baked_light_baker.cpp
msgid "Triangle #"
-msgstr ""
+msgstr "ΤÏίγωνο #"
#: editor/plugins/baked_light_baker.cpp
msgid "Light Baker Setup:"
-msgstr ""
+msgstr "ΡÏθμιση Ï€ÏοεπεγεÏγαστή φωτός:"
#: editor/plugins/baked_light_baker.cpp
msgid "Parsing Geometry"
-msgstr ""
+msgstr "Ανάλυση γεωμετÏίας"
#: editor/plugins/baked_light_baker.cpp
msgid "Fixing Lights"
-msgstr ""
+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 "ΔημιουÏγία Î¿ÎºÏ„Î±Î´Î¹ÎºÎ¿Ï Î´Î­Î½Ï„Ïου φωτός"
#: editor/plugins/baked_light_baker.cpp
msgid "Creating Octree Texture"
-msgstr ""
+msgstr "ΔημιουÏγία υφής Î¿ÎºÏ„Î±Î´Î¹ÎºÎ¿Ï Î´Î­Î½Ï„Ïου"
#: editor/plugins/baked_light_baker.cpp
msgid "Transfer to Lightmaps:"
-msgstr ""
+msgstr "ΜεταφοÏά στους χάÏτες φωτός:"
#: editor/plugins/baked_light_baker.cpp
msgid "Allocating Texture #"
-msgstr ""
+msgstr "Δέσμευση υφής #"
#: editor/plugins/baked_light_baker.cpp
msgid "Baking Triangle #"
-msgstr ""
+msgstr "ΠÏοεπεξεÏγασία Ï„Ïιγώνου #"
#: editor/plugins/baked_light_baker.cpp
msgid "Post-Processing Texture #"
-msgstr ""
+msgstr "ΜετεπεξεÏγασία υφής #"
#: editor/plugins/baked_light_editor_plugin.cpp
msgid "Bake!"
-msgstr ""
+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 ""
+msgstr "ΠÏοεπισκόπηση"
#: editor/plugins/canvas_item_editor_plugin.cpp
msgid "Configure Snap"
-msgstr ""
+msgstr "ΠÏοσαÏμογή Ï€Ïοσκόλλησης"
#: editor/plugins/canvas_item_editor_plugin.cpp
#: editor/plugins/polygon_2d_editor_plugin.cpp
msgid "Grid Offset:"
-msgstr ""
+msgstr "Μετατόπιση πλέγατος:"
#: editor/plugins/canvas_item_editor_plugin.cpp
#: editor/plugins/polygon_2d_editor_plugin.cpp
msgid "Grid Step:"
-msgstr ""
+msgstr "Βήμα πλέγματος:"
#: editor/plugins/canvas_item_editor_plugin.cpp
msgid "Rotation Offset:"
-msgstr ""
+msgstr "Μετατόπιση πεÏιστÏοφής:"
#: editor/plugins/canvas_item_editor_plugin.cpp
msgid "Rotation Step:"
-msgstr ""
+msgstr "Βήμα πεÏιστÏοφής:"
#: editor/plugins/canvas_item_editor_plugin.cpp
msgid "Move Pivot"
-msgstr ""
+msgstr "Μετακίνηση πηγαίου σημείου"
#: editor/plugins/canvas_item_editor_plugin.cpp
msgid "Move Action"
-msgstr ""
+msgstr "ΕνέÏγεια μετακίνησης"
#: editor/plugins/canvas_item_editor_plugin.cpp
msgid "Edit IK Chain"
-msgstr ""
+msgstr "ΕπεξεÏγασία Αλυσίδας IK"
#: editor/plugins/canvas_item_editor_plugin.cpp
msgid "Edit CanvasItem"
-msgstr ""
+msgstr "ΕπεξεÏγασία στοιχείου κανβά"
#: editor/plugins/canvas_item_editor_plugin.cpp
msgid "Change Anchors"
-msgstr ""
+msgstr "Αλλαγή αγκυÏών"
#: editor/plugins/canvas_item_editor_plugin.cpp
msgid "Zoom (%):"
-msgstr ""
+msgstr "Μεγέθυνση (%):"
#: editor/plugins/canvas_item_editor_plugin.cpp
msgid "Paste Pose"
-msgstr ""
+msgstr "Επικόληση στάσης"
#: editor/plugins/canvas_item_editor_plugin.cpp
msgid "Select Mode"
-msgstr ""
+msgstr "Επιλογή λειτουÏγίας"
#: editor/plugins/canvas_item_editor_plugin.cpp
msgid "Drag: Rotate"
-msgstr ""
+msgstr "ΣÏÏσιμο: ΠεÏιστÏοφή"
#: editor/plugins/canvas_item_editor_plugin.cpp
msgid "Alt+Drag: Move"
-msgstr ""
+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 ""
+msgstr "Alt+Δεξί κλικ: Επιλογή λίστας βάθους"
#: editor/plugins/canvas_item_editor_plugin.cpp
msgid "Move Mode"
-msgstr ""
+msgstr "ΛειτουÏγία μετακίνησης"
#: editor/plugins/canvas_item_editor_plugin.cpp
msgid "Rotate Mode"
-msgstr ""
+msgstr "ΛειτουÏγία πεÏιστÏοφής"
#: editor/plugins/canvas_item_editor_plugin.cpp
#: editor/plugins/spatial_editor_plugin.cpp
@@ -3377,30 +3451,33 @@ 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 ""
+msgstr "ΛειτουÏγία Μετακίνησης κάμεÏας"
#: editor/plugins/canvas_item_editor_plugin.cpp
msgid "Lock the selected object in place (can't be moved)."
-msgstr ""
+msgstr "Κλείδωμα του επιλεγμένου αντικείμένου (Δεν μποÏεί να μετακινηθεί)."
#: editor/plugins/canvas_item_editor_plugin.cpp
msgid "Unlock the selected object (can be moved)."
-msgstr ""
+msgstr "Ξεκλείδωμα του επιλεγμένου αντικείμένου (ΜποÏεί να μετακινηθεί)."
#: editor/plugins/canvas_item_editor_plugin.cpp
msgid "Makes sure the object's children are not selectable."
-msgstr ""
+msgstr "ΣιγουÏεÏεται ότι τα παιδιά του αντικειμένου δεν μποÏοÏν να επιλεχθοÏν."
#: editor/plugins/canvas_item_editor_plugin.cpp
msgid "Restores the object's children's ability to be selected."
-msgstr ""
+msgstr "ΕπαναφέÏει την δυνατότητα των παιδιών του αντικειμένου να επιλεγοÏν."
#: editor/plugins/canvas_item_editor_plugin.cpp
#: editor/plugins/polygon_2d_editor_plugin.cpp
@@ -3413,145 +3490,146 @@ msgstr "ΕπεξεÏγασία"
#: editor/plugins/canvas_item_editor_plugin.cpp
#: editor/plugins/spatial_editor_plugin.cpp
msgid "Use Snap"
-msgstr ""
+msgstr "ΧÏήση κουμπώματος"
#: editor/plugins/canvas_item_editor_plugin.cpp
#: editor/plugins/polygon_2d_editor_plugin.cpp
msgid "Show Grid"
-msgstr ""
+msgstr "Εμφάνιση πλέγματος"
#: editor/plugins/canvas_item_editor_plugin.cpp
msgid "Use Rotation Snap"
-msgstr ""
+msgstr "ΧÏήση κουμπώματος πεÏιστÏοφής"
#: editor/plugins/canvas_item_editor_plugin.cpp
msgid "Snap Relative"
-msgstr ""
+msgstr "Σχετικό κοÏμπωμα"
#: editor/plugins/canvas_item_editor_plugin.cpp
#: editor/plugins/spatial_editor_plugin.cpp
msgid "Configure Snap.."
-msgstr ""
+msgstr "ΔιαμόÏφωση κουμπώματος.."
#: editor/plugins/canvas_item_editor_plugin.cpp
msgid "Use Pixel Snap"
-msgstr ""
+msgstr "ΧÏήση κουμπώματος εικονοστοιχείου"
#: editor/plugins/canvas_item_editor_plugin.cpp
msgid "Expand to Parent"
-msgstr ""
+msgstr "Επικάλυψη γονέα"
#: editor/plugins/canvas_item_editor_plugin.cpp
msgid "Skeleton.."
-msgstr ""
+msgstr "Σκελετός.."
#: editor/plugins/canvas_item_editor_plugin.cpp
msgid "Make Bones"
-msgstr ""
+msgstr "ΔημιουÏγία οστών"
#: editor/plugins/canvas_item_editor_plugin.cpp
msgid "Clear Bones"
-msgstr ""
+msgstr "ΕκκαθάÏιση οστών"
#: editor/plugins/canvas_item_editor_plugin.cpp
msgid "Show Bones"
-msgstr ""
+msgstr "Εμφάνιση οστών"
#: editor/plugins/canvas_item_editor_plugin.cpp
msgid "Make IK Chain"
-msgstr ""
+msgstr "ΔημιουÏγία αλυσίδας IK"
#: editor/plugins/canvas_item_editor_plugin.cpp
msgid "Clear IK Chain"
-msgstr ""
+msgstr "ΕκκαθάÏιση αλυσίδας IK"
#: editor/plugins/canvas_item_editor_plugin.cpp
#: editor/plugins/spatial_editor_plugin.cpp
msgid "View"
-msgstr ""
+msgstr "ΚάμεÏα"
#: editor/plugins/canvas_item_editor_plugin.cpp
msgid "Zoom Reset"
-msgstr ""
+msgstr "ΕπαναφοÏά μεγέθυνσης"
#: editor/plugins/canvas_item_editor_plugin.cpp
msgid "Zoom Set.."
-msgstr ""
+msgstr "ΟÏισμός μεγέθυνσης.."
#: editor/plugins/canvas_item_editor_plugin.cpp
msgid "Center Selection"
-msgstr ""
+msgstr "ΚεντÏάÏισμα επιλογής"
#: editor/plugins/canvas_item_editor_plugin.cpp
msgid "Frame Selection"
-msgstr ""
+msgstr "Πλαισίωμα επιλογής"
#: editor/plugins/canvas_item_editor_plugin.cpp
msgid "Anchor"
-msgstr ""
+msgstr "ΆγκυÏα"
#: editor/plugins/canvas_item_editor_plugin.cpp
msgid "Insert Keys"
-msgstr ""
+msgstr "Εισαγωγή κλειδιών"
#: editor/plugins/canvas_item_editor_plugin.cpp
msgid "Insert Key"
-msgstr ""
+msgstr "Εισαγωγή κλειδιοÏ"
#: editor/plugins/canvas_item_editor_plugin.cpp
msgid "Insert Key (Existing Tracks)"
-msgstr ""
+msgstr "Εισαγωγή ÎºÎ»ÎµÎ¹Î´Î¹Î¿Ï (ΥπαÏκτά κομμάτια)"
#: editor/plugins/canvas_item_editor_plugin.cpp
msgid "Copy Pose"
-msgstr ""
+msgstr "ΑντιγÏαφή στάσης"
#: editor/plugins/canvas_item_editor_plugin.cpp
msgid "Clear Pose"
-msgstr ""
+msgstr "ΕκκαθάÏιση στάσης"
#: editor/plugins/canvas_item_editor_plugin.cpp
msgid "Set a Value"
-msgstr ""
+msgstr "ΟÏισμός τιμής"
#: editor/plugins/canvas_item_editor_plugin.cpp
msgid "Snap (Pixels):"
-msgstr ""
+msgstr "ΚοÏμπωμα (Εικονοστοιχεία):"
#: editor/plugins/canvas_item_editor_plugin.cpp
msgid "Add %s"
-msgstr ""
+msgstr "ΠÏόσθεσε %s"
#: editor/plugins/canvas_item_editor_plugin.cpp
msgid "Adding %s..."
-msgstr ""
+msgstr "ΠÏοσθήκη %s..."
#: editor/plugins/canvas_item_editor_plugin.cpp editor/scene_tree_dock.cpp
msgid "Create Node"
-msgstr ""
+msgstr "ΔημιουÏγία κόμβου"
#: editor/plugins/canvas_item_editor_plugin.cpp editor/scene_tree_dock.cpp
msgid "Error instancing scene from %s"
-msgstr ""
+msgstr "Σφάλμα κατά την αÏχικοποίηση σκηνής από %s"
#: editor/plugins/canvas_item_editor_plugin.cpp editor/scene_tree_dock.cpp
msgid "OK :("
-msgstr ""
+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 ""
+msgstr "Αυτή η λειτουÏγία απαιτεί έναν μόνο επιλεγμένο κόμβο."
#: editor/plugins/canvas_item_editor_plugin.cpp
msgid "Change default type"
-msgstr ""
+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 "Εντάξει"
@@ -3560,13 +3638,15 @@ 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 ""
+msgstr "Δημιουγία πολυγώνου"
#: editor/plugins/collision_polygon_2d_editor_plugin.cpp
#: editor/plugins/collision_polygon_editor_plugin.cpp
@@ -3575,7 +3655,7 @@ msgstr ""
#: editor/plugins/path_2d_editor_plugin.cpp
#: editor/plugins/polygon_2d_editor_plugin.cpp
msgid "Edit Poly"
-msgstr ""
+msgstr "ΕπεγεÏγασία πολυγώνου"
#: editor/plugins/collision_polygon_2d_editor_plugin.cpp
#: editor/plugins/collision_polygon_editor_plugin.cpp
@@ -3584,581 +3664,643 @@ msgstr ""
#: editor/plugins/path_2d_editor_plugin.cpp
#: editor/plugins/polygon_2d_editor_plugin.cpp
msgid "Edit Poly (Remove Point)"
-msgstr ""
+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 ""
+msgstr "ΔημιουÏγία νέου πολυγώνου από την αÏχή."
#: editor/plugins/collision_polygon_editor_plugin.cpp
msgid "Create Poly3D"
-msgstr ""
+msgstr "ΔημιουÏγία πολυγώνου 3D"
#: editor/plugins/collision_shape_2d_editor_plugin.cpp
msgid "Set Handle"
-msgstr ""
-
-#: editor/plugins/color_ramp_editor_plugin.cpp
-#: editor/plugins/gradient_texture_editor_plugin.cpp
-msgid "Add/Remove Color Ramp Point"
-msgstr ""
-
-#: editor/plugins/color_ramp_editor_plugin.cpp
-#: editor/plugins/gradient_texture_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 "ΔημιουÏγία βιβλιοθήκης πλεγμάτων"
#: editor/plugins/cube_grid_theme_editor_plugin.cpp
msgid "Thumbnail.."
-msgstr ""
+msgstr "ΜικÏογÏαφία.."
#: editor/plugins/cube_grid_theme_editor_plugin.cpp
msgid "Remove item %d?"
-msgstr ""
+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 ""
+msgstr "ΠÏοσθήκη στοιχείου"
#: editor/plugins/cube_grid_theme_editor_plugin.cpp
msgid "Remove Selected Item"
-msgstr ""
+msgstr "ΑφαίÏεση του επιλεγμένου στοιοχείου"
#: editor/plugins/cube_grid_theme_editor_plugin.cpp
msgid "Import from Scene"
-msgstr ""
+msgstr "Εισαγωγή από την σκηνή"
#: editor/plugins/cube_grid_theme_editor_plugin.cpp
msgid "Update from Scene"
-msgstr ""
+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 ""
+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 ""
+msgstr "Στοιχείο %d"
#: editor/plugins/item_list_editor_plugin.cpp
msgid "Items"
-msgstr ""
+msgstr "Στοιχεία"
#: editor/plugins/item_list_editor_plugin.cpp
msgid "Item List Editor"
-msgstr ""
+msgstr "ΕπεξεÏγαστής λίστας στοιχείων"
#: editor/plugins/light_occluder_2d_editor_plugin.cpp
msgid "Create Occluder Polygon"
-msgstr ""
+msgstr "ΔημιουÏγία πολυγώνου εμποδίου"
#: editor/plugins/light_occluder_2d_editor_plugin.cpp
#: editor/plugins/navigation_polygon_editor_plugin.cpp
msgid "Edit existing polygon:"
-msgstr ""
+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 ""
+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
msgid "Remove Point from Line2D"
-msgstr ""
+msgstr "ΔιαγÏαφή σημείου από την δισδιάστατη γÏαμμή"
#: editor/plugins/line_2d_editor_plugin.cpp
-#, fuzzy
msgid "Add Point to Line2D"
-msgstr "Πήγαινε στη γÏαμμή"
+msgstr "ΠÏόσθεσε σημείο στην δισδυάστατη γÏαμμή"
#: editor/plugins/line_2d_editor_plugin.cpp
msgid "Move Point in Line2D"
-msgstr ""
+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 ""
+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 ""
+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 ""
+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 ""
+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 ""
+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
#: editor/plugins/path_editor_plugin.cpp
msgid "Delete Point"
-msgstr ""
+msgstr "ΔιαγÏαφή σημείου"
#: editor/plugins/mesh_instance_editor_plugin.cpp
msgid "Mesh is empty!"
-msgstr ""
+msgstr "Το πλέγμα είναι άδειο!"
#: 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 "ΔημιουÏγία ÏƒÏ„Î±Ï„Î¹ÎºÎ¿Ï ÎºÏ…ÏÏ„Î¿Ï ÏƒÏŽÎ¼Î±Ï„Î¿Ï‚"
#: editor/plugins/mesh_instance_editor_plugin.cpp
msgid "This doesn't work on scene root!"
-msgstr ""
+msgstr "Αυτό δεν δουλεÏει στη Ïίζα της σκηνής!"
#: editor/plugins/mesh_instance_editor_plugin.cpp
msgid "Create Trimesh Shape"
-msgstr ""
+msgstr "ΔημιουÏγία σχήματος πλέγματος Ï„Ïιγώνων"
#: editor/plugins/mesh_instance_editor_plugin.cpp
msgid "Create Convex Shape"
-msgstr ""
+msgstr "ΔημιουÏγία κυÏÏ„Î¿Ï ÏƒÏ‡Î®Î¼Î±Ï„Î¿Ï‚"
#: editor/plugins/mesh_instance_editor_plugin.cpp
msgid "Create Navigation Mesh"
-msgstr ""
+msgstr "ΔημιουÏγία πλέγματος πλοήγησης"
#: editor/plugins/mesh_instance_editor_plugin.cpp
msgid "MeshInstance lacks a Mesh!"
-msgstr ""
+msgstr "Το στιγμιότυπο πλέγματος δεν έχει πλέγμα!"
#: editor/plugins/mesh_instance_editor_plugin.cpp
msgid "Mesh has not surface to create outlines from!"
-msgstr ""
+msgstr "Το πλέγμα δεν έχει επιφάνει από την οποία να δημιουÏγήσει πεÏιγÏάματα!"
#: editor/plugins/mesh_instance_editor_plugin.cpp
msgid "Could not create outline!"
-msgstr ""
+msgstr "Δεν ήταν δυνατή η δημιουÏγία πεÏιγÏάμματος!"
#: editor/plugins/mesh_instance_editor_plugin.cpp
msgid "Create Outline"
-msgstr ""
+msgstr "ΔημιουÏγία πεÏιγÏάμματος"
#: editor/plugins/mesh_instance_editor_plugin.cpp
msgid "Create Trimesh Static Body"
-msgstr ""
+msgstr "ΔημιουÏγία ÏƒÏ„Î±Ï„Î¹ÎºÎ¿Ï ÏƒÏŽÎ¼Î±Ï„Î¿Ï‚ πλέγματος Ï„Ïιγώνων"
#: editor/plugins/mesh_instance_editor_plugin.cpp
msgid "Create Convex Static Body"
-msgstr ""
+msgstr "ΔημιουÏγία ÏƒÏ„Î±Ï„Î¹ÎºÎ¿Ï ÎºÏ…ÏÏ„Î¿Ï ÏƒÏŽÎ¼Î±Ï„Î¿Ï‚"
#: 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 "ΔημιουÏγία Î±Î´ÎµÎ»Ï†Î¿Ï ÏƒÏγκÏουσης κυÏÏ„Î¿Ï ÏƒÏŽÎ¼Î±Ï„Î¿Ï‚"
#: editor/plugins/mesh_instance_editor_plugin.cpp
msgid "Create Outline Mesh.."
-msgstr ""
+msgstr "ΔημιουÏγία πλέγματος πεÏιγÏάμματος.."
#: editor/plugins/mesh_instance_editor_plugin.cpp
msgid "Create Outline Mesh"
-msgstr ""
+msgstr "ΔημιουÏγία πλέγματος πεÏιγÏάμματος"
#: editor/plugins/mesh_instance_editor_plugin.cpp
msgid "Outline Size:"
-msgstr ""
+msgstr "Μέγεθος πεÏιγÏάμματος:"
#: editor/plugins/multimesh_editor_plugin.cpp
msgid "No mesh source specified (and no MultiMesh set in node)."
-msgstr ""
+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 ""
+msgstr "Το πηγαίο πλέγμα δεν είναι έγκυÏο (Μη έγκυÏη διαδÏομή)."
#: editor/plugins/multimesh_editor_plugin.cpp
msgid "Mesh source is invalid (not a MeshInstance)."
-msgstr ""
+msgstr "Το πηγαίο πλέγμα δεν είναι έγκυÏο (Δεν είναι στιγμιότυπο πλέγματος)."
#: editor/plugins/multimesh_editor_plugin.cpp
msgid "Mesh source is invalid (contains no Mesh resource)."
-msgstr ""
+msgstr "Το πηγαίο πλέγμα δεν είναι έγκυÏο (Δεν πεÏιέχει πόÏο πλέγματος)."
#: 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."
-msgstr ""
+msgstr "Δεν ήταν δυνατή η χαÏτογÏάφηση της πεÏιοχής."
#: editor/plugins/multimesh_editor_plugin.cpp
msgid "Select a Source Mesh:"
-msgstr ""
+msgstr "Έπιλέξτε ένα πηγαίο πλέγμα:"
#: editor/plugins/multimesh_editor_plugin.cpp
msgid "Select a Target Surface:"
-msgstr ""
+msgstr "Επιλέξτε την στοχευμένη επιφάνεια:"
#: editor/plugins/multimesh_editor_plugin.cpp
msgid "Populate Surface"
-msgstr ""
+msgstr "ΣυμπλήÏωση επιφάνειας"
#: editor/plugins/multimesh_editor_plugin.cpp
msgid "Populate MultiMesh"
-msgstr ""
+msgstr "ΣυμπλήÏωση Ï€Î¿Î»Î»Î±Ï€Î»Î¿Ï Ï€Î»Î­Î³Î¼Î±Ï„Î¿Ï‚"
#: editor/plugins/multimesh_editor_plugin.cpp
msgid "Target Surface:"
-msgstr ""
+msgstr "Στοχευμένη επιφάνεια:"
#: editor/plugins/multimesh_editor_plugin.cpp
msgid "Source Mesh:"
-msgstr ""
+msgstr "Πηγαίο πλέγμα:"
#: editor/plugins/multimesh_editor_plugin.cpp
msgid "X-Axis"
-msgstr ""
+msgstr "Χ άξονας"
#: editor/plugins/multimesh_editor_plugin.cpp
msgid "Y-Axis"
-msgstr ""
+msgstr "Υ άξονας"
#: editor/plugins/multimesh_editor_plugin.cpp
msgid "Z-Axis"
-msgstr ""
+msgstr "Ζ άξονας"
#: editor/plugins/multimesh_editor_plugin.cpp
msgid "Mesh Up Axis:"
-msgstr ""
+msgstr "Πάνω άξονας πλέγματος:"
#: editor/plugins/multimesh_editor_plugin.cpp
msgid "Random Rotation:"
-msgstr ""
+msgstr "Τυχαία πεÏιστÏοφή:"
#: editor/plugins/multimesh_editor_plugin.cpp
msgid "Random Tilt:"
-msgstr ""
+msgstr "Τυχαία κλίση:"
#: editor/plugins/multimesh_editor_plugin.cpp
msgid "Random Scale:"
-msgstr ""
+msgstr "Τυχαία κλιμάκωση:"
#: editor/plugins/multimesh_editor_plugin.cpp
msgid "Populate"
-msgstr ""
+msgstr "ΣυμπλήÏωση"
#: editor/plugins/navigation_polygon_editor_plugin.cpp
msgid "Create Navigation Polygon"
-msgstr ""
+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 ""
+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 "ΟÏισμός μάσκας εκπομπής"
#: 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 "ΦόÏτωση μάσκας εκπομπής"
#: editor/plugins/particles_2d_editor_plugin.cpp
msgid "Generated Point Count:"
-msgstr ""
+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 ""
+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 ""
-
-#: editor/plugins/particles_editor_plugin.cpp
-msgid "Generating AABB"
-msgstr ""
+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 ""
+msgstr "ΔημιουÏία AABB"
#: editor/plugins/particles_editor_plugin.cpp
msgid "Create Emission Points From Mesh"
-msgstr ""
+msgstr "ΔημιουÏγία σημείων εκπομπής από πλέγμα"
#: editor/plugins/particles_editor_plugin.cpp
msgid "Create Emission Points From Node"
-msgstr ""
+msgstr "ΔημιουÏγία σημείων εκπομπής από κόμβο"
#: editor/plugins/particles_editor_plugin.cpp
msgid "Clear Emitter"
-msgstr ""
+msgstr "ΕκκαθάÏιση πομποÏ"
#: editor/plugins/particles_editor_plugin.cpp
msgid "Create Emitter"
-msgstr ""
+msgstr "ΔημιουÏγία πομποÏ"
#: editor/plugins/particles_editor_plugin.cpp
msgid "Emission Points:"
-msgstr ""
+msgstr "Σημεία εκπομπής:"
#: editor/plugins/particles_editor_plugin.cpp
msgid "Surface Points"
-msgstr ""
+msgstr "Σημεία επιφάνειας"
#: editor/plugins/particles_editor_plugin.cpp
msgid "Surface Points+Normal (Directed)"
-msgstr ""
+msgstr "Σημεία επιφάνειας + Κανονικό δίανυσμα (Κατευθηνόμενο)"
#: editor/plugins/particles_editor_plugin.cpp
msgid "Volume"
-msgstr ""
+msgstr "Ένταση"
#: editor/plugins/particles_editor_plugin.cpp
msgid "Emission Source: "
-msgstr ""
+msgstr "Πηγή εκπομπής: "
#: editor/plugins/particles_editor_plugin.cpp
+#, fuzzy
msgid "Generate Visibility AABB"
-msgstr ""
-
-#: editor/plugins/particles_editor_plugin.cpp
-msgid "Generation Time (sec):"
-msgstr ""
+msgstr "ΔημιουÏία AABB"
#: editor/plugins/path_2d_editor_plugin.cpp
msgid "Remove Point from Curve"
-msgstr ""
+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 ""
+msgstr "ΠÏοσθήκη σημείου στην καμπÏλη"
#: editor/plugins/path_2d_editor_plugin.cpp
msgid "Move Point in Curve"
-msgstr ""
+msgstr "Μετακίνηση σημείου στην καμπÏλη"
#: editor/plugins/path_2d_editor_plugin.cpp
msgid "Move In-Control in Curve"
-msgstr ""
+msgstr "Μετακίνηση ελεγκτή εισόδου στην καμπÏλη"
#: editor/plugins/path_2d_editor_plugin.cpp
msgid "Move Out-Control in Curve"
-msgstr ""
+msgstr "Μετακίνηση ελεγκτή εξόδου στην καμπÏλη"
#: editor/plugins/path_2d_editor_plugin.cpp
msgid "Select Control Points (Shift+Drag)"
-msgstr ""
+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
msgid "Close Curve"
-msgstr ""
+msgstr "κλείσιμο καμπÏλης"
#: editor/plugins/path_editor_plugin.cpp
msgid "Curve Point #"
-msgstr ""
+msgstr "Σημείο καμπÏλης #"
#: editor/plugins/path_editor_plugin.cpp
msgid "Set Curve Point Pos"
-msgstr ""
+msgstr "ΟÏισμός θέσης σημείου καμπÏλης"
#: editor/plugins/path_editor_plugin.cpp
msgid "Set Curve In Pos"
-msgstr ""
+msgstr "ΟÏισμός θέσης εισόδου καμπÏλης"
#: editor/plugins/path_editor_plugin.cpp
msgid "Set Curve Out Pos"
-msgstr ""
+msgstr "ΟÏισμός θέσης εξόδου καμπÏλης"
#: editor/plugins/path_editor_plugin.cpp
msgid "Split Path"
-msgstr ""
+msgstr "ΔιαχωÏισμός διαδÏομής"
#: editor/plugins/path_editor_plugin.cpp
msgid "Remove Path Point"
-msgstr ""
+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 ""
+msgstr "ΔημιουÏγία χάÏτη UV"
#: editor/plugins/polygon_2d_editor_plugin.cpp
msgid "Transform UV Map"
-msgstr ""
+msgstr "Μετασχηματισμός χάÏτη UV"
#: editor/plugins/polygon_2d_editor_plugin.cpp
msgid "Polygon 2D UV Editor"
-msgstr ""
+msgstr "ΕπεξεÏγαστής δισδιάστατου πολυγώνου"
#: editor/plugins/polygon_2d_editor_plugin.cpp
msgid "Move Point"
-msgstr ""
+msgstr "Μετακίνηση σημείου"
#: editor/plugins/polygon_2d_editor_plugin.cpp
msgid "Ctrl: Rotate"
-msgstr ""
+msgstr "Ctrl: ΠεÏιστÏοφή"
#: editor/plugins/polygon_2d_editor_plugin.cpp
msgid "Shift: Move All"
-msgstr ""
+msgstr "Shift: Μετακίνηση όλων"
#: editor/plugins/polygon_2d_editor_plugin.cpp
msgid "Shift+Ctrl: Scale"
-msgstr ""
+msgstr "Shift + Ctrl: Κλιμάκωση"
#: editor/plugins/polygon_2d_editor_plugin.cpp
msgid "Move Polygon"
-msgstr ""
+msgstr "Μετακίνηση πολυγώνου"
#: editor/plugins/polygon_2d_editor_plugin.cpp
msgid "Rotate Polygon"
-msgstr ""
+msgstr "ΠεÏιστÏοφή πολυγώνου"
#: editor/plugins/polygon_2d_editor_plugin.cpp
msgid "Scale Polygon"
-msgstr ""
+msgstr "Κλιμάκωση πολυγώνου"
#: editor/plugins/polygon_2d_editor_plugin.cpp
msgid "Polygon->UV"
-msgstr ""
+msgstr "ΠολÏγωνο -> UV"
#: editor/plugins/polygon_2d_editor_plugin.cpp
msgid "UV->Polygon"
-msgstr ""
+msgstr "UV -> ΠολÏγωνο"
#: editor/plugins/polygon_2d_editor_plugin.cpp
msgid "Clear UV"
-msgstr ""
+msgstr "ΕκκαθάÏιση UV"
#: editor/plugins/polygon_2d_editor_plugin.cpp
#: editor/plugins/spatial_editor_plugin.cpp
msgid "Snap"
-msgstr ""
+msgstr "ΚοÏμπωμα"
#: editor/plugins/polygon_2d_editor_plugin.cpp
msgid "Enable Snap"
-msgstr ""
+msgstr "ΕνεÏγοποίηση κουμπώματος"
#: editor/plugins/polygon_2d_editor_plugin.cpp
msgid "Grid"
-msgstr ""
+msgstr "Πλέγμα"
#: editor/plugins/resource_preloader_editor_plugin.cpp
msgid "ERROR: Couldn't load resource!"
-msgstr ""
+msgstr "Σφάλμα: Δεν ήταν δυνατή η φόÏτωση πόÏου!"
#: editor/plugins/resource_preloader_editor_plugin.cpp
msgid "Add Resource"
-msgstr ""
+msgstr "ΠÏοσθήκη πόÏου"
#: editor/plugins/resource_preloader_editor_plugin.cpp
msgid "Rename Resource"
-msgstr ""
+msgstr "Μετονομασία πόÏου"
#: editor/plugins/resource_preloader_editor_plugin.cpp
#: editor/plugins/sprite_frames_editor_plugin.cpp
msgid "Delete Resource"
-msgstr ""
+msgstr "ΔιαγÏαφή πόÏου"
#: editor/plugins/resource_preloader_editor_plugin.cpp
msgid "Resource clipboard is empty!"
-msgstr ""
+msgstr "Το Ï€ÏόχειÏο πόÏων είναι άδειο!"
#: editor/plugins/resource_preloader_editor_plugin.cpp
#: editor/plugins/sprite_frames_editor_plugin.cpp
msgid "Load Resource"
-msgstr ""
+msgstr "ΦόÏτωση πόÏου"
#: editor/plugins/resource_preloader_editor_plugin.cpp
#: editor/plugins/script_text_editor.cpp
@@ -4170,243 +4312,257 @@ msgstr "Επικόληση"
#: editor/plugins/rich_text_editor_plugin.cpp
msgid "Parse BBCode"
-msgstr ""
+msgstr "Ανάλυση BBCode"
#: editor/plugins/sample_editor_plugin.cpp
msgid "Length:"
-msgstr ""
+msgstr "Μήκος:"
#: editor/plugins/sample_library_editor_plugin.cpp
msgid "Open Sample File(s)"
-msgstr ""
+msgstr "Άνοιγμα αÏχείων δειγμάτων"
#: editor/plugins/sample_library_editor_plugin.cpp
msgid "ERROR: Couldn't load sample!"
-msgstr ""
+msgstr "ΣΦΑΛΜΑ: Δεν ήταν δυνατή η φόÏτωση δείγματος!"
#: editor/plugins/sample_library_editor_plugin.cpp
msgid "Add Sample"
-msgstr ""
+msgstr "ΠÏοσθήκη δείγματος"
#: editor/plugins/sample_library_editor_plugin.cpp
msgid "Rename Sample"
-msgstr ""
+msgstr "Μετονομασία δείγματος"
#: editor/plugins/sample_library_editor_plugin.cpp
msgid "Delete Sample"
-msgstr ""
+msgstr "ΔιαγÏαφή δείγματος"
#: editor/plugins/sample_library_editor_plugin.cpp
msgid "16 Bits"
-msgstr ""
+msgstr "16 Δυαδικά ψηφία"
#: editor/plugins/sample_library_editor_plugin.cpp
msgid "8 Bits"
-msgstr ""
+msgstr "8 Δυαδικά ψηφία"
#: editor/plugins/sample_library_editor_plugin.cpp
msgid "Stereo"
-msgstr ""
+msgstr "ΣτεÏεοφωνικό"
#: editor/plugins/sample_library_editor_plugin.cpp
msgid "Mono"
-msgstr ""
+msgstr "Μονοφωνικό"
#: editor/plugins/sample_library_editor_plugin.cpp
#: editor/script_editor_debugger.cpp
msgid "Format"
-msgstr ""
+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"
-msgstr ""
+msgstr "Σφάλμα κατά την αποθήκευση"
#: editor/plugins/script_editor_plugin.cpp
msgid "Error importing theme"
-msgstr ""
+msgstr "Σφάλμα κατά την εισαγωγή θέματος"
#: editor/plugins/script_editor_plugin.cpp
msgid "Error importing"
-msgstr ""
+msgstr "Σφάλμα κατά την εισαγωγή"
#: editor/plugins/script_editor_plugin.cpp
msgid "Import Theme"
-msgstr ""
+msgstr "Εισαγωγή θέματος"
#: editor/plugins/script_editor_plugin.cpp
msgid "Save Theme As.."
-msgstr ""
+msgstr "Αποθήκευση θέματος ως.."
#: editor/plugins/script_editor_plugin.cpp
msgid "Next script"
-msgstr ""
+msgstr "Επόμενη δεσμή ενεÏγειών"
#: editor/plugins/script_editor_plugin.cpp
msgid "Previous script"
-msgstr ""
+msgstr "ΠÏοηγοÏμενη δεσμή ενεÏγειών"
#: editor/plugins/script_editor_plugin.cpp
msgid "File"
-msgstr ""
+msgstr "ΑÏχείο"
#: editor/plugins/script_editor_plugin.cpp editor/property_editor.cpp
msgid "New"
-msgstr ""
+msgstr "Îέο"
#: editor/plugins/script_editor_plugin.cpp
msgid "Save All"
-msgstr ""
+msgstr "Αποθήκευση όλων"
#: editor/plugins/script_editor_plugin.cpp
msgid "Soft Reload Script"
-msgstr ""
+msgstr "Απλή επαναφόÏτωση δεσμής ενεÏγειών"
#: editor/plugins/script_editor_plugin.cpp
msgid "History Prev"
-msgstr ""
+msgstr "ΙστοÏικά Ï€ÏοηγοÏμενο"
#: editor/plugins/script_editor_plugin.cpp
msgid "History Next"
-msgstr ""
+msgstr "ΙστοÏικά επόμενο"
#: editor/plugins/script_editor_plugin.cpp
msgid "Reload Theme"
-msgstr ""
+msgstr "ΕπαναφόÏτωση θέματος"
#: editor/plugins/script_editor_plugin.cpp
msgid "Save Theme"
-msgstr ""
+msgstr "Αποθήκευση θέματος"
#: editor/plugins/script_editor_plugin.cpp
msgid "Save Theme As"
-msgstr ""
+msgstr "Αποθήκευση θέματος ως"
#: editor/plugins/script_editor_plugin.cpp
msgid "Close Docs"
-msgstr ""
+msgstr "Κλείσιμο τεκμηÏίωσης"
#: editor/plugins/script_editor_plugin.cpp
msgid "Close All"
-msgstr ""
+msgstr "Κλείσιμο όλων"
#: editor/plugins/script_editor_plugin.cpp
#: editor/plugins/script_text_editor.cpp
#: editor/plugins/shader_editor_plugin.cpp
msgid "Find.."
-msgstr ""
+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
-msgid "Debug"
-msgstr ""
+msgstr "ΕÏÏεση επόμενου"
#: editor/plugins/script_editor_plugin.cpp editor/script_editor_debugger.cpp
msgid "Step Over"
-msgstr ""
+msgstr "Βήμα πάνω"
#: editor/plugins/script_editor_plugin.cpp editor/script_editor_debugger.cpp
msgid "Step Into"
-msgstr ""
+msgstr "Βήμα μέσα"
#: editor/plugins/script_editor_plugin.cpp editor/script_editor_debugger.cpp
msgid "Break"
-msgstr ""
+msgstr "Διακοπή"
#: editor/plugins/script_editor_plugin.cpp editor/script_editor_debugger.cpp
msgid "Continue"
-msgstr ""
+msgstr "Συνέχιση"
#: editor/plugins/script_editor_plugin.cpp
msgid "Keep Debugger Open"
-msgstr ""
+msgstr "ΔιατήÏησε τον αποσφαλματωτή ανοιχτό"
#: editor/plugins/script_editor_plugin.cpp
msgid "Window"
-msgstr ""
+msgstr "ΠαÏάθυÏο"
#: editor/plugins/script_editor_plugin.cpp
msgid "Move Left"
-msgstr ""
+msgstr "Μετκίνιση αÏιστεÏά"
#: editor/plugins/script_editor_plugin.cpp
msgid "Move Right"
-msgstr ""
-
-#: editor/plugins/script_editor_plugin.cpp
-msgid "Tutorials"
-msgstr ""
+msgstr "Μετακίνηση δεξιά"
#: editor/plugins/script_editor_plugin.cpp
-msgid "Open https://godotengine.org at tutorials section."
-msgstr ""
-
-#: 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 "Πήγαινε στο Ï€ÏοηγοÏμενo έγγÏαφο."
#: 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"
-msgstr ""
+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 ""
+msgstr "ΕπαναφόÏτωση"
#: editor/plugins/script_editor_plugin.cpp
msgid "Resave"
-msgstr ""
+msgstr "Επαναποθήκευση"
#: editor/plugins/script_editor_plugin.cpp editor/script_editor_debugger.cpp
msgid "Debugger"
-msgstr ""
+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
@@ -4429,35 +4585,35 @@ msgstr "Επιλογή όλων"
#: editor/plugins/script_text_editor.cpp editor/scene_tree_dock.cpp
msgid "Move Up"
-msgstr ""
+msgstr "Μετακίνηση πάνω"
#: editor/plugins/script_text_editor.cpp editor/scene_tree_dock.cpp
msgid "Move Down"
-msgstr ""
+msgstr "Μετακίνηση κάτω"
#: editor/plugins/script_text_editor.cpp
msgid "Indent Left"
-msgstr ""
+msgstr "στοιχειοθέτηση αÏιστεÏά"
#: editor/plugins/script_text_editor.cpp
msgid "Indent Right"
-msgstr ""
+msgstr "στοιχειοθέτηση δεξιά"
#: editor/plugins/script_text_editor.cpp
msgid "Toggle Comment"
-msgstr ""
+msgstr "Εναλλαγή σχολιασμοÏ"
#: editor/plugins/script_text_editor.cpp
msgid "Clone Down"
-msgstr ""
+msgstr "Κλωνοποίηση κάτω"
#: editor/plugins/script_text_editor.cpp
msgid "Complete Symbol"
-msgstr ""
+msgstr "ΣυμπλήÏωση συμβόλου"
#: editor/plugins/script_text_editor.cpp
msgid "Trim Trailing Whitespace"
-msgstr ""
+msgstr "ΠεÏικοπή ÎºÎ±Ï„Î±Î»Î·ÎºÏ„Î¹ÎºÎ¿Ï ÎºÎµÎ½Î¿Ï Î´Î¹Î±ÏƒÏ„Î®Î¼Î±Ï„Î¿Ï‚"
#: editor/plugins/script_text_editor.cpp
msgid "Convert Indent To Spaces"
@@ -4469,7 +4625,7 @@ 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
@@ -4478,1007 +4634,1088 @@ msgstr "Εναλλαγή σημείου διακοπής"
#: editor/plugins/script_text_editor.cpp
msgid "Remove All Breakpoints"
-msgstr ""
+msgstr "ΑφαίÏεση όλων των σημείων διακοπής"
#: editor/plugins/script_text_editor.cpp
msgid "Goto Next Breakpoint"
-msgstr ""
+msgstr "Πήγαινε στο επόμενο σημείο διακοπής"
#: editor/plugins/script_text_editor.cpp
msgid "Goto Previous Breakpoint"
-msgstr ""
+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 ""
+msgstr "ΈυÏεση Ï€ÏοηγοÏμενου"
#: editor/plugins/script_text_editor.cpp
#: editor/plugins/shader_editor_plugin.cpp
msgid "Replace.."
-msgstr ""
+msgstr "Αντικατάσταση.."
#: editor/plugins/script_text_editor.cpp
msgid "Goto Function.."
-msgstr ""
+msgstr "Πήγαινε σε συνάÏτηση.."
#: editor/plugins/script_text_editor.cpp
#: editor/plugins/shader_editor_plugin.cpp
msgid "Goto Line.."
-msgstr ""
+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 ""
+msgstr "Αλλαγή μονόμετÏης σταθεÏάς"
#: editor/plugins/shader_graph_editor_plugin.cpp
msgid "Change Vec Constant"
-msgstr ""
+msgstr "Αλλαγή διανυσματικής σταθεÏάς"
#: editor/plugins/shader_graph_editor_plugin.cpp
msgid "Change RGB Constant"
-msgstr ""
+msgstr "Αλλαγή χÏωματικής σταθεÏάς"
#: editor/plugins/shader_graph_editor_plugin.cpp
msgid "Change Scalar Operator"
-msgstr ""
+msgstr "Αλλαγή μονόμετÏου τελεστή"
#: editor/plugins/shader_graph_editor_plugin.cpp
msgid "Change Vec Operator"
-msgstr ""
+msgstr "Αλλαγή Î´Î¹Î±Î½Ï…ÏƒÎ¼Î±Ï„Î¹ÎºÎ¿Ï Ï„ÎµÎ»ÎµÏƒÏ„Î®"
#: editor/plugins/shader_graph_editor_plugin.cpp
msgid "Change Vec Scalar Operator"
-msgstr ""
+msgstr "Αλλαγή Î´Î¹Î±Î½Ï…ÏƒÎ¼Î±Ï„Î¹ÎºÎ¿Ï - μονόμετÏου τελεστή"
#: editor/plugins/shader_graph_editor_plugin.cpp
msgid "Change RGB Operator"
-msgstr ""
+msgstr "Αλλαγή χÏÏ‰Î¼Î±Ï„Î¹ÎºÎ¿Ï Ï„ÎµÎ»ÎµÏƒÏ„Î®"
#: editor/plugins/shader_graph_editor_plugin.cpp
msgid "Toggle Rot Only"
-msgstr ""
+msgstr "Εναλλαγή μόνο πεÏιστÏοφή"
#: editor/plugins/shader_graph_editor_plugin.cpp
msgid "Change Scalar Function"
-msgstr ""
+msgstr "Αλλαγή μονόμετÏης συνάÏτησης"
#: editor/plugins/shader_graph_editor_plugin.cpp
msgid "Change Vec Function"
-msgstr ""
+msgstr "Αλλαγή διανυσματικής συνάÏτησης"
#: editor/plugins/shader_graph_editor_plugin.cpp
msgid "Change Scalar Uniform"
-msgstr ""
+msgstr "Αλλαγή μονόμετÏης ομοιόμοÏφης μεταβλητής"
#: editor/plugins/shader_graph_editor_plugin.cpp
msgid "Change Vec Uniform"
-msgstr ""
+msgstr "Αλλαγή διανυσματικής ομοιόμοÏφης μεταβλητής"
#: editor/plugins/shader_graph_editor_plugin.cpp
msgid "Change RGB Uniform"
-msgstr ""
+msgstr "Αλλαγή χÏωματικής ομοιόμοÏφης μεταβλητής"
#: editor/plugins/shader_graph_editor_plugin.cpp
msgid "Change Default Value"
-msgstr ""
+msgstr "Αλλαγή Ï€Ïοεπιλλεγμένης τιμής"
#: editor/plugins/shader_graph_editor_plugin.cpp
msgid "Change XForm Uniform"
-msgstr ""
+msgstr "Αλλαγή ομοιόμοÏφης μεταβλητής XForm"
#: editor/plugins/shader_graph_editor_plugin.cpp
msgid "Change Texture Uniform"
-msgstr ""
+msgstr "Αλλαγή ομοιόμοÏφης μεταβλητής υφής"
#: editor/plugins/shader_graph_editor_plugin.cpp
msgid "Change Cubemap Uniform"
-msgstr ""
+msgstr "Αλλαγή ομοιόμοÏφης μεταβλητής χάÏτη κÏβου"
#: editor/plugins/shader_graph_editor_plugin.cpp
msgid "Change Comment"
-msgstr ""
+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"
-msgstr ""
+msgstr "Αλλαγή ονόματος εισόδου"
#: editor/plugins/shader_graph_editor_plugin.cpp
msgid "Connect Graph Nodes"
-msgstr ""
+msgstr "ΣÏνδεση κόμβων γÏαφήματος"
#: editor/plugins/shader_graph_editor_plugin.cpp
msgid "Disconnect Graph Nodes"
-msgstr ""
+msgstr "ΑποσÏνδεση κόμβων γÏαφήματος"
#: editor/plugins/shader_graph_editor_plugin.cpp
msgid "Remove Shader Graph Node"
-msgstr ""
+msgstr "ΑφαίÏεση κόμβου γÏαφήματος"
#: editor/plugins/shader_graph_editor_plugin.cpp
msgid "Move Shader Graph Node"
-msgstr ""
+msgstr "Μετακίνηση κόμβου γÏαφήματος"
#: editor/plugins/shader_graph_editor_plugin.cpp
msgid "Duplicate Graph Node(s)"
-msgstr ""
+msgstr "Διπλασιασμός κόμβων γÏαφήματος"
#: editor/plugins/shader_graph_editor_plugin.cpp
msgid "Delete Shader Graph Node(s)"
-msgstr ""
+msgstr "ΔιαγÏαφή κόμβων γÏαφήματος"
#: editor/plugins/shader_graph_editor_plugin.cpp
msgid "Error: Cyclic Connection Link"
-msgstr ""
+msgstr "Σφάλμα: Κυκλικός σÏνδεσμος"
#: editor/plugins/shader_graph_editor_plugin.cpp
msgid "Error: Missing Input Connections"
-msgstr ""
+msgstr "Σφάλμα: Οι συνδέσεις εισόδου λείπουν"
#: editor/plugins/shader_graph_editor_plugin.cpp
msgid "Add Shader Graph Node"
-msgstr ""
+msgstr "ΠÏοσθήκη κόμβου γÏαφήματος"
#: editor/plugins/spatial_editor_plugin.cpp
msgid "Orthogonal"
-msgstr ""
+msgstr "ΟÏθογώνια"
#: editor/plugins/spatial_editor_plugin.cpp
msgid "Perspective"
-msgstr ""
+msgstr "ΠÏοοπτική"
#: editor/plugins/spatial_editor_plugin.cpp
msgid "Transform Aborted."
-msgstr ""
+msgstr "Ο μετασχηματισμός ματαιώθηκε."
#: editor/plugins/spatial_editor_plugin.cpp
msgid "X-Axis Transform."
-msgstr ""
+msgstr "Μετασχηματισμός στον Χ άξονα."
#: editor/plugins/spatial_editor_plugin.cpp
msgid "Y-Axis Transform."
-msgstr ""
+msgstr "Μετασχηματισμός στον Υ άξονα."
#: editor/plugins/spatial_editor_plugin.cpp
msgid "Z-Axis Transform."
-msgstr ""
+msgstr "Μετασχηματισμός στον Ζ άξονα."
#: editor/plugins/spatial_editor_plugin.cpp
msgid "View Plane Transform."
-msgstr ""
+msgstr "Μετασχηματισμός στο επίπεδο θέασης."
#: editor/plugins/spatial_editor_plugin.cpp
msgid "Scaling to %s%%."
-msgstr ""
+msgstr "Κλιμάκωση to %s%%."
#: editor/plugins/spatial_editor_plugin.cpp
msgid "Rotating %s degrees."
-msgstr ""
+msgstr "ΠεÏιστÏοφή %s μοίÏες."
#: editor/plugins/spatial_editor_plugin.cpp
msgid "Bottom View."
-msgstr ""
+msgstr "Κάτω όψη."
#: editor/plugins/spatial_editor_plugin.cpp
msgid "Bottom"
-msgstr ""
+msgstr "Κάτω"
#: editor/plugins/spatial_editor_plugin.cpp
msgid "Top View."
-msgstr ""
+msgstr "Πάνω όψη."
#: 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 ""
+"Η δημιουÏγία κλειδιών είναι απενεÏγοποιημένη (Δεν έχει εισαχθεί κλειδί)."
#: editor/plugins/spatial_editor_plugin.cpp
msgid "Animation Key Inserted."
-msgstr ""
+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"
-msgstr ""
+#, fuzzy
+msgid "Freelook Forward"
+msgstr "Πήγαινε μπÏοστά"
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Gizmos"
+#, fuzzy
+msgid "Freelook Backwards"
+msgstr "ΑντίστÏοφα"
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Freelook Up"
msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "XForm Dialog"
+#, fuzzy
+msgid "Freelook Down"
+msgstr "Ροδέλα κάτω."
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Freelook Speed Modifier"
msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "No scene selected to instance!"
+msgid "Objects Drawn"
msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Instance at Cursor"
+#, 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 "Could not instance scene!"
+#, 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 ""
+msgstr "ΛειτουÏγία μετακίνησης (W)"
#: editor/plugins/spatial_editor_plugin.cpp
msgid "Rotate Mode (E)"
-msgstr ""
+msgstr "ΛειτουÏγία πεÏιστÏοφής (E)"
#: editor/plugins/spatial_editor_plugin.cpp
msgid "Scale Mode (R)"
-msgstr ""
+msgstr "ΛειτουÏγία κλιμάκωσης (R)"
#: editor/plugins/spatial_editor_plugin.cpp
msgid "Bottom View"
-msgstr ""
+msgstr "Κάτω όψη"
#: editor/plugins/spatial_editor_plugin.cpp
msgid "Top View"
-msgstr ""
+msgstr "Πάνω όψη"
#: editor/plugins/spatial_editor_plugin.cpp
msgid "Rear View"
-msgstr ""
+msgstr "Πίσω όψη"
#: editor/plugins/spatial_editor_plugin.cpp
msgid "Front View"
-msgstr ""
+msgstr "ΕμπÏόσθια όψη"
#: editor/plugins/spatial_editor_plugin.cpp
msgid "Left View"
-msgstr ""
+msgstr "ΑÏιστεÏή όψη"
#: editor/plugins/spatial_editor_plugin.cpp
msgid "Right View"
-msgstr ""
+msgstr "Δεξιά όψη"
#: editor/plugins/spatial_editor_plugin.cpp
msgid "Switch Perspective/Orthogonal view"
-msgstr ""
+msgstr "Εναλλαγή ΠÏοοπτικής / ΟÏθογώνιας Ï€Ïοβολής"
#: editor/plugins/spatial_editor_plugin.cpp
msgid "Insert Animation Key"
-msgstr ""
+msgstr "Εισαγωγή ÎºÎ»ÎµÎ¹Î´Î¹Î¿Ï ÎºÎ¯Î½Î·ÏƒÎ·Ï‚"
#: editor/plugins/spatial_editor_plugin.cpp
msgid "Focus Origin"
-msgstr ""
+msgstr "Εστίαση στην αÏχή"
#: editor/plugins/spatial_editor_plugin.cpp
msgid "Focus Selection"
-msgstr ""
+msgstr "Εστίαση στην επιλογή"
#: editor/plugins/spatial_editor_plugin.cpp
msgid "Align Selection With View"
-msgstr ""
+msgstr "Στοίχηση επιλογής με την Ï€Ïοβολή"
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Transform"
-msgstr ""
+#, fuzzy
+msgid "Tool Select"
+msgstr "Επιλογή"
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Local Coords"
-msgstr ""
+#, fuzzy
+msgid "Tool Move"
+msgstr "Μετακίνηση"
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Transform Dialog.."
-msgstr ""
+#, fuzzy
+msgid "Tool Rotate"
+msgstr "Ctrl: ΠεÏιστÏοφή"
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Use Default Light"
-msgstr ""
+#, fuzzy
+msgid "Tool Scale"
+msgstr "Κλιμάκωση:"
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Use Default sRGB"
-msgstr ""
+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 ""
+msgstr "1 Οπτική γωνία"
#: editor/plugins/spatial_editor_plugin.cpp
msgid "2 Viewports"
-msgstr ""
+msgstr "2 Οπτικές γωνίες"
#: editor/plugins/spatial_editor_plugin.cpp
msgid "2 Viewports (Alt)"
-msgstr ""
+msgstr "2 Οπτικές γωνίες (Εναλλακτικό)"
#: editor/plugins/spatial_editor_plugin.cpp
msgid "3 Viewports"
-msgstr ""
+msgstr "3 Οπτικές γωνίες"
#: editor/plugins/spatial_editor_plugin.cpp
msgid "3 Viewports (Alt)"
-msgstr ""
+msgstr "3 Οπτικές γωνίες (Εναλλακτικό)"
#: 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 Οπτικές γωνίες"
#: editor/plugins/spatial_editor_plugin.cpp
msgid "View Origin"
-msgstr ""
+msgstr "ΠÏοβολή ΑÏχής"
#: editor/plugins/spatial_editor_plugin.cpp
msgid "View Grid"
-msgstr ""
+msgstr "ΠÏοβολή πλέγματος"
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Settings"
+msgstr "Ρυθμίσεις"
#: editor/plugins/spatial_editor_plugin.cpp
msgid "Snap Settings"
-msgstr ""
+msgstr "Ρυθμίσεις κουμπώματος"
#: editor/plugins/spatial_editor_plugin.cpp
msgid "Translate Snap:"
-msgstr ""
+msgstr "ΚοÏμπωμα μετατόπισης:"
#: editor/plugins/spatial_editor_plugin.cpp
msgid "Rotate Snap (deg.):"
-msgstr ""
+msgstr "ΚοÏμπωμα πεÏιστÏοφής (μοίÏες):"
#: editor/plugins/spatial_editor_plugin.cpp
msgid "Scale Snap (%):"
-msgstr ""
+msgstr "ΚοÏμπωμα κλιμάκωσης (%):"
#: 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 "Ρυθμίσεις οπτικής γωνίας"
#: editor/plugins/spatial_editor_plugin.cpp
msgid "Perspective FOV (deg.):"
-msgstr ""
+msgstr "ΈυÏος Î¿Ï€Ï„Î¹ÎºÎ¿Ï Ï€ÎµÎ´Î¯Î¿Ï… Ï€Ïοοπτικής (μοίÏες):"
#: editor/plugins/spatial_editor_plugin.cpp
msgid "View Z-Near:"
-msgstr ""
+msgstr "Κοντινό απόσταση Ï€Ïοβολής:"
#: editor/plugins/spatial_editor_plugin.cpp
msgid "View Z-Far:"
-msgstr ""
+msgstr "ΜακÏινή απόσταση Ï€Ïοβολής:"
#: editor/plugins/spatial_editor_plugin.cpp
msgid "Transform Change"
-msgstr ""
+msgstr "Αλλαγή μετασχηματισμοÏ"
#: editor/plugins/spatial_editor_plugin.cpp
msgid "Translate:"
-msgstr ""
+msgstr "Μετατόπιση:"
#: editor/plugins/spatial_editor_plugin.cpp
msgid "Rotate (deg.):"
-msgstr ""
+msgstr "ΠεÏιστÏοφή (μοίÏες):"
#: editor/plugins/spatial_editor_plugin.cpp
msgid "Scale (ratio):"
-msgstr ""
+msgstr "Κλιμάκωση (αναλογία):"
#: editor/plugins/spatial_editor_plugin.cpp
msgid "Transform Type"
-msgstr ""
+msgstr "Είδος μετασχηματισμοÏ"
#: editor/plugins/spatial_editor_plugin.cpp
msgid "Pre"
-msgstr ""
+msgstr "ΠÏιν"
#: editor/plugins/spatial_editor_plugin.cpp
msgid "Post"
-msgstr ""
+msgstr "Μετά"
#: editor/plugins/sprite_frames_editor_plugin.cpp
msgid "ERROR: Couldn't load frame resource!"
-msgstr ""
+msgstr "ΣΦΑΛΜΑ: Δεν ήταν δυνατή η φόÏτωση πόÏου Ï„Ïπου καÏέ!"
#: editor/plugins/sprite_frames_editor_plugin.cpp
msgid "Add Frame"
-msgstr ""
+msgstr "ΠÏοσθήκη καÏέ"
#: editor/plugins/sprite_frames_editor_plugin.cpp
msgid "Resource clipboard is empty or not a texture!"
-msgstr ""
+msgstr "Το Ï€ÏόχειÏο πόÏων είναι άδειο ή δεν είναι υφή!"
#: editor/plugins/sprite_frames_editor_plugin.cpp
msgid "Paste Frame"
-msgstr ""
+msgstr "Επικόλληση καÏέ"
#: editor/plugins/sprite_frames_editor_plugin.cpp
msgid "Add Empty"
-msgstr ""
+msgstr "ΠÏοσθήκη άδειου"
#: editor/plugins/sprite_frames_editor_plugin.cpp
msgid "Change Animation Loop"
-msgstr ""
+msgstr "Αλλαγή βÏόχου κίνησης"
#: editor/plugins/sprite_frames_editor_plugin.cpp
msgid "Change Animation FPS"
-msgstr ""
+msgstr "Αλλαγή FPS κίνησης"
#: editor/plugins/sprite_frames_editor_plugin.cpp
msgid "(empty)"
-msgstr ""
+msgstr "(άδειο)"
#: editor/plugins/sprite_frames_editor_plugin.cpp
msgid "Animations"
-msgstr ""
+msgstr "Κινήσεις"
#: editor/plugins/sprite_frames_editor_plugin.cpp
msgid "Speed (FPS):"
-msgstr ""
+msgstr "ΤαχÏτητα (FPS):"
#: editor/plugins/sprite_frames_editor_plugin.cpp
msgid "Animation Frames"
-msgstr ""
+msgstr "ΚαÏέ κίνησης"
#: editor/plugins/sprite_frames_editor_plugin.cpp
msgid "Insert Empty (Before)"
-msgstr ""
+msgstr "Εισαγωγή άδειου (ΠÏιν)"
#: editor/plugins/sprite_frames_editor_plugin.cpp
msgid "Insert Empty (After)"
-msgstr ""
+msgstr "Εισαγωγή άδειου (Μετά)"
#: editor/plugins/sprite_frames_editor_plugin.cpp
msgid "Up"
-msgstr ""
+msgstr "Πάνω"
#: editor/plugins/sprite_frames_editor_plugin.cpp
msgid "Down"
-msgstr ""
+msgstr "Κάτω"
#: editor/plugins/style_box_editor_plugin.cpp
msgid "StyleBox Preview:"
-msgstr ""
+msgstr "ΠÏοεπισκόπηση StyleBox:"
#: editor/plugins/texture_region_editor_plugin.cpp
msgid "Snap Mode:"
-msgstr ""
+msgstr "ΛειτουÏγία κουμπώματος:"
#: editor/plugins/texture_region_editor_plugin.cpp
msgid "<None>"
-msgstr ""
+msgstr "<Τίποτα>"
#: editor/plugins/texture_region_editor_plugin.cpp
msgid "Pixel Snap"
-msgstr ""
+msgstr "ΚοÏμπωμα στα εικονοστοιχεία"
#: editor/plugins/texture_region_editor_plugin.cpp
msgid "Grid Snap"
-msgstr ""
+msgstr "ΚοÏμπωμα στο πλέγμα"
#: editor/plugins/texture_region_editor_plugin.cpp
msgid "Auto Slice"
-msgstr ""
+msgstr "Αυτόματο κόψιμο"
#: editor/plugins/texture_region_editor_plugin.cpp
msgid "Offset:"
-msgstr ""
+msgstr "Μετατόπιση:"
#: editor/plugins/texture_region_editor_plugin.cpp
msgid "Step:"
-msgstr ""
+msgstr "Βήμα:"
#: editor/plugins/texture_region_editor_plugin.cpp
msgid "Separation:"
-msgstr ""
+msgstr "ΔιαχωÏισμός:"
#: editor/plugins/texture_region_editor_plugin.cpp
msgid "Texture Region"
-msgstr ""
+msgstr "ΠεÏιοχή υφής"
#: editor/plugins/texture_region_editor_plugin.cpp
msgid "Texture Region Editor"
-msgstr ""
+msgstr "ΕπεξεÏγαστής πεÏιοχής υφής"
#: editor/plugins/theme_editor_plugin.cpp
msgid "Can't save theme to file:"
-msgstr ""
+msgstr "Δεν ήταν δυνατή η αποθήκευση θέματος σε αÏχείο:"
#: editor/plugins/theme_editor_plugin.cpp
msgid "Add All Items"
-msgstr ""
+msgstr "ΠÏοσθήκη όλων των στοιχείων"
#: editor/plugins/theme_editor_plugin.cpp
msgid "Add All"
-msgstr ""
+msgstr "ΠÏοσθήκη όλων"
#: editor/plugins/theme_editor_plugin.cpp
#: editor/plugins/tile_set_editor_plugin.cpp
msgid "Remove Item"
-msgstr ""
+msgstr "ΑφαίÏεση στοιχείου"
#: editor/plugins/theme_editor_plugin.cpp
msgid "Theme"
-msgstr ""
+msgstr "Θέμα"
#: editor/plugins/theme_editor_plugin.cpp
msgid "Add Class Items"
-msgstr ""
+msgstr "ΠÏοσθήκη στοιχείων κλάσης"
#: editor/plugins/theme_editor_plugin.cpp
msgid "Remove Class Items"
-msgstr ""
+msgstr "ΑφαίÏεση στοιχείων κλάσης"
#: editor/plugins/theme_editor_plugin.cpp
msgid "Create Empty Template"
-msgstr ""
+msgstr "ΔημιουÏγία άδειου Ï€ÏοτÏπου"
#: editor/plugins/theme_editor_plugin.cpp
msgid "Create Empty Editor Template"
-msgstr ""
+msgstr "ΔημιουÏγία άδειου Ï€ÏοτÏπου επεξεÏγαστή"
#: editor/plugins/theme_editor_plugin.cpp
msgid "CheckBox Radio1"
-msgstr ""
+msgstr "Κουμπί επιλογής1"
#: editor/plugins/theme_editor_plugin.cpp
msgid "CheckBox Radio2"
-msgstr ""
+msgstr "Κουμπί επιλογής 2"
#: editor/plugins/theme_editor_plugin.cpp
msgid "Item"
-msgstr ""
+msgstr "Στοιχείο"
#: editor/plugins/theme_editor_plugin.cpp
msgid "Check Item"
-msgstr ""
+msgstr "Επιλογή στοιχείου"
#: editor/plugins/theme_editor_plugin.cpp
msgid "Checked Item"
-msgstr ""
+msgstr "Επιλεγμένο στοιχείο"
#: editor/plugins/theme_editor_plugin.cpp
msgid "Has"
-msgstr ""
+msgstr "Έχει"
#: editor/plugins/theme_editor_plugin.cpp
msgid "Many"
-msgstr ""
+msgstr "Πολλές"
#: editor/plugins/theme_editor_plugin.cpp editor/project_export.cpp
msgid "Options"
-msgstr ""
+msgstr "Επιλογές"
#: editor/plugins/theme_editor_plugin.cpp
msgid "Have,Many,Several,Options!"
-msgstr ""
+msgstr "Έχει,ΠάÏα,Πολλές,Επιλογές!"
#: editor/plugins/theme_editor_plugin.cpp
msgid "Tab 1"
-msgstr ""
+msgstr "ΚαÏτέλα 1"
#: editor/plugins/theme_editor_plugin.cpp
msgid "Tab 2"
-msgstr ""
+msgstr "ΚαÏτέλα 2"
#: editor/plugins/theme_editor_plugin.cpp
msgid "Tab 3"
-msgstr ""
+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 ""
+msgstr "ΤÏπος:"
#: editor/plugins/theme_editor_plugin.cpp
msgid "Data Type:"
-msgstr ""
+msgstr "ΤÏπος δεδομένων:"
#: editor/plugins/theme_editor_plugin.cpp
msgid "Icon"
-msgstr ""
+msgstr "Εικονίδιο"
#: editor/plugins/theme_editor_plugin.cpp
msgid "Style"
-msgstr ""
+msgstr "Στυλ"
#: editor/plugins/theme_editor_plugin.cpp
msgid "Color"
-msgstr ""
+msgstr "ΧÏώμα"
#: editor/plugins/tile_map_editor_plugin.cpp
msgid "Paint TileMap"
-msgstr ""
+msgstr "Βάψιμο TileMap"
#: editor/plugins/tile_map_editor_plugin.cpp editor/scene_tree_dock.cpp
msgid "Duplicate"
-msgstr ""
+msgstr "Διπλασιασμός"
#: editor/plugins/tile_map_editor_plugin.cpp
msgid "Erase TileMap"
-msgstr ""
+msgstr "ΔιαγÏαφή TileMap"
#: editor/plugins/tile_map_editor_plugin.cpp
msgid "Erase selection"
-msgstr ""
+msgstr "ΔιαγÏαφή επιλογής"
#: editor/plugins/tile_map_editor_plugin.cpp
msgid "Find tile"
-msgstr ""
+msgstr "ΕÏÏεση πλακιδίου"
#: editor/plugins/tile_map_editor_plugin.cpp
msgid "Transpose"
-msgstr ""
+msgstr "Μετατόπιση"
#: editor/plugins/tile_map_editor_plugin.cpp
msgid "Mirror X"
-msgstr ""
+msgstr "ΣυμμετÏία στον άξονα Χ"
#: editor/plugins/tile_map_editor_plugin.cpp
msgid "Mirror Y"
-msgstr ""
+msgstr "ΣυμμετÏία στον άξονα Î¥"
#: editor/plugins/tile_map_editor_plugin.cpp
msgid "Bucket"
-msgstr ""
+msgstr "Κουβάς"
#: editor/plugins/tile_map_editor_plugin.cpp
msgid "Pick Tile"
-msgstr ""
+msgstr "Επιλογή πλακιδίου"
#: editor/plugins/tile_map_editor_plugin.cpp
msgid "Select"
-msgstr ""
+msgstr "Επιλογή"
#: editor/plugins/tile_map_editor_plugin.cpp
msgid "Rotate 0 degrees"
-msgstr ""
+msgstr "ΠεÏιστÏοφή 0 μοίÏες"
#: editor/plugins/tile_map_editor_plugin.cpp
msgid "Rotate 90 degrees"
-msgstr ""
+msgstr "ΠεÏιστÏοφή 90 μοίÏες"
#: editor/plugins/tile_map_editor_plugin.cpp
msgid "Rotate 180 degrees"
-msgstr ""
+msgstr "ΠεÏιστÏοφή 180 μοίÏες"
#: editor/plugins/tile_map_editor_plugin.cpp
msgid "Rotate 270 degrees"
-msgstr ""
+msgstr "ΠεÏιστÏοφή 270 μοίÏες"
#: editor/plugins/tile_set_editor_plugin.cpp
msgid "Could not find tile:"
-msgstr ""
+msgstr "Δεν ήταν δυνατή η εÏÏεση πλακιδίου:"
#: editor/plugins/tile_set_editor_plugin.cpp
msgid "Item name or ID:"
-msgstr ""
+msgstr "Όνομα στοιχείου ή αναγνωÏιστικοÏ:"
#: editor/plugins/tile_set_editor_plugin.cpp
msgid "Create from scene?"
-msgstr ""
+msgstr "ΔημιουÏγία από σκηνή;"
#: editor/plugins/tile_set_editor_plugin.cpp
msgid "Merge from scene?"
-msgstr ""
+msgstr "Συγχώνευση από σκηνή;"
#: editor/plugins/tile_set_editor_plugin.cpp
msgid "Create from Scene"
-msgstr ""
+msgstr "ΔημιουÏγία από σκηνή"
#: editor/plugins/tile_set_editor_plugin.cpp
msgid "Merge from Scene"
-msgstr ""
+msgstr "Συγχώνευση από σκηνή"
#: editor/plugins/tile_set_editor_plugin.cpp editor/script_editor_debugger.cpp
msgid "Error"
-msgstr ""
+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
msgid "Presets"
-msgstr ""
+msgstr "ΔιαμοÏφώσεις"
#: editor/project_export.cpp editor/project_settings.cpp
msgid "Add.."
-msgstr ""
+msgstr "ΠÏοσθήκη.."
#: editor/project_export.cpp
msgid "Resources"
-msgstr ""
+msgstr "ΠόÏοι"
#: editor/project_export.cpp
-#, fuzzy
msgid "Export all resources in the project"
-msgstr "Εισαγωγή πόÏων στο έÏγο."
+msgstr "Εξαγωγή όλων των πόÏων στο έÏγο"
#: editor/project_export.cpp
msgid "Export selected scenes (and dependencies)"
-msgstr ""
+msgstr "Εξαγωγή επιλεγμένων σκηνών (και εξαÏτήσεων)"
#: editor/project_export.cpp
msgid "Export selected resources (and dependencies)"
-msgstr ""
+msgstr "Εξαγωγή επιλεγμένων πόÏων (και εξαÏτήσεων)"
#: editor/project_export.cpp
msgid "Export Mode:"
-msgstr ""
+msgstr "ΛειτουÏγία εξαγωγής:"
#: editor/project_export.cpp
msgid "Resources to export:"
-msgstr ""
+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
-#, fuzzy
msgid "Patches"
-msgstr "Αντιστοιχίες:"
+msgstr "ΕνημεÏώσεις"
#: editor/project_export.cpp
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 ""
+msgstr "Μη έγκυÏη διαδÏομή έÏγου, η διαδÏομή Ï€Ïέπει να υπάÏχει!"
#: editor/project_manager.cpp
-msgid "Invalid project path, *.godot must not exist."
-msgstr ""
+#, fuzzy
+msgid "Invalid project path, project.godot must not exist."
+msgstr "Μη έγκυÏη διαδÏομή έÏγου, το godot.cfg δεν Ï€Ïέπει να υπάÏχει."
#: editor/project_manager.cpp
-msgid "Invalid project path, *.godot must exist."
-msgstr ""
+#, fuzzy
+msgid "Invalid project path, project.godot must exist."
+msgstr "Μη έγκυÏη διαδÏομή έÏγου, το godot.cfg Ï€Ïέπει να υπάÏχει."
#: editor/project_manager.cpp
msgid "Imported Project"
-msgstr ""
+msgstr "Εισαγμένο έÏγο"
#: editor/project_manager.cpp
msgid "Invalid project path (changed anything?)."
-msgstr ""
+msgstr "Μη έγκυÏη διαδÏομή έÏγου (Αλλάξατε τίποτα;)."
#: editor/project_manager.cpp
-msgid "Couldn't create *.godot project file in project path."
-msgstr ""
+#, 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 ""
+msgstr "Η εξαγωγή των ακόλουθων αÏχείων από το πακέτο απέτυχε:"
#: editor/project_manager.cpp
msgid "Package Installed Successfully!"
-msgstr ""
+msgstr "Το πακέτο εγκαταστάθηκε επιτυχώς!"
#: editor/project_manager.cpp
msgid "Import Existing Project"
-msgstr ""
+msgstr "Εισαγωγή υπαÏÎºÏ„Î¿Ï Î­Ïγου"
#: editor/project_manager.cpp
msgid "Project Path (Must Exist):"
-msgstr ""
+msgstr "ΔιαδÏομή έÏγου (ΠÏέπει να υπάÏχει):"
#: editor/project_manager.cpp
msgid "Project Name:"
-msgstr ""
+msgstr "Όνομα έÏγου:"
#: editor/project_manager.cpp
msgid "Create New Project"
-msgstr ""
+msgstr "ΔημιουÏγία νέου έÏγου"
#: editor/project_manager.cpp
msgid "Project Path:"
-msgstr ""
+msgstr "ΔιαδÏομή έÏγου:"
#: editor/project_manager.cpp
msgid "Install Project:"
-msgstr ""
+msgstr "Εγκατάσταση έÏγου:"
#: editor/project_manager.cpp
msgid "Browse"
-msgstr ""
+msgstr "ΠεÏιήγηση"
#: editor/project_manager.cpp
msgid "New Game Project"
-msgstr ""
+msgstr "Îέο έÏγο παιχνιδιοÏ"
#: editor/project_manager.cpp
msgid "That's a BINGO!"
-msgstr ""
+msgstr "Αυτό είναι ένα «ΕÏÏηκα»!"
#: editor/project_manager.cpp
msgid "Unnamed Project"
-msgstr ""
+msgstr "Ανώνυμο έÏγο"
#: editor/project_manager.cpp
msgid "Are you sure to open more than one project?"
-msgstr ""
+msgstr "Είστε σίγουÏοι πως θέλετε να ανοίξετε πεÏισσότεÏα από ένα έÏγα;"
#: editor/project_manager.cpp
msgid "Are you sure to run more than one project?"
-msgstr ""
+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 ""
+msgstr "ΔιαχειÏιστής"
#: editor/project_manager.cpp
msgid "Project List"
-msgstr ""
+msgstr "Λίστα έÏγων"
#: editor/project_manager.cpp
msgid "Run"
-msgstr ""
+msgstr "Εκτέλεση"
#: editor/project_manager.cpp
msgid "Scan"
-msgstr ""
+msgstr "ΣάÏωση"
#: editor/project_manager.cpp
msgid "Select a Folder to Scan"
-msgstr ""
+msgstr "Επιλέξτε έναν φάκελο για σάÏωση"
#: editor/project_manager.cpp
msgid "New Project"
-msgstr ""
+msgstr "Îέο έÏγο"
#: editor/project_manager.cpp
#, fuzzy
msgid "Templates"
-msgstr "ΑφαίÏεση επιλογής"
+msgstr "ΑφαίÏεση Ï€ÏοτÏπου"
#: editor/project_manager.cpp
msgid "Exit"
-msgstr ""
+msgstr "Έξοδος"
#: editor/project_settings.cpp
msgid "Key "
-msgstr ""
+msgstr "Κλειδί "
#: editor/project_settings.cpp
msgid "Joy Button"
-msgstr ""
+msgstr "Κουμπί Joystick"
#: editor/project_settings.cpp
msgid "Joy Axis"
-msgstr ""
+msgstr "Άξονας Joystick"
#: editor/project_settings.cpp
msgid "Mouse Button"
-msgstr ""
+msgstr "Κουμπί ποντικιοÏ"
#: editor/project_settings.cpp
msgid "Invalid action (anything goes but '/' or ':')."
-msgstr ""
+msgstr "Μη έγκυÏη ενέÏγεια (Όλα επιτÏέποντα εκτός από το '/' και το ':')."
#: editor/project_settings.cpp
msgid "Action '%s' already exists!"
-msgstr ""
+msgstr "Η ενέÏγεια '%s' υπάÏχει ήδη!"
#: editor/project_settings.cpp
msgid "Rename Input Action Event"
-msgstr ""
+msgstr "Μετονομασία συμβάντος εισόδου"
#: editor/project_settings.cpp
msgid "Add Input Action Event"
-msgstr ""
+msgstr "ΠÏοσθήκη συμβάντος εισόδου"
#: editor/project_settings.cpp editor/settings_config_dialog.cpp
#: scene/gui/input_action.cpp
@@ -5497,55 +5734,55 @@ 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.."
-msgstr ""
+msgstr "Πατήστε ένα κουμπί.."
#: editor/project_settings.cpp
msgid "Mouse Button Index:"
-msgstr ""
+msgstr "Kουμπί ποντικιοÏ:"
#: editor/project_settings.cpp
msgid "Left Button"
-msgstr ""
+msgstr "ΑÏιστεÏÏŒ κουμπί"
#: editor/project_settings.cpp
msgid "Right Button"
-msgstr ""
+msgstr "Δεξί κουμπί"
#: editor/project_settings.cpp
msgid "Middle Button"
-msgstr ""
+msgstr "Μεσαίο κουμπί"
#: editor/project_settings.cpp
msgid "Wheel Up Button"
-msgstr ""
+msgstr "Ροδέλα πάνω"
#: editor/project_settings.cpp
msgid "Wheel Down Button"
-msgstr ""
+msgstr "Ροδέλα κάτω"
#: editor/project_settings.cpp
msgid "Button 6"
-msgstr ""
+msgstr "Κουμπί 6"
#: editor/project_settings.cpp
msgid "Button 7"
-msgstr ""
+msgstr "Κουμπί 7"
#: editor/project_settings.cpp
msgid "Button 8"
-msgstr ""
+msgstr "Κουμπί 8"
#: editor/project_settings.cpp
msgid "Button 9"
-msgstr ""
+msgstr "Κουμπί 9"
#: editor/project_settings.cpp
msgid "Joypad Axis Index:"
-msgstr ""
+msgstr "ΑÏιθμός άξονα Joypad:"
#: editor/project_settings.cpp scene/gui/input_action.cpp
msgid "Axis"
@@ -5553,15 +5790,20 @@ msgstr "Άξονας"
#: editor/project_settings.cpp
msgid "Joypad Button Index:"
-msgstr ""
+msgstr "ΑÏιθμός ÎºÎ¿Ï…Î¼Ï€Î¹Î¿Ï Joypad:"
#: editor/project_settings.cpp
msgid "Add Input Action"
-msgstr ""
+msgstr "ΠÏοσθήκη συμβάντος ενέÏγειας εισόδου"
#: editor/project_settings.cpp
msgid "Erase Input Action Event"
-msgstr ""
+msgstr "ΔιαγÏαφή συμβάντος ενέÏγειας εισόδου"
+
+#: editor/project_settings.cpp
+#, fuzzy
+msgid "Add Event"
+msgstr "ΠÏοσθήκη άδειου"
#: editor/project_settings.cpp scene/gui/input_action.cpp
msgid "Device"
@@ -5593,174 +5835,168 @@ msgstr "Ροδέλα κάτω."
#: editor/project_settings.cpp
msgid "Error saving settings."
-msgstr ""
+msgstr "Σφάλμα κατά την αποθήκευση Ïυθμίσεων."
#: editor/project_settings.cpp
msgid "Settings saved OK."
-msgstr ""
+msgstr "Οι Ïυθμίσεις αποθηκεÏτικαν εντάξει."
#: editor/project_settings.cpp
msgid "Add Translation"
-msgstr ""
+msgstr "ΠÏοσθήκη μετάφÏασης"
#: editor/project_settings.cpp
msgid "Remove Translation"
-msgstr ""
+msgstr "ΑφαίÏεση μετάφÏασης"
#: editor/project_settings.cpp
msgid "Add Remapped Path"
-msgstr ""
+msgstr "ΠÏοσθήκη ανακατεÏθυνσης διαδÏομής"
#: editor/project_settings.cpp
msgid "Resource Remap Add Remap"
-msgstr ""
+msgstr "ΠÏοσθήκη ανακατεÏθυνσης διαδÏομής πόÏου"
#: editor/project_settings.cpp
msgid "Change Resource Remap Language"
-msgstr ""
+msgstr "Αλλαγή γλώσσας ανακατεÏθυνσης πόÏων"
#: editor/project_settings.cpp
msgid "Remove Resource Remap"
-msgstr ""
+msgstr "ΑφαίÏεση ανακατεÏθυνσης πόÏου"
#: editor/project_settings.cpp
msgid "Remove Resource Remap Option"
-msgstr ""
+msgstr "ΑφαίÏεση επιλογής ανακατεÏθυνσης πόÏου"
#: editor/project_settings.cpp
#, fuzzy
-msgid "Project Settings "
-msgstr "Ρυθμίσεις έÏγου"
+msgid "Project Settings (project.godot)"
+msgstr "Ρυθμίσεις έÏγου (godot.cfg)"
#: editor/project_settings.cpp editor/settings_config_dialog.cpp
msgid "General"
-msgstr ""
+msgstr "Γενικά"
#: editor/project_settings.cpp editor/property_editor.cpp
msgid "Property:"
-msgstr ""
+msgstr "Ιδιότητα:"
#: editor/project_settings.cpp
msgid "Del"
-msgstr ""
+msgstr "ΔιαγÏαφή"
#: editor/project_settings.cpp
msgid "Copy To Platform.."
-msgstr ""
+msgstr "ΑντιγÏαφή σε πλατφόÏμα.."
#: editor/project_settings.cpp
msgid "Input Map"
-msgstr ""
+msgstr "ΧάÏτης εισόδου"
#: editor/project_settings.cpp
msgid "Action:"
-msgstr ""
+msgstr "ΕνέÏγεια:"
#: editor/project_settings.cpp
msgid "Device:"
-msgstr ""
+msgstr "Συσκευή:"
#: editor/project_settings.cpp
msgid "Index:"
-msgstr ""
+msgstr "Δείκτης:"
#: editor/project_settings.cpp
msgid "Localization"
-msgstr ""
+msgstr "Τοπική Ï€ÏοσαÏμογή"
#: editor/project_settings.cpp
msgid "Translations"
-msgstr ""
+msgstr "ΜεταφÏάσεις"
#: editor/project_settings.cpp
msgid "Translations:"
-msgstr ""
+msgstr "ΜεταφÏάσεις:"
#: editor/project_settings.cpp
msgid "Remaps"
-msgstr ""
+msgstr "ΑνακατευθÏνσεις"
#: editor/project_settings.cpp
msgid "Resources:"
-msgstr ""
+msgstr "ΠόÏοι:"
#: editor/project_settings.cpp
msgid "Remaps by Locale:"
-msgstr ""
+msgstr "ΑνακατευθÏνσεις ανά πεÏιοχή:"
#: editor/project_settings.cpp
msgid "Locale"
-msgstr ""
+msgstr "ΠεÏιοχή"
#: editor/project_settings.cpp
msgid "AutoLoad"
-msgstr ""
+msgstr "Αυτόματη φόÏτωση"
#: editor/property_editor.cpp
msgid "Pick a Viewport"
-msgstr ""
+msgstr "Επιλέξτε μία οπτική γωνία"
#: editor/property_editor.cpp
msgid "Ease In"
-msgstr ""
+msgstr "Ομαλή κίνηση Ï€Ïος τα μέσα"
#: editor/property_editor.cpp
msgid "Ease Out"
-msgstr ""
+msgstr "Ομαλή κίνηση Ï€Ïος τα έξω"
#: editor/property_editor.cpp
msgid "Zero"
-msgstr ""
+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.."
-msgstr ""
+msgstr "ΑÏχείο.."
#: editor/property_editor.cpp
msgid "Dir.."
-msgstr ""
+msgstr "Κατάλογος.."
#: editor/property_editor.cpp
msgid "Assign"
-msgstr ""
+msgstr "Ανάθεση"
#: editor/property_editor.cpp
msgid "New Script"
-msgstr ""
+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 ""
+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."
-msgstr ""
+msgstr "Δυαδικό ψηφίο %d, τιμή %d."
#: editor/property_editor.cpp
msgid "On"
-msgstr ""
+msgstr "Îαι"
#: editor/property_editor.cpp modules/visual_script/visual_script_editor.cpp
msgid "Set"
@@ -5768,534 +6004,616 @@ msgstr "ÎŒÏισε"
#: editor/property_editor.cpp
msgid "Properties:"
-msgstr ""
+msgstr "Ιδιότητες:"
#: editor/property_editor.cpp
msgid "Sections:"
-msgstr ""
+msgstr "Ενότητες:"
#: editor/property_selector.cpp
msgid "Select Property"
-msgstr ""
+msgstr "Επιλογή ιδιότητας"
#: editor/property_selector.cpp
msgid "Select Method"
-msgstr ""
+msgstr "Επιλογή μεθόδου"
#: editor/pvrtc_compress.cpp
msgid "Could not execute PVRTC tool:"
-msgstr ""
+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 ""
+msgstr "ΕπαναπÏοσδιοÏισμός γονέα κόμβου"
#: editor/reparent_dialog.cpp
msgid "Reparent Location (Select new Parent):"
-msgstr ""
+msgstr "Θέση γονέα (Επιλέξτε νέο γονέα):"
#: editor/reparent_dialog.cpp
msgid "Keep Global Transform"
-msgstr ""
+msgstr "ΔιατήÏηση παγκόσμιου μετασχηματισμοÏ"
#: editor/reparent_dialog.cpp editor/scene_tree_dock.cpp
msgid "Reparent"
-msgstr ""
+msgstr "ΕπαναπÏοσδιοÏισμός γονέα"
#: editor/resources_dock.cpp
msgid "Create New Resource"
-msgstr ""
+msgstr "ΔημιουÏγία νέου πόÏου"
#: editor/resources_dock.cpp
msgid "Open Resource"
-msgstr ""
+msgstr "Άνοιγμα πόÏου"
#: editor/resources_dock.cpp
msgid "Save Resource"
-msgstr ""
+msgstr "Αποθήκευση πόÏου"
#: editor/resources_dock.cpp
msgid "Resource Tools"
-msgstr ""
+msgstr "ΕÏγαλεία πόÏων"
#: editor/resources_dock.cpp
msgid "Make Local"
-msgstr ""
+msgstr "Κάνε τοπικό"
#: editor/run_settings_dialog.cpp
msgid "Run Mode:"
-msgstr ""
+msgstr "ΛειτουÏγία εκτέλεσης:"
#: editor/run_settings_dialog.cpp
msgid "Current Scene"
-msgstr ""
+msgstr "ΤÏέχουσα σκηνή"
#: editor/run_settings_dialog.cpp
msgid "Main Scene"
-msgstr ""
+msgstr "ΚÏÏια σκηνή"
#: editor/run_settings_dialog.cpp
msgid "Main Scene Arguments:"
-msgstr ""
+msgstr "ΟÏίσματα κÏÏιας σκηνής:"
#: editor/run_settings_dialog.cpp
msgid "Scene Run Settings"
-msgstr ""
+msgstr "Ρυθμίσης εκτέλεσης σκηνής"
#: editor/scene_tree_dock.cpp
msgid "No parent to instance the scenes at."
-msgstr ""
+msgstr "Δεν υπάÏχει γονέας για να δημιουÏγηθοÏν τα στιγμιότυπα των σκηνών."
#: editor/scene_tree_dock.cpp
msgid "Error loading scene from %s"
-msgstr ""
+msgstr "Σφάλμα κατά τη φόÏτωση σκηνής από %s"
#: editor/scene_tree_dock.cpp
msgid "Ok"
-msgstr ""
+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 ""
+msgstr "ΔημιουÏγία στιγμιοτÏπυ σκηνών"
#: editor/scene_tree_dock.cpp
msgid "This operation can't be done on the tree root."
-msgstr ""
+msgstr "Αυτή η λειτουÏγία δεν μποÏεί να γίνει στην Ïίζα το δέντÏου."
#: editor/scene_tree_dock.cpp
msgid "Move Node In Parent"
-msgstr ""
+msgstr "Μετακίνηση κόμβου στον γονέα"
#: editor/scene_tree_dock.cpp
msgid "Move Nodes In Parent"
-msgstr ""
+msgstr "Μετακίνηση κόμβων στον γονέα"
#: editor/scene_tree_dock.cpp
msgid "Duplicate Node(s)"
-msgstr ""
+msgstr "Διπλασιασμός κόμβων"
#: editor/scene_tree_dock.cpp
msgid "Delete Node(s)?"
-msgstr ""
+msgstr "ΔιαγÏαφή κόμβων;"
#: editor/scene_tree_dock.cpp
msgid "This operation can't be done without a scene."
-msgstr ""
+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."
msgstr ""
+"Αυτή η λειτουÏγία δεν μποÏεί να γίνει σε σκηνές από τις οποίες έχουν "
+"δημιουÏγηθεί στιγμιότυπα."
#: editor/scene_tree_dock.cpp
msgid "Save New Scene As.."
-msgstr ""
+msgstr "Αποθήκευση νέας σκηνής ως.."
#: editor/scene_tree_dock.cpp
msgid "Makes Sense!"
-msgstr ""
+msgstr "Βγάζει νόημα!"
#: editor/scene_tree_dock.cpp
msgid "Can't operate on nodes from a foreign scene!"
-msgstr ""
+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 ""
+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 ""
+msgstr "Σφάλμα κατά την αποθήκευση σκηνής."
#: editor/scene_tree_dock.cpp
msgid "Error duplicating scene to save it."
-msgstr ""
+msgstr "Σφάλμα κατά τον διπλασιασμό σκηνής για αποθήκευση."
+
+#: editor/scene_tree_dock.cpp
+#, fuzzy
+msgid "Sub-Resources:"
+msgstr "ΠόÏοι:"
#: editor/scene_tree_dock.cpp
msgid "Edit Groups"
-msgstr ""
+msgstr "ΕπεξεÏγασία Ομάδων"
#: editor/scene_tree_dock.cpp
msgid "Edit Connections"
-msgstr ""
+msgstr "ΕπεξεÏγασία συνδέσεων"
#: editor/scene_tree_dock.cpp
msgid "Delete Node(s)"
-msgstr ""
+msgstr "ΔιαγÏαφή Κόμβων"
#: editor/scene_tree_dock.cpp
msgid "Add Child Node"
-msgstr ""
+msgstr "ΠÏοσθήκη κόμβου ως παιδί"
#: editor/scene_tree_dock.cpp
msgid "Instance Child Scene"
-msgstr ""
+msgstr "ΑÏχικοποίηση σκηνής ως παιδί"
#: editor/scene_tree_dock.cpp
msgid "Change Type"
-msgstr ""
+msgstr "Αλλαγή Ï„Ïπου"
#: editor/scene_tree_dock.cpp
msgid "Attach Script"
-msgstr ""
+msgstr "ΣÏνδεση δεσμής ενεÏγειών"
#: editor/scene_tree_dock.cpp
msgid "Clear Script"
-msgstr ""
+msgstr "ΕκκαθάÏιση δεσμής ενεÏγειών"
#: editor/scene_tree_dock.cpp
msgid "Merge From Scene"
-msgstr ""
+msgstr "Συγχώνευση από σκηνή"
#: editor/scene_tree_dock.cpp
msgid "Save Branch as Scene"
-msgstr ""
+msgstr "Αποθήκευσι ÎºÎ»Î±Î´Î¹Î¿Ï Ï‰Ï‚ σκηνή"
#: editor/scene_tree_dock.cpp
-#, fuzzy
msgid "Copy Node Path"
-msgstr "ΑντιγÏαφή κόμβων"
+msgstr "ΑντιγÏαφή διαδÏομής κόμβου"
#: editor/scene_tree_dock.cpp
msgid "Delete (No Confirm)"
-msgstr ""
+msgstr "ΔιαγÏαφή (ΧωÏίς επιβεβαίωση)"
#: editor/scene_tree_dock.cpp
msgid "Add/Create a New Node"
-msgstr ""
+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 ""
+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"
-msgstr ""
+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 "Invalid node name, the following characters are not allowed:"
+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 ""
+msgstr "Μετονομασία κόμβου"
#: editor/scene_tree_editor.cpp
msgid "Scene Tree (Nodes):"
-msgstr ""
+msgstr "ΔέντÏο σκηνής (Κόμβοι):"
#: editor/scene_tree_editor.cpp
msgid "Editable Children"
-msgstr ""
+msgstr "ΕπεξεÏγάσιμα παιδιά"
#: editor/scene_tree_editor.cpp
msgid "Load As Placeholder"
-msgstr ""
+msgstr "ΦόÏτωση ως μέσο κÏάτησης θέσης"
#: editor/scene_tree_editor.cpp
msgid "Discard Instancing"
-msgstr ""
+msgstr "ΑπόÏÏιψη στιγμιοτÏπισης"
#: editor/scene_tree_editor.cpp
msgid "Open in Editor"
-msgstr ""
+msgstr "Άνοιγμα στον επεξεÏγαστή"
#: editor/scene_tree_editor.cpp
msgid "Clear Inheritance"
-msgstr ""
+msgstr "ΕκκαθάÏιση κληÏονομικότητας"
#: editor/scene_tree_editor.cpp
msgid "Clear Inheritance? (No Undo!)"
-msgstr ""
+msgstr "ΕκκαθάÏιση κληÏονομικότητας; (Δεν γίνεται ανέÏαιση!)"
#: editor/scene_tree_editor.cpp
msgid "Clear!"
-msgstr ""
+msgstr "ΕκκαθάÏιση!"
#: editor/scene_tree_editor.cpp
msgid "Select a Node"
-msgstr ""
+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!"
+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 ""
+#, fuzzy
+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"
-msgstr ""
+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"
-msgstr ""
+#, fuzzy
+msgid "Create new script file"
+msgstr "ΔημιουÏγία νέας δεσμής ενεÏγειών"
#: editor/script_create_dialog.cpp
-msgid "Load existing script"
-msgstr ""
+#, fuzzy
+msgid "Load existing script file"
+msgstr "ΦόÏτωση υπαÏκτής δεσμής ενεÏγειών"
#: editor/script_create_dialog.cpp
-msgid "Class Name:"
-msgstr ""
+#, fuzzy
+msgid "Inherits"
+msgstr "ΚληÏονομεί:"
#: editor/script_create_dialog.cpp
-msgid "Built-In Script"
-msgstr ""
+#, 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 ""
+msgstr "ΣÏνδεση δεσμής ενεÏγειών κόμβου"
#: editor/script_editor_debugger.cpp
msgid "Bytes:"
-msgstr ""
+msgstr "Ψηφιολέξεις:"
#: editor/script_editor_debugger.cpp
msgid "Warning"
-msgstr ""
+msgstr "ΠÏοειδοποίηση"
#: editor/script_editor_debugger.cpp
msgid "Error:"
-msgstr ""
+msgstr "Σφάλμα:"
#: editor/script_editor_debugger.cpp
msgid "Source:"
-msgstr ""
+msgstr "Πηγή:"
#: editor/script_editor_debugger.cpp
msgid "Function:"
-msgstr ""
+msgstr "ΣυνάÏτηση:"
#: editor/script_editor_debugger.cpp
msgid "Errors"
-msgstr ""
+msgstr "Σφάλματα"
#: editor/script_editor_debugger.cpp
msgid "Child Process Connected"
-msgstr ""
+msgstr "Η παιδική διαδικασία συνδέθηκε"
#: editor/script_editor_debugger.cpp
msgid "Inspect Previous Instance"
-msgstr ""
+msgstr "ΕπιθεώÏηση του Ï€ÏοηγοÏμενου στιγμιοτÏπου"
#: editor/script_editor_debugger.cpp
msgid "Inspect Next Instance"
-msgstr ""
+msgstr "ΕπιθεώÏηση του επόμενου στιγμιοτÏπου"
#: editor/script_editor_debugger.cpp
msgid "Stack Frames"
-msgstr ""
+msgstr "Στοίβαξη καÏέ"
#: editor/script_editor_debugger.cpp
msgid "Variable"
-msgstr ""
+msgstr "Μεταβλητή"
#: editor/script_editor_debugger.cpp
msgid "Errors:"
-msgstr ""
+msgstr "Σφάλματα:"
#: editor/script_editor_debugger.cpp
msgid "Stack Trace (if applicable):"
-msgstr ""
+msgstr "Ιχνηλάτηση στοίβας (Εάν υφίσταται):"
#: editor/script_editor_debugger.cpp
msgid "Remote Inspector"
-msgstr ""
+msgstr "ΑπομακÏυσμένος επιθεωÏητής"
#: editor/script_editor_debugger.cpp
msgid "Live Scene Tree:"
-msgstr ""
+msgstr "Ζωντανό δέντÏο σκηνής:"
#: editor/script_editor_debugger.cpp
msgid "Remote Object Properties: "
-msgstr ""
+msgstr "ΑπομακÏυσμένες ιδιότητες αντικειμένου: "
#: editor/script_editor_debugger.cpp
msgid "Profiler"
-msgstr ""
+msgstr "ΠÏόγÏαμμα δημιουÏγίας Ï€Ïοφιλ"
#: editor/script_editor_debugger.cpp
msgid "Monitor"
-msgstr ""
+msgstr "Κλειδί"
#: editor/script_editor_debugger.cpp
msgid "Value"
-msgstr ""
+msgstr "Τιμή"
#: editor/script_editor_debugger.cpp
msgid "Monitors"
-msgstr ""
+msgstr "ΠαÏακολοÏθηση"
#: editor/script_editor_debugger.cpp
msgid "List of Video Memory Usage by Resource:"
-msgstr ""
+msgstr "Λίστα χÏήσης βιντεο-μνήμης ανά πόÏο:"
#: editor/script_editor_debugger.cpp
msgid "Total:"
-msgstr ""
+msgstr "Συνολικά:"
#: editor/script_editor_debugger.cpp
msgid "Video Mem"
-msgstr ""
+msgstr "βιντεο-μνήμη"
#: editor/script_editor_debugger.cpp
msgid "Resource Path"
-msgstr ""
+msgstr "ΔιαδÏομή πόÏου"
#: editor/script_editor_debugger.cpp
msgid "Type"
-msgstr ""
+msgstr "ΤÏπος"
#: editor/script_editor_debugger.cpp
msgid "Usage"
-msgstr ""
+msgstr "ΧÏήση"
#: editor/script_editor_debugger.cpp
msgid "Misc"
-msgstr ""
+msgstr "ΔιάφοÏα"
#: editor/script_editor_debugger.cpp
msgid "Clicked Control:"
-msgstr ""
+msgstr "Πατημένο στοιχείο ελέγχου:"
#: editor/script_editor_debugger.cpp
msgid "Clicked Control Type:"
-msgstr ""
+msgstr "ΤÏπος πατημένου στοιχείου ελέγχου:"
#: editor/script_editor_debugger.cpp
msgid "Live Edit Root:"
-msgstr ""
+msgstr "Ρίζα ζωντανής επεξεÏγασίας:"
#: editor/script_editor_debugger.cpp
msgid "Set From Tree"
-msgstr ""
+msgstr "ΟÏισμός από το δέντÏο"
#: editor/settings_config_dialog.cpp
msgid "Shortcuts"
-msgstr ""
+msgstr "ΣυντομεÏσεις"
#: editor/spatial_editor_gizmos.cpp
msgid "Change Light Radius"
-msgstr ""
+msgstr "Αλλαγή διαμέτÏου φωτός"
#: editor/spatial_editor_gizmos.cpp
msgid "Change Camera FOV"
-msgstr ""
+msgstr "Αλλαγή εÏÏους πεδίου κάμεÏας"
#: editor/spatial_editor_gizmos.cpp
msgid "Change Camera Size"
-msgstr ""
+msgstr "Αλλαγή μεγέθους κάμεÏας"
#: editor/spatial_editor_gizmos.cpp
msgid "Change Sphere Shape Radius"
-msgstr ""
+msgstr "Αλλαγή ακτίνας σφαιÏÎ¹ÎºÎ¿Ï ÏƒÏ‡Î®Î¼Î±Ï„Î¿Ï‚"
#: editor/spatial_editor_gizmos.cpp
msgid "Change Box Shape Extents"
-msgstr ""
+msgstr "Αλλαγή διαστάσεων ÎºÏ…Î²Î¹ÎºÎ¿Ï ÏƒÏ‡Î®Î¼Î±Ï„Î¿Ï‚"
#: editor/spatial_editor_gizmos.cpp
msgid "Change Capsule Shape Radius"
-msgstr ""
+msgstr "Αλλαγή ακτίνας κάψουλας"
#: editor/spatial_editor_gizmos.cpp
msgid "Change Capsule Shape Height"
-msgstr ""
+msgstr "Αλλαγή Ïψους κάψουλας"
#: editor/spatial_editor_gizmos.cpp
msgid "Change Ray Shape Length"
-msgstr ""
+msgstr "Αλλαγή μήκους ακτίνας"
#: editor/spatial_editor_gizmos.cpp
msgid "Change Notifier Extents"
-msgstr ""
+msgstr "Αλλαγή διαστάσεων ειδοποιητή"
#: editor/spatial_editor_gizmos.cpp
msgid "Change Particles AABB"
@@ -6303,7 +6621,7 @@ msgstr ""
#: editor/spatial_editor_gizmos.cpp
msgid "Change Probe Extents"
-msgstr ""
+msgstr "Αλλαγή διαστάσεων αισθητήÏα"
#: modules/gdscript/gd_functions.cpp
#: modules/visual_script/visual_script_builtin_funcs.cpp
@@ -6321,14 +6639,12 @@ msgid "step argument is zero!"
msgstr "Η παÏάμετÏος step είναι μηδέν!"
#: modules/gdscript/gd_functions.cpp
-#, fuzzy
msgid "Not a script with an instance"
-msgstr "Δεν είναι script με παÏουσία"
+msgstr "Δεν είναι δεσμή ενεÏγειών με στιγμιότυπο"
#: modules/gdscript/gd_functions.cpp
-#, fuzzy
msgid "Not based on a script"
-msgstr "Δεν είναι βασισμένο σε script"
+msgstr "Δεν είναι βασισμένο σε δεσμή ενεÏγειών"
#: modules/gdscript/gd_functions.cpp
msgid "Not based on a resource file"
@@ -6341,11 +6657,12 @@ msgstr "ΆκυÏη μοÏφή Î»ÎµÎ¾Î¹ÎºÎ¿Ï ÏƒÏ„Î¹Î³Î¼Î¹Î¿Ï„Ïπων (λείπÎ
#: modules/gdscript/gd_functions.cpp
msgid "Invalid instance dictionary format (can't load script at @path)"
msgstr ""
-"ΆκυÏη μοÏφή Î»ÎµÎ¾Î¹ÎºÎ¿Ï ÏƒÏ„Î¹Î³Î¼Î¹Î¿Ï„Ïπων (αδÏνατη η φόÏτωση του script στο @path)"
+"ΆκυÏη μοÏφή Î»ÎµÎ¾Î¹ÎºÎ¿Ï ÏƒÏ„Î¹Î³Î¼Î¹Î¿Ï„Ïπων (αδÏνατη η φόÏτωση της δεσμής ενεÏγειών στο "
+"@path)"
#: modules/gdscript/gd_functions.cpp
msgid "Invalid instance dictionary format (invalid script at @path)"
-msgstr "ΆκυÏη μοÏφή Î»ÎµÎ¾Î¹ÎºÎ¿Ï ÏƒÏ„Î¹Î³Î¼Î¹Î¿Ï„Ïπων (άκυÏο script στο @path)"
+msgstr "ΆκυÏη μοÏφή Î»ÎµÎ¾Î¹ÎºÎ¿Ï ÏƒÏ„Î¹Î³Î¼Î¹Î¿Ï„Ïπων (Μη έγκυÏη δεσμή ενεÏγειών στο @path)"
#: modules/gdscript/gd_functions.cpp
msgid "Invalid instance dictionary (invalid subclasses)"
@@ -6615,11 +6932,11 @@ msgstr ": ΆκυÏοι παÏάμετÏοι: "
#: modules/visual_script/visual_script_nodes.cpp
msgid "VariableGet not found in script: "
-msgstr "Το VariableGet δεν βÏέθηκε στο script: "
+msgstr "Το VariableGet δεν βÏέθηκε στη δεσμή ενεÏγειών: "
#: modules/visual_script/visual_script_nodes.cpp
msgid "VariableSet not found in script: "
-msgstr "Το VariableSet δεν βÏέθηκε στο script: "
+msgstr "Το VariableSet δεν βÏέθηκε στη δεσμή ενεÏγειών: "
#: modules/visual_script/visual_script_nodes.cpp
msgid "Custom node has no _step() method, can't process graph."
@@ -6644,34 +6961,30 @@ msgstr "μόλις απελευθεÏώθηκε"
#: platform/javascript/export/export.cpp
msgid "Run in Browser"
-msgstr ""
+msgstr "Εκτέλεση στον πεÏιηγητή"
#: platform/javascript/export/export.cpp
msgid "Run exported HTML in the system's default browser."
-msgstr ""
+msgstr "Εκτέλεση εξαγόμενης HTMP στον Ï€Ïοεπιλεγμένο πεÏιηγητή του συστήματος."
#: platform/javascript/export/export.cpp
-#, fuzzy
msgid "Could not write file:\n"
-msgstr "ΑδÏνατη η δημιουÏγία φακέλου."
+msgstr "Δεν ήταν δυνατό το γÏάψιμο στο αÏχείο:\n"
#: platform/javascript/export/export.cpp
-#, fuzzy
msgid "Could not read file:\n"
-msgstr "ΑδÏνατη η δημιουÏγία φακέλου."
+msgstr "Δεν ήταν δυνατή η ανάγνωση του αÏχείου:\n"
#: platform/javascript/export/export.cpp
-#, fuzzy
msgid "Could not open template for export:\n"
-msgstr "ΑδÏνατη η δημιουÏγία φακέλου."
+msgstr "Δεν ήταν δυνατό το άνοιγμα Ï€ÏοτÏπου για εξαγωγή:\n"
#: platform/uwp/export/export.cpp
-#, fuzzy
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."
@@ -6793,26 +7106,22 @@ msgstr ""
"ΔημιουÏγήστε ένα πόÏο σχήματος για αυτό!"
#: scene/2d/light_2d.cpp
-#, fuzzy
msgid ""
"A texture with the shape of the light must be supplied to the 'texture' "
"property."
-msgstr ""
-"Μία εικόνα με το σχήμα του φωτός Ï€Ïέπει να δοθεί στην ιδιότητα 'texture'"
+msgstr "Μία υφή με το σχήμα του φωτός Ï€Ïέπει να δοθεί στην ιδιότητα 'texture'."
#: scene/2d/light_occluder_2d.cpp
-#, fuzzy
msgid ""
"An occluder polygon must be set (or drawn) for this occluder to take effect."
msgstr ""
-"Ένα πολÏγωνο occluder Ï€Ïέπει να οÏιστεί (ή ζωγÏαφιστεί) για να λειτουÏγήσει "
-"αυτός ο occluder."
+"Ένα πολÏγωνο εμποδίου Ï€Ïέπει να οÏιστεί (ή ζωγÏαφιστεί) για να λειτουÏγήσει "
+"αυτό το εμπόδιο."
#: scene/2d/light_occluder_2d.cpp
-#, fuzzy
msgid "The occluder polygon for this occluder is empty. Please draw a polygon!"
msgstr ""
-"Το πολÏγωνο occluder για αυτόν τον occluder είναι άδειο. ΖωγÏαφίστε ένα "
+"Το πολÏγωνο εμποδίου για αυτό το εμπόδιο είναι άδειο. ΖωγÏαφίστε ένα "
"πολÏγονο!"
#: scene/2d/navigation_polygon.cpp
@@ -6838,11 +7147,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."
@@ -6915,28 +7224,22 @@ 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/particles.cpp
-msgid ""
-"A material to process the particles is not assigned, so no behavior is "
-"imprinted."
-msgstr ""
-
#: scene/3d/remote_transform.cpp
msgid "Path property must point to a valid Spatial node to work."
msgstr ""
@@ -6958,6 +7261,15 @@ 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 "Ειδοποίηση!"
@@ -7002,6 +7314,16 @@ msgid ""
"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 ""
@@ -7021,9 +7343,65 @@ msgstr ""
#~ msgid "Import assets to the project."
#~ msgstr "Εισαγωγή πόÏων στο έÏγο."
-#, fuzzy
-#~ msgid "Project Settings (godot.cfg)"
-#~ 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 "
diff --git a/editor/translations/es.po b/editor/translations/es.po
index f01c84718b..053bbc1085 100644
--- a/editor/translations/es.po
+++ b/editor/translations/es.po
@@ -1,6 +1,5 @@
# Spanish translation of the Godot Engine editor
-# Copyright (C) 2007-2017 Juan Linietsky, Ariel Manzur
-# Copyright (C) 2014-2017 Godot Engine contributors (cf. AUTHORS.md)
+# 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.
@@ -553,7 +552,8 @@ msgid "Search:"
msgstr "Buscar:"
#: editor/asset_library_editor_plugin.cpp editor/code_editor.cpp
-#: editor/editor_help.cpp editor/plugins/script_editor_plugin.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"
@@ -599,7 +599,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"
@@ -746,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"
@@ -856,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"
@@ -962,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"
@@ -973,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"
@@ -1047,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:"
@@ -1240,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"
@@ -1257,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:"
@@ -1428,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 "
@@ -1496,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?"
@@ -1555,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"
@@ -1596,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"
@@ -1649,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"
@@ -1677,84 +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 "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 "Export the project to many platforms."
-msgstr "Exportar el proyecto a varias plataformas."
+msgid "Project Settings"
+msgstr "Ajustes del 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 "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"
@@ -1843,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"
@@ -1866,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!"
@@ -1955,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"
@@ -1982,6 +2016,36 @@ 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:"
@@ -2243,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"
@@ -2271,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…"
@@ -2443,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."
@@ -2930,7 +2995,7 @@ msgstr "Comprimir"
#: editor/io_plugins/editor_translation_import_plugin.cpp
#, fuzzy
-msgid "Add to Project (godot.cfg)"
+msgid "Add to Project (project.godot)"
msgstr "Añadir al proyecto (engine.cfg)"
#: editor/io_plugins/editor_translation_import_plugin.cpp
@@ -3603,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"
@@ -3655,18 +3720,6 @@ msgstr "Crear Poly3D"
msgid "Set Handle"
msgstr "Establecer handle"
-#: editor/plugins/color_ramp_editor_plugin.cpp
-#: editor/plugins/gradient_texture_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/gradient_texture_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"
@@ -3699,9 +3752,34 @@ 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"
@@ -3980,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:"
@@ -3993,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"
@@ -4004,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."
@@ -4017,11 +4130,6 @@ msgid "A processor material of type 'ParticlesMaterial' is required."
msgstr ""
#: editor/plugins/particles_editor_plugin.cpp
-#, fuzzy
-msgid "Generating AABB"
-msgstr "Generar AABB"
-
-#: editor/plugins/particles_editor_plugin.cpp
msgid "Faces contain no area!"
msgstr "¡Las caras no contienen área!"
@@ -4079,13 +4187,18 @@ msgstr "Relleno de emisión:"
msgid "Generate Visibility AABB"
msgstr "Generar AABB"
-#: editor/plugins/particles_editor_plugin.cpp
+#: 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 "Generation Time (sec):"
-msgstr "Tiempo promedio (seg)"
+msgid "Remove Out-Control from Curve"
+msgstr "Mover Out-Control en Curva"
#: editor/plugins/path_2d_editor_plugin.cpp
-msgid "Remove Point from Curve"
+#, fuzzy
+msgid "Remove In-Control from Curve"
msgstr "Borrar punto de curva"
#: editor/plugins/path_2d_editor_plugin.cpp
@@ -4144,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"
@@ -4297,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"
@@ -4385,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"
@@ -4422,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."
@@ -4491,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"
@@ -4570,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"
@@ -4592,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"
@@ -4811,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
+#, fuzzy
+msgid "View Gizmos"
+msgstr "Gizmos"
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "No scene selected to instance!"
-msgstr "¡No se ha elegido ninguna escena a instanciar!"
+msgid "View Information"
+msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Instance at Cursor"
-msgstr "Instanciar en cursor"
+msgid "Audio Listener"
+msgstr "Oyente de Audio"
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Could not instance scene!"
-msgstr "¡No se pudo instanciar la escena!"
+msgid "XForm Dialog"
+msgstr "Ventana de transformación"
#: editor/plugins/spatial_editor_plugin.cpp
msgid "Move Mode (W)"
@@ -4900,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"
@@ -4912,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"
@@ -4944,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"
@@ -4968,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"
@@ -4988,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):"
@@ -5427,12 +5637,12 @@ msgstr "¡La ruta del proyecto no es correcta, tiene que existir!"
#: editor/project_manager.cpp
#, fuzzy
-msgid "Invalid project path, *.godot must not exist."
+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
#, fuzzy
-msgid "Invalid project path, *.godot must exist."
+msgid "Invalid project path, project.godot must exist."
msgstr "¡La ruta del proyecto no es correcta, engine.cfg debe existir."
#: editor/project_manager.cpp
@@ -5445,7 +5655,7 @@ msgstr "La ruta del proyecto no es correcta (¿has cambiado algo?)."
#: editor/project_manager.cpp
#, fuzzy
-msgid "Couldn't create *.godot project file in project path."
+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
@@ -5668,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"
@@ -5734,8 +5949,8 @@ msgstr "Quitar opción de remapeo de recursos"
#: editor/project_settings.cpp
#, fuzzy
-msgid "Project Settings "
-msgstr "Ajustes del proyecto"
+msgid "Project Settings (project.godot)"
+msgstr "Ajustes de proyecto (engine.cfg)"
#: editor/project_settings.cpp editor/settings_config_dialog.cpp
msgid "General"
@@ -5853,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"
@@ -6049,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"
@@ -6130,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:"
@@ -6179,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
@@ -6988,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."
@@ -7077,12 +7359,6 @@ msgid ""
"Nothing is visible because meshes have not been assigned to draw passes."
msgstr ""
-#: scene/3d/particles.cpp
-msgid ""
-"A material to process the particles is not assigned, so no behavior is "
-"imprinted."
-msgstr ""
-
#: scene/3d/remote_transform.cpp
#, fuzzy
msgid "Path property must point to a valid Spatial node to work."
@@ -7104,6 +7380,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!"
@@ -7149,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 "
@@ -7167,9 +7458,64 @@ msgstr ""
#~ msgid "Import assets to the project."
#~ msgstr "Importar elementos al proyecto."
-#, fuzzy
-#~ msgid "Project Settings (godot.cfg)"
-#~ msgstr "Ajustes de proyecto (engine.cfg)"
+#~ 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"
@@ -7398,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:"
@@ -7434,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"
@@ -7472,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 f826517b27..3457d72d9a 100644
--- a/editor/translations/es_AR.po
+++ b/editor/translations/es_AR.po
@@ -1,6 +1,5 @@
# Spanish (Argentina) translation of the Godot Engine editor
-# Copyright (C) 2007-2017 Juan Linietsky, Ariel Manzur
-# Copyright (C) 2014-2017 Godot Engine contributors (cf. AUTHORS.md)
+# 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-2017.
@@ -11,7 +10,7 @@ msgid ""
msgstr ""
"Project-Id-Version: Godot Engine editor\n"
"POT-Creation-Date: \n"
-"PO-Revision-Date: 2017-01-09 23:10+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"
@@ -20,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.11-dev\n"
+"X-Generator: Weblate 2.14-dev\n"
#: editor/animation_editor.cpp
msgid "Disabled"
@@ -87,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"
@@ -378,7 +376,7 @@ msgstr "Constantes:"
#: editor/asset_library_editor_plugin.cpp
#, fuzzy
msgid "View Files"
-msgstr "Archivo"
+msgstr " Archivos"
#: editor/asset_library_editor_plugin.cpp editor/create_dialog.cpp
#: editor/editor_help.cpp editor/property_selector.cpp
@@ -514,7 +512,7 @@ msgstr ""
#: editor/asset_library_editor_plugin.cpp
#, fuzzy
msgid "Download Error"
-msgstr "Abajo"
+msgstr "Descargar"
#: editor/asset_library_editor_plugin.cpp
msgid "Download for this asset is already in progress!"
@@ -548,7 +546,8 @@ msgid "Search:"
msgstr "Buscar:"
#: editor/asset_library_editor_plugin.cpp editor/code_editor.cpp
-#: editor/editor_help.cpp editor/plugins/script_editor_plugin.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"
@@ -594,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"
@@ -639,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"
@@ -740,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"
@@ -847,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"
@@ -937,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"
@@ -963,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"
@@ -1037,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:"
@@ -1106,7 +1104,7 @@ msgstr "Empaquetando"
#: 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:"
@@ -1226,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"
@@ -1247,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:"
@@ -1417,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 "
@@ -1485,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?"
@@ -1539,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"
@@ -1582,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"
@@ -1599,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."
@@ -1635,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"
@@ -1663,84 +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 "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"
@@ -1830,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"
@@ -1847,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!"
@@ -1940,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"
@@ -1967,6 +1998,36 @@ 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:"
@@ -2084,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:"
@@ -2150,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!"
@@ -2190,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."
@@ -2217,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"
@@ -2254,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.."
@@ -2336,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"
@@ -2425,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."
@@ -2911,8 +2958,8 @@ msgstr "Comprimir"
#: editor/io_plugins/editor_translation_import_plugin.cpp
#, fuzzy
-msgid "Add to Project (godot.cfg)"
-msgstr "Agregar al Proyecto (engine.cfg)"
+msgid "Add to Project (project.godot)"
+msgstr "Agregar al Proyecto (godot.cfg)"
#: editor/io_plugins/editor_translation_import_plugin.cpp
msgid "Import Languages:"
@@ -2951,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
@@ -3357,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 (%):"
@@ -3579,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"
@@ -3630,17 +3676,6 @@ msgstr "Crear Poly3D"
msgid "Set Handle"
msgstr "Setear Handle"
-#: editor/plugins/color_ramp_editor_plugin.cpp
-#: editor/plugins/gradient_texture_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/gradient_texture_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"
@@ -3673,8 +3708,31 @@ 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 Mapa de Curvas"
+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"
@@ -3713,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
@@ -3758,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
@@ -3950,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:"
@@ -3962,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"
@@ -3973,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."
@@ -3983,12 +4072,7 @@ 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
-#, fuzzy
-msgid "Generating AABB"
-msgstr "Generar AABB"
+msgstr "Se requiere un material procesador de tipo 'ParticlesMaterial'."
#: editor/plugins/particles_editor_plugin.cpp
msgid "Faces contain no area!"
@@ -4003,14 +4087,12 @@ msgid "Generate AABB"
msgstr "Generar AABB"
#: editor/plugins/particles_editor_plugin.cpp
-#, fuzzy
msgid "Create Emission Points From Mesh"
-msgstr "Crear Emisor desde Mesh"
+msgstr "Crear Puntos de Emisión desde Mesh"
#: editor/plugins/particles_editor_plugin.cpp
-#, fuzzy
msgid "Create Emission Points From Node"
-msgstr "Crear Emisor desde Nodo"
+msgstr "Crear Puntos de Emisión Desde Nodo"
#: editor/plugins/particles_editor_plugin.cpp
msgid "Clear Emitter"
@@ -4021,40 +4103,42 @@ msgid "Create Emitter"
msgstr "Crear Emisor"
#: editor/plugins/particles_editor_plugin.cpp
-#, fuzzy
msgid "Emission Points:"
-msgstr "Posiciones de Emisión:"
+msgstr "Puntos de Emisión:"
#: editor/plugins/particles_editor_plugin.cpp
-#, fuzzy
msgid "Surface Points"
-msgstr "Superficie %d"
+msgstr "Puntos de Superficie"
#: editor/plugins/particles_editor_plugin.cpp
msgid "Surface Points+Normal (Directed)"
-msgstr ""
+msgstr "Puntos de Superficia+Normal (Dirigida)"
#: 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:"
+msgstr "Fuente de Emisión: "
#: editor/plugins/particles_editor_plugin.cpp
#, fuzzy
msgid "Generate Visibility AABB"
msgstr "Generar AABB"
-#: editor/plugins/particles_editor_plugin.cpp
+#: 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 "Generation Time (sec):"
-msgstr "Tiempo Promedio (seg)"
+msgid "Remove Out-Control from Curve"
+msgstr "Mover Out-Control en Curva"
#: editor/plugins/path_2d_editor_plugin.cpp
-msgid "Remove Point from Curve"
+#, fuzzy
+msgid "Remove In-Control from Curve"
msgstr "Remover Punto de Curva"
#: editor/plugins/path_2d_editor_plugin.cpp
@@ -4112,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"
@@ -4265,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"
@@ -4352,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"
@@ -4389,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."
@@ -4417,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"
@@ -4457,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"
@@ -4536,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"
@@ -4558,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"
@@ -4775,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
-msgid "No scene selected to instance!"
-msgstr "Ninguna escena seleccionada a la instancia!"
+#, fuzzy
+msgid "View Environment"
+msgstr "Entorno"
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Instance at Cursor"
-msgstr "Instancia en Cursor"
+#, fuzzy
+msgid "View Gizmos"
+msgstr "Gizmos"
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Could not instance scene!"
-msgstr "No se pudo instanciar la escena!"
+msgid "View Information"
+msgstr ""
+
+#: editor/plugins/spatial_editor_plugin.cpp
+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)"
@@ -4863,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"
@@ -4875,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"
@@ -4907,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"
@@ -4931,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"
@@ -4951,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.):"
@@ -5133,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"
@@ -5297,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.."
@@ -5325,63 +5501,54 @@ 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!"
@@ -5389,13 +5556,13 @@ msgstr "Ruta de proyecto inválida, la ruta debe existir!"
#: editor/project_manager.cpp
#, fuzzy
-msgid "Invalid project path, *.godot must not exist."
-msgstr "Ruta de proyecto inválida, engine.cfg no debe existir."
+msgid "Invalid project path, project.godot must not exist."
+msgstr "Ruta de proyecto inválida, godot.cfg no debe existir."
#: editor/project_manager.cpp
#, fuzzy
-msgid "Invalid project path, *.godot must exist."
-msgstr "Ruta de proyecto inválida, engine.cfg debe existir."
+msgid "Invalid project path, project.godot must exist."
+msgstr "Ruta de proyecto inválida, godot.cfg debe existir."
#: editor/project_manager.cpp
msgid "Imported Project"
@@ -5407,8 +5574,8 @@ msgstr "Ruta de proyecto inválida (cambiaste algo?)."
#: editor/project_manager.cpp
#, fuzzy
-msgid "Couldn't create *.godot project file in project path."
-msgstr "No se pudo crear engine.cfg en la ruta de proyecto."
+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
msgid "The following files failed extraction from package:"
@@ -5507,7 +5674,7 @@ msgstr "Proyecto Nuevo"
#: editor/project_manager.cpp
#, fuzzy
msgid "Templates"
-msgstr "Remover Item"
+msgstr "Remover Plantilla"
#: editor/project_manager.cpp
msgid "Exit"
@@ -5609,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"
@@ -5630,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"
@@ -5696,8 +5866,8 @@ msgstr "Remover Opción de Remapeo de Recursos"
#: editor/project_settings.cpp
#, fuzzy
-msgid "Project Settings "
-msgstr "Configuración de Proyecto"
+msgid "Project Settings (project.godot)"
+msgstr "Configuración de Proyecto (godot.cfg)"
#: editor/project_settings.cpp editor/settings_config_dialog.cpp
msgid "General"
@@ -5764,9 +5934,8 @@ msgid "AutoLoad"
msgstr "AutoLoad"
#: editor/property_editor.cpp
-#, fuzzy
msgid "Pick a Viewport"
-msgstr "1 Viewport"
+msgstr "Seleccionar un Viewport"
#: editor/property_editor.cpp
msgid "Ease In"
@@ -5805,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"
@@ -5965,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."
@@ -6009,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"
@@ -6049,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)"
@@ -6086,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:"
@@ -6134,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
@@ -6432,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 ""
@@ -6715,31 +6949,26 @@ msgid "just released"
msgstr "recién soltado"
#: platform/javascript/export/export.cpp
-#, fuzzy
msgid "Run in Browser"
-msgstr "Examinar"
+msgstr "Ejecutar en el Navegador"
#: platform/javascript/export/export.cpp
msgid "Run exported HTML in the system's default browser."
-msgstr ""
+msgstr "Ejecutar HTML exportado en el navegador por defecto del sistema."
#: platform/javascript/export/export.cpp
-#, fuzzy
msgid "Could not write file:\n"
-msgstr "No se pudo cargar el tile:"
+msgstr "No se pudo escribir el archivo:\n"
#: platform/javascript/export/export.cpp
-#, fuzzy
msgid "Could not read file:\n"
-msgstr "No se pudo cargar el tile:"
+msgstr "No se pudo leer el archivo:\n"
#: platform/javascript/export/export.cpp
-#, fuzzy
msgid "Could not open template for export:\n"
-msgstr "No se pudo crear la carpeta."
+msgstr "No se pudo abrir la plantilla para exportar:\n"
#: platform/uwp/export/export.cpp
-#, fuzzy
msgid ""
"Couldn't read the certificate file. Are the path and password both correct?"
msgstr ""
@@ -6759,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."
@@ -6915,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."
@@ -7003,12 +7233,6 @@ msgid ""
"Nothing is visible because meshes have not been assigned to draw passes."
msgstr ""
-#: scene/3d/particles.cpp
-msgid ""
-"A material to process the particles is not assigned, so no behavior is "
-"imprinted."
-msgstr ""
-
#: scene/3d/remote_transform.cpp
msgid "Path property must point to a valid Spatial node to work."
msgstr ""
@@ -7029,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!"
@@ -7073,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 ""
@@ -7092,9 +7334,64 @@ msgstr ""
#~ msgid "Import assets to the project."
#~ msgstr "Importar assets al proyecto."
-#, fuzzy
-#~ msgid "Project Settings (godot.cfg)"
-#~ msgstr "Ajustes de Proyecto (engine.cfg)"
+#~ 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"
@@ -7315,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:"
@@ -7351,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"
@@ -7396,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/fa.po b/editor/translations/fa.po
index e8402fcb25..e8132b9936 100644
--- a/editor/translations/fa.po
+++ b/editor/translations/fa.po
@@ -1,6 +1,5 @@
# Persian translation of the Godot Engine editor
-# Copyright (C) 2007-2017 Juan Linietsky, Ariel Manzur
-# Copyright (C) 2014-2017 Godot Engine contributors (cf. AUTHORS.md)
+# 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.
#
# alabd14313 <alabd14313@yahoo.com>, 2016.
@@ -545,7 +544,8 @@ msgid "Search:"
msgstr "جستجو:"
#: editor/asset_library_editor_plugin.cpp editor/code_editor.cpp
-#: editor/editor_help.cpp editor/plugins/script_editor_plugin.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"
@@ -591,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 "انجمن"
@@ -735,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 "برداشتن"
@@ -846,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 "مسیر"
@@ -950,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 ""
@@ -961,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 "Ù¾ÛŒØ´ÙØ±Ø¶"
@@ -1029,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 "مسیر:"
@@ -1222,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 ""
@@ -1239,7 +1241,6 @@ msgid "Class:"
msgstr "کلاس:"
#: editor/editor_help.cpp editor/scene_tree_editor.cpp
-#: editor/script_create_dialog.cpp
msgid "Inherits:"
msgstr "میراث:"
@@ -1410,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
@@ -1465,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 ""
@@ -1521,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 ""
@@ -1559,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 "صحنه"
@@ -1611,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 ""
@@ -1639,35 +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"
+msgid "Miscellaneous project or scene-wide tools."
msgstr ""
#: editor/editor_node.cpp
-msgid "Distraction Free Mode"
-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
@@ -1675,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
@@ -1786,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"
@@ -1808,14 +1775,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 ""
@@ -1896,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"
@@ -1923,6 +1954,35 @@ 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 "Ø§ÙØ²ÙˆÙ†Ù‡ های نصب شده:"
@@ -2171,6 +2231,10 @@ msgid "Collapse all"
msgstr ""
#: editor/filesystem_dock.cpp
+msgid "Show In File Manager"
+msgstr ""
+
+#: editor/filesystem_dock.cpp
msgid "Instance"
msgstr ""
@@ -2199,10 +2263,6 @@ msgid "Info"
msgstr ""
#: editor/filesystem_dock.cpp
-msgid "Show In File Manager"
-msgstr ""
-
-#: editor/filesystem_dock.cpp
msgid "Re-Import.."
msgstr ""
@@ -2370,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
@@ -2847,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
@@ -3509,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 "مواÙقت"
@@ -3558,17 +3618,6 @@ msgstr ""
msgid "Set Handle"
msgstr ""
-#: editor/plugins/color_ramp_editor_plugin.cpp
-#: editor/plugins/gradient_texture_editor_plugin.cpp
-msgid "Add/Remove Color Ramp Point"
-msgstr ""
-
-#: editor/plugins/color_ramp_editor_plugin.cpp
-#: editor/plugins/gradient_texture_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 ""
@@ -3600,9 +3649,33 @@ 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 ""
@@ -3873,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 ""
@@ -3885,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
@@ -3896,20 +3982,33 @@ msgstr ""
msgid "Generated Point Count:"
msgstr ""
+#: editor/plugins/particles_2d_editor_plugin.cpp
#: editor/plugins/particles_editor_plugin.cpp
-msgid "Node does not contain geometry."
+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 (faces)."
+msgid "Node does not contain geometry."
msgstr ""
#: editor/plugins/particles_editor_plugin.cpp
-msgid "A processor material of type 'ParticlesMaterial' is required."
+msgid "Node does not contain geometry (faces)."
msgstr ""
#: editor/plugins/particles_editor_plugin.cpp
-msgid "Generating AABB"
+msgid "A processor material of type 'ParticlesMaterial' is required."
msgstr ""
#: editor/plugins/particles_editor_plugin.cpp
@@ -3964,12 +4063,16 @@ msgstr ""
msgid "Generate Visibility AABB"
msgstr ""
-#: editor/plugins/particles_editor_plugin.cpp
-msgid "Generation Time (sec):"
+#: editor/plugins/path_2d_editor_plugin.cpp
+msgid "Remove Point from Curve"
msgstr ""
#: editor/plugins/path_2d_editor_plugin.cpp
-msgid "Remove Point from Curve"
+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
@@ -4027,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 ""
@@ -4180,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 ""
@@ -4268,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 ""
@@ -4305,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
@@ -4369,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"
@@ -4448,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 ""
@@ -4470,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 ""
@@ -4687,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 "Display Wireframe"
msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Audio Listener"
+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
@@ -4775,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
@@ -4819,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 ""
@@ -4843,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 ""
@@ -4863,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 ""
@@ -5286,11 +5471,11 @@ msgid "Invalid project path, the path must exist!"
msgstr ""
#: editor/project_manager.cpp
-msgid "Invalid project path, *.godot must not exist."
+msgid "Invalid project path, project.godot must not exist."
msgstr ""
#: editor/project_manager.cpp
-msgid "Invalid project path, *.godot must exist."
+msgid "Invalid project path, project.godot must exist."
msgstr ""
#: editor/project_manager.cpp
@@ -5302,7 +5487,7 @@ msgid "Invalid project path (changed anything?)."
msgstr ""
#: editor/project_manager.cpp
-msgid "Couldn't create *.godot project file in project path."
+msgid "Couldn't create project.godot in project path."
msgstr ""
#: editor/project_manager.cpp
@@ -5521,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 "دستگاه"
@@ -5586,9 +5775,8 @@ msgid "Remove Resource Remap Option"
msgstr ""
#: editor/project_settings.cpp
-#, fuzzy
-msgid "Project Settings "
-msgstr "ترجیحات"
+msgid "Project Settings (project.godot)"
+msgstr ""
#: editor/project_settings.cpp editor/settings_config_dialog.cpp
msgid "General"
@@ -5704,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 "مسیر به سمت گره:"
@@ -5895,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 ""
@@ -5971,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 ""
@@ -6019,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
-msgid "Built-In Script"
+#, fuzzy
+msgid "Template"
+msgstr "برداشتن انتخاب شده"
+
+#: editor/script_create_dialog.cpp
+msgid "Built-in Script"
msgstr ""
#: editor/script_create_dialog.cpp
@@ -6796,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."
@@ -6885,12 +7137,6 @@ msgid ""
"Nothing is visible because meshes have not been assigned to draw passes."
msgstr ""
-#: scene/3d/particles.cpp
-msgid ""
-"A material to process the particles is not assigned, so no behavior is "
-"imprinted."
-msgstr ""
-
#: scene/3d/remote_transform.cpp
#, fuzzy
msgid "Path property must point to a valid Spatial node to work."
@@ -6911,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 "هشدار!"
@@ -6956,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 "
@@ -6968,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 8db0cf2555..bb60c74475 100644
--- a/editor/translations/fr.po
+++ b/editor/translations/fr.po
@@ -1,14 +1,15 @@
# French translation of the Godot Engine editor
-# Copyright (C) 2007-2017 Juan Linietsky, Ariel Manzur
-# Copyright (C) 2014-2017 Godot Engine contributors (cf. AUTHORS.md)
+# 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.
#
# Brice <bbric@free.fr>, 2016.
# Chenebel Dorian <LoubiTek54@gmail.com>, 2016-2017.
# derderder77 <derderder77380@gmail.com>, 2016.
# finkiki <specialpopol@gmx.fr>, 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.
@@ -21,8 +22,8 @@ msgid ""
msgstr ""
"Project-Id-Version: Godot Engine editor\n"
"POT-Creation-Date: \n"
-"PO-Revision-Date: 2017-02-28 20:39+0000\n"
-"Last-Translator: Hugo Locurcio <hugo.l@openmailbox.org>\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"
@@ -30,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.12-dev\n"
+"X-Generator: Weblate 2.14.1\n"
#: editor/animation_editor.cpp
msgid "Disabled"
@@ -297,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"
@@ -525,7 +526,7 @@ msgstr ""
#: editor/asset_library_editor_plugin.cpp
#, fuzzy
msgid "Download Error"
-msgstr "Bas"
+msgstr "Télécharger"
#: editor/asset_library_editor_plugin.cpp
msgid "Download for this asset is already in progress!"
@@ -559,7 +560,8 @@ msgid "Search:"
msgstr "Rechercher :"
#: editor/asset_library_editor_plugin.cpp editor/code_editor.cpp
-#: editor/editor_help.cpp editor/plugins/script_editor_plugin.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"
@@ -605,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é"
@@ -650,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)."
@@ -751,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"
@@ -860,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"
@@ -952,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"
@@ -979,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"
@@ -1053,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 :"
@@ -1122,7 +1125,7 @@ msgstr "Empaquetage"
#: 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:"
@@ -1242,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"
@@ -1263,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 :"
@@ -1433,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 » "
@@ -1502,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 ?"
@@ -1559,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"
@@ -1602,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"
@@ -1619,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."
@@ -1655,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"
@@ -1683,85 +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 "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"
@@ -1776,9 +1746,8 @@ 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
msgid ""
@@ -1853,9 +1822,10 @@ msgstr ""
"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"
@@ -1870,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!"
@@ -1963,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"
@@ -1990,6 +2024,36 @@ msgstr "Ouvrir et exécuter un script"
msgid "Load Errors"
msgstr "Erreurs de chargement"
+#: 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 "Installed Plugins:"
msgstr "Extensions installées :"
@@ -2110,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
@@ -2140,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
@@ -2181,7 +2246,7 @@ 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
@@ -2216,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."
@@ -2249,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"
@@ -2280,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…"
@@ -2297,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"
@@ -2305,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"
@@ -2453,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."
@@ -2514,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
@@ -2640,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"
@@ -2652,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"
@@ -2821,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."
@@ -2939,7 +3007,7 @@ msgstr "Compresser"
#: editor/io_plugins/editor_translation_import_plugin.cpp
#, fuzzy
-msgid "Add to Project (godot.cfg)"
+msgid "Add to Project (project.godot)"
msgstr "Ajouter au projet (engine.cfg)"
#: editor/io_plugins/editor_translation_import_plugin.cpp
@@ -3207,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:"
@@ -3587,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"
@@ -3617,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"
@@ -3626,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
@@ -3666,17 +3736,6 @@ msgstr "Créer un Poly3D"
msgid "Set Handle"
msgstr "Définir la poignée"
-#: editor/plugins/color_ramp_editor_plugin.cpp
-#: editor/plugins/gradient_texture_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/gradient_texture_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"
@@ -3709,9 +3768,33 @@ 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"
@@ -3814,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!"
@@ -3991,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 :"
@@ -4003,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"
@@ -4014,6 +4111,27 @@ msgstr "Charger le masque d'émission"
msgid "Generated Point Count:"
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."
msgstr "Le nœud ne contient pas de géométrie."
@@ -4027,11 +4145,6 @@ msgid "A processor material of type 'ParticlesMaterial' is required."
msgstr ""
#: editor/plugins/particles_editor_plugin.cpp
-#, fuzzy
-msgid "Generating AABB"
-msgstr "Générer un AABB"
-
-#: editor/plugins/particles_editor_plugin.cpp
msgid "Faces contain no area!"
msgstr "Les faces n'ont pas de surface !"
@@ -4089,13 +4202,18 @@ msgstr "Remplissage d'émission :"
msgid "Generate Visibility AABB"
msgstr "Générer un AABB"
-#: editor/plugins/particles_editor_plugin.cpp
+#: 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 "Generation Time (sec):"
-msgstr "Temps moyen (seconde)"
+msgid "Remove Out-Control from Curve"
+msgstr "Supprimer le point d'une courbe"
#: editor/plugins/path_2d_editor_plugin.cpp
-msgid "Remove Point from Curve"
+#, fuzzy
+msgid "Remove In-Control from Curve"
msgstr "Supprimer le point d'une courbe"
#: editor/plugins/path_2d_editor_plugin.cpp
@@ -4153,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"
@@ -4306,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"
@@ -4394,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"
@@ -4431,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."
@@ -4448,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."
@@ -4499,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"
@@ -4578,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"
@@ -4600,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"
@@ -4817,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)"
@@ -4905,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"
@@ -4917,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"
@@ -4949,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"
@@ -4973,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"
@@ -4993,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:"
@@ -5432,12 +5647,12 @@ msgstr "Chemin de projet invalide, le chemin doit exister !"
#: editor/project_manager.cpp
#, fuzzy
-msgid "Invalid project path, *.godot must not exist."
+msgid "Invalid project path, project.godot must not exist."
msgstr "Chemin de projet invalide, engine.cfg ne doit pas exister."
#: editor/project_manager.cpp
#, fuzzy
-msgid "Invalid project path, *.godot must exist."
+msgid "Invalid project path, project.godot must exist."
msgstr "Chemin de projet invalide, engine.cfg doit exister."
#: editor/project_manager.cpp
@@ -5450,7 +5665,7 @@ msgstr "Chemin de projet non valide (avez-vous changé quelque chose ?)."
#: editor/project_manager.cpp
#, fuzzy
-msgid "Couldn't create *.godot project file in project path."
+msgid "Couldn't create project.godot in project path."
msgstr ""
"Impossible de créer le fichier engine.cfg dans le répertoire du projet."
@@ -5679,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"
@@ -5745,8 +5965,8 @@ msgstr ""
#: editor/project_settings.cpp
#, fuzzy
-msgid "Project Settings "
-msgstr "Paramètres du projet"
+msgid "Project Settings (project.godot)"
+msgstr "Paramètres du projet (engine.cfg)"
#: editor/project_settings.cpp editor/settings_config_dialog.cpp
msgid "General"
@@ -5863,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"
@@ -6057,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"
@@ -6086,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"
@@ -6138,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 :"
@@ -6186,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
@@ -6419,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"
@@ -6717,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."
@@ -6972,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."
@@ -7063,12 +7348,6 @@ msgid ""
"Nothing is visible because meshes have not been assigned to draw passes."
msgstr ""
-#: scene/3d/particles.cpp
-msgid ""
-"A material to process the particles is not assigned, so no behavior is "
-"imprinted."
-msgstr ""
-
#: scene/3d/remote_transform.cpp
msgid "Path property must point to a valid Spatial node to work."
msgstr ""
@@ -7089,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 !"
@@ -7135,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 "
@@ -7153,9 +7447,64 @@ msgstr ""
#~ msgid "Import assets to the project."
#~ msgstr "Importer des ressources dans le projet."
-#, fuzzy
-#~ msgid "Project Settings (godot.cfg)"
-#~ msgstr "Paramètres du projet (engine.cfg)"
+#~ 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"
@@ -7368,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 :"
@@ -7404,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"
@@ -7442,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 2d1b36d2ea..d6f3caa1e9 100644
--- a/editor/translations/hu.po
+++ b/editor/translations/hu.po
@@ -1,6 +1,5 @@
# Hungarian translation of the Godot Engine editor
-# Copyright (C) 2007-2017 Juan Linietsky, Ariel Manzur
-# Copyright (C) 2014-2017 Godot Engine contributors (cf. AUTHORS.md)
+# 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.
#
# Varga Dániel <danikah.danikah@gmail.com>, 2016.
@@ -532,7 +531,8 @@ msgid "Search:"
msgstr ""
#: editor/asset_library_editor_plugin.cpp editor/code_editor.cpp
-#: editor/editor_help.cpp editor/plugins/script_editor_plugin.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"
@@ -578,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 ""
@@ -721,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 ""
@@ -826,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 ""
@@ -926,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 ""
@@ -937,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 ""
@@ -1005,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 ""
@@ -1197,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 ""
@@ -1214,7 +1216,6 @@ msgid "Class:"
msgstr ""
#: editor/editor_help.cpp editor/scene_tree_editor.cpp
-#: editor/script_create_dialog.cpp
msgid "Inherits:"
msgstr ""
@@ -1384,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
@@ -1439,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 ""
@@ -1495,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 ""
@@ -1533,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 ""
@@ -1585,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 ""
@@ -1613,35 +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"
+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
@@ -1649,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
@@ -1760,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
@@ -1781,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
@@ -1869,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 ""
@@ -1896,6 +1925,30 @@ 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
+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 ""
@@ -2139,6 +2192,10 @@ msgid "Collapse all"
msgstr ""
#: editor/filesystem_dock.cpp
+msgid "Show In File Manager"
+msgstr ""
+
+#: editor/filesystem_dock.cpp
msgid "Instance"
msgstr ""
@@ -2167,10 +2224,6 @@ msgid "Info"
msgstr ""
#: editor/filesystem_dock.cpp
-msgid "Show In File Manager"
-msgstr ""
-
-#: editor/filesystem_dock.cpp
msgid "Re-Import.."
msgstr ""
@@ -2336,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
@@ -2811,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
@@ -3471,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 ""
@@ -3520,17 +3573,6 @@ msgstr ""
msgid "Set Handle"
msgstr ""
-#: editor/plugins/color_ramp_editor_plugin.cpp
-#: editor/plugins/gradient_texture_editor_plugin.cpp
-msgid "Add/Remove Color Ramp Point"
-msgstr ""
-
-#: editor/plugins/color_ramp_editor_plugin.cpp
-#: editor/plugins/gradient_texture_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 ""
@@ -3562,9 +3604,30 @@ 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 ""
@@ -3834,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 ""
@@ -3846,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
@@ -3857,20 +3933,33 @@ msgstr ""
msgid "Generated Point Count:"
msgstr ""
+#: editor/plugins/particles_2d_editor_plugin.cpp
#: editor/plugins/particles_editor_plugin.cpp
-msgid "Node does not contain geometry."
+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 (faces)."
+msgid "Node does not contain geometry."
msgstr ""
#: editor/plugins/particles_editor_plugin.cpp
-msgid "A processor material of type 'ParticlesMaterial' is required."
+msgid "Node does not contain geometry (faces)."
msgstr ""
#: editor/plugins/particles_editor_plugin.cpp
-msgid "Generating AABB"
+msgid "A processor material of type 'ParticlesMaterial' is required."
msgstr ""
#: editor/plugins/particles_editor_plugin.cpp
@@ -3925,12 +4014,16 @@ msgstr ""
msgid "Generate Visibility AABB"
msgstr ""
-#: editor/plugins/particles_editor_plugin.cpp
-msgid "Generation Time (sec):"
+#: editor/plugins/path_2d_editor_plugin.cpp
+msgid "Remove Point from Curve"
msgstr ""
#: editor/plugins/path_2d_editor_plugin.cpp
-msgid "Remove Point from Curve"
+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
@@ -3988,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 ""
@@ -4141,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 ""
@@ -4228,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 ""
@@ -4265,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
@@ -4328,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"
@@ -4407,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 ""
@@ -4429,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 ""
@@ -4646,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 "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
@@ -4734,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
@@ -4822,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 ""
@@ -5242,11 +5411,11 @@ msgid "Invalid project path, the path must exist!"
msgstr ""
#: editor/project_manager.cpp
-msgid "Invalid project path, *.godot must not exist."
+msgid "Invalid project path, project.godot must not exist."
msgstr ""
#: editor/project_manager.cpp
-msgid "Invalid project path, *.godot must exist."
+msgid "Invalid project path, project.godot must exist."
msgstr ""
#: editor/project_manager.cpp
@@ -5258,7 +5427,7 @@ msgid "Invalid project path (changed anything?)."
msgstr ""
#: editor/project_manager.cpp
-msgid "Couldn't create *.godot project file in project path."
+msgid "Couldn't create project.godot in project path."
msgstr ""
#: editor/project_manager.cpp
@@ -5474,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 ""
@@ -5539,7 +5712,7 @@ msgid "Remove Resource Remap Option"
msgstr ""
#: editor/project_settings.cpp
-msgid "Project Settings "
+msgid "Project Settings (project.godot)"
msgstr ""
#: editor/project_settings.cpp editor/settings_config_dialog.cpp
@@ -5655,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 ""
@@ -5843,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 ""
@@ -5917,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 ""
@@ -5965,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 file"
+msgstr ""
+
+#: editor/script_create_dialog.cpp
+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
@@ -6685,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
@@ -6754,12 +6983,6 @@ msgid ""
"Nothing is visible because meshes have not been assigned to draw passes."
msgstr ""
-#: scene/3d/particles.cpp
-msgid ""
-"A material to process the particles is not assigned, so no behavior is "
-"imprinted."
-msgstr ""
-
#: scene/3d/remote_transform.cpp
msgid "Path property must point to a valid Spatial node to work."
msgstr ""
@@ -6775,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 ""
@@ -6817,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 2abf4090c8..15221690f2 100644
--- a/editor/translations/id.po
+++ b/editor/translations/id.po
@@ -1,6 +1,5 @@
# Indonesian translation of the Godot Engine editor
-# Copyright (C) 2007-2017 Juan Linietsky, Ariel Manzur
-# Copyright (C) 2014-2017 Godot Engine contributors (cf. AUTHORS.md)
+# 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.
#
# Abdul Aziz Muslim Alqudsy <abdul.aziz.muslim.alqudsy@gmail.com>, 2016.
@@ -565,7 +564,8 @@ msgid "Search:"
msgstr "Cari:"
#: editor/asset_library_editor_plugin.cpp editor/code_editor.cpp
-#: editor/editor_help.cpp editor/plugins/script_editor_plugin.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"
@@ -611,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"
@@ -758,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"
@@ -868,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"
@@ -977,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 ""
@@ -988,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"
@@ -1059,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:"
@@ -1255,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"
@@ -1272,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:"
@@ -1444,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 "
@@ -1512,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?"
@@ -1570,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"
@@ -1611,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"
@@ -1663,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 ""
@@ -1691,35 +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"
+msgid "Miscellaneous project or scene-wide tools."
msgstr ""
#: editor/editor_node.cpp
-msgid "Distraction Free Mode"
-msgstr "Mode Tanpa Gangguan"
-
-#: 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
@@ -1727,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
@@ -1838,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"
@@ -1861,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
@@ -1949,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 ""
@@ -1976,6 +2007,34 @@ msgstr ""
msgid "Load Errors"
msgstr ""
+#: 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 "Installed Plugins:"
msgstr ""
@@ -2224,6 +2283,10 @@ msgid "Collapse all"
msgstr ""
#: editor/filesystem_dock.cpp
+msgid "Show In File Manager"
+msgstr ""
+
+#: editor/filesystem_dock.cpp
msgid "Instance"
msgstr ""
@@ -2252,10 +2315,6 @@ msgid "Info"
msgstr ""
#: editor/filesystem_dock.cpp
-msgid "Show In File Manager"
-msgstr ""
-
-#: editor/filesystem_dock.cpp
msgid "Re-Import.."
msgstr ""
@@ -2424,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
@@ -2900,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
@@ -3562,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"
@@ -3611,17 +3670,6 @@ msgstr ""
msgid "Set Handle"
msgstr ""
-#: editor/plugins/color_ramp_editor_plugin.cpp
-#: editor/plugins/gradient_texture_editor_plugin.cpp
-msgid "Add/Remove Color Ramp Point"
-msgstr ""
-
-#: editor/plugins/color_ramp_editor_plugin.cpp
-#: editor/plugins/gradient_texture_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 ""
@@ -3653,9 +3701,32 @@ 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 ""
@@ -3926,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 ""
@@ -3938,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
@@ -3949,20 +4033,33 @@ msgstr ""
msgid "Generated Point Count:"
msgstr ""
+#: editor/plugins/particles_2d_editor_plugin.cpp
#: editor/plugins/particles_editor_plugin.cpp
-msgid "Node does not contain geometry."
+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 (faces)."
+msgid "Node does not contain geometry."
msgstr ""
#: editor/plugins/particles_editor_plugin.cpp
-msgid "A processor material of type 'ParticlesMaterial' is required."
+msgid "Node does not contain geometry (faces)."
msgstr ""
#: editor/plugins/particles_editor_plugin.cpp
-msgid "Generating AABB"
+msgid "A processor material of type 'ParticlesMaterial' is required."
msgstr ""
#: editor/plugins/particles_editor_plugin.cpp
@@ -4017,12 +4114,16 @@ msgstr ""
msgid "Generate Visibility AABB"
msgstr ""
-#: editor/plugins/particles_editor_plugin.cpp
-msgid "Generation Time (sec):"
+#: editor/plugins/path_2d_editor_plugin.cpp
+msgid "Remove Point from Curve"
msgstr ""
#: editor/plugins/path_2d_editor_plugin.cpp
-msgid "Remove Point from Curve"
+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
@@ -4080,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 ""
@@ -4233,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 ""
@@ -4321,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 ""
@@ -4358,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
@@ -4422,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"
@@ -4501,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 ""
@@ -4523,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 ""
@@ -4740,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 "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
@@ -4828,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 "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
@@ -4872,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
@@ -4916,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 ""
@@ -5341,11 +5526,11 @@ msgid "Invalid project path, the path must exist!"
msgstr ""
#: editor/project_manager.cpp
-msgid "Invalid project path, *.godot must not exist."
+msgid "Invalid project path, project.godot must not exist."
msgstr ""
#: editor/project_manager.cpp
-msgid "Invalid project path, *.godot must exist."
+msgid "Invalid project path, project.godot must exist."
msgstr ""
#: editor/project_manager.cpp
@@ -5357,7 +5542,7 @@ msgid "Invalid project path (changed anything?)."
msgstr ""
#: editor/project_manager.cpp
-msgid "Couldn't create *.godot project file in project path."
+msgid "Couldn't create project.godot in project path."
msgstr ""
#: editor/project_manager.cpp
@@ -5574,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"
@@ -5641,7 +5830,7 @@ msgid "Remove Resource Remap Option"
msgstr ""
#: editor/project_settings.cpp
-msgid "Project Settings "
+msgid "Project Settings (project.godot)"
msgstr ""
#: editor/project_settings.cpp editor/settings_config_dialog.cpp
@@ -5758,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:"
@@ -5949,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 ""
@@ -6026,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 ""
@@ -6074,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
@@ -6851,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."
@@ -6945,12 +7196,6 @@ msgid ""
"Nothing is visible because meshes have not been assigned to draw passes."
msgstr ""
-#: scene/3d/particles.cpp
-msgid ""
-"A material to process the particles is not assigned, so no behavior is "
-"imprinted."
-msgstr ""
-
#: scene/3d/remote_transform.cpp
#, fuzzy
msgid "Path property must point to a valid Spatial node to work."
@@ -6973,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!"
@@ -7018,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 ""
@@ -7035,6 +7294,11 @@ msgstr ""
#~ 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 08d04d296b..28ed2d5b0a 100644
--- a/editor/translations/it.po
+++ b/editor/translations/it.po
@@ -1,17 +1,17 @@
# Italian translation of the Godot Engine editor
-# Copyright (C) 2007-2017 Juan Linietsky, Ariel Manzur
-# Copyright (C) 2014-2017 Godot Engine contributors (cf. AUTHORS.md)
+# 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-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: 2017-01-29 19:58+0000\n"
-"Last-Translator: RealAquilus <JamesHeller@live.it>\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"
"Language: it\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.11-dev\n"
+"X-Generator: Weblate 2.14.1-dev\n"
#: editor/animation_editor.cpp
msgid "Disabled"
@@ -86,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"
@@ -377,7 +376,7 @@ msgstr "Costanti:"
#: editor/asset_library_editor_plugin.cpp
#, fuzzy
msgid "View Files"
-msgstr "File"
+msgstr " Files"
#: editor/asset_library_editor_plugin.cpp editor/create_dialog.cpp
#: editor/editor_help.cpp editor/property_selector.cpp
@@ -513,7 +512,7 @@ msgstr ""
#: editor/asset_library_editor_plugin.cpp
#, fuzzy
msgid "Download Error"
-msgstr "Giù"
+msgstr "Scarica"
#: editor/asset_library_editor_plugin.cpp
msgid "Download for this asset is already in progress!"
@@ -547,7 +546,8 @@ msgid "Search:"
msgstr "Cerca:"
#: editor/asset_library_editor_plugin.cpp editor/code_editor.cpp
-#: editor/editor_help.cpp editor/plugins/script_editor_plugin.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"
@@ -593,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à"
@@ -638,7 +638,6 @@ msgid "No Matches"
msgstr "Nessuna Corrispondenza"
#: editor/code_editor.cpp
-#, fuzzy
msgid "Replaced %d occurrence(s)."
msgstr "Rimpiazzate %d occorrenze."
@@ -739,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"
@@ -848,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"
@@ -937,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"
@@ -963,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"
@@ -1037,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:"
@@ -1106,7 +1105,7 @@ msgstr "Impacchettando"
#: 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:"
@@ -1226,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"
@@ -1247,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:"
@@ -1417,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 "
@@ -1485,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?"
@@ -1541,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"
@@ -1584,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"
@@ -1601,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."
@@ -1637,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"
@@ -1665,84 +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 "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 "Export the project to many platforms."
-msgstr "Esporta il progetto a diverse piattaforme."
+msgid "Project Settings"
+msgstr "Impostazioni Progetto"
+
+#: editor/editor_node.cpp
+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"
@@ -1831,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"
@@ -1848,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!"
@@ -1941,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"
@@ -1968,6 +2000,36 @@ 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:"
@@ -2085,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."
@@ -2123,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:"
@@ -2154,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!"
@@ -2191,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."
@@ -2220,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"
@@ -2257,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.."
@@ -2338,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!"
@@ -2428,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."
@@ -2913,8 +2961,8 @@ msgstr "Comprimi"
#: editor/io_plugins/editor_translation_import_plugin.cpp
#, fuzzy
-msgid "Add to Project (godot.cfg)"
-msgstr "Aggiungi a Progetto (engine.cfg)"
+msgid "Add to Project (project.godot)"
+msgstr "Aggiungi a Progetto (godot.cfg)"
#: editor/io_plugins/editor_translation_import_plugin.cpp
msgid "Import Languages:"
@@ -2953,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
@@ -3579,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"
@@ -3630,17 +3677,6 @@ msgstr "Crea Poly3D"
msgid "Set Handle"
msgstr "Imposta Maniglia"
-#: editor/plugins/color_ramp_editor_plugin.cpp
-#: editor/plugins/gradient_texture_editor_plugin.cpp
-msgid "Add/Remove Color Ramp Point"
-msgstr "Aggiungi/Rimuovi Punto Rampa Colori"
-
-#: editor/plugins/color_ramp_editor_plugin.cpp
-#: editor/plugins/gradient_texture_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"
@@ -3673,8 +3709,31 @@ 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 la Mappa 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"
@@ -3713,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
@@ -3758,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
@@ -3951,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:"
@@ -3963,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"
@@ -3974,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."
@@ -3984,12 +4074,7 @@ msgstr "Il nodo non contiene geometria (facce)."
#: editor/plugins/particles_editor_plugin.cpp
msgid "A processor material of type 'ParticlesMaterial' is required."
-msgstr ""
-
-#: editor/plugins/particles_editor_plugin.cpp
-#, fuzzy
-msgid "Generating AABB"
-msgstr "Genera AABB"
+msgstr "Un processor material di tipo 'ParticlesMaterial' é richiesto."
#: editor/plugins/particles_editor_plugin.cpp
msgid "Faces contain no area!"
@@ -4004,14 +4089,12 @@ msgid "Generate AABB"
msgstr "Genera AABB"
#: editor/plugins/particles_editor_plugin.cpp
-#, fuzzy
msgid "Create Emission Points From Mesh"
-msgstr "Crea Emitter Da Mesh"
+msgstr "Crea Punti Emissione Da Mesh"
#: editor/plugins/particles_editor_plugin.cpp
-#, fuzzy
msgid "Create Emission Points From Node"
-msgstr "Crea Emitter Da Nodo"
+msgstr "Crea Punti Emissione Da Nodo"
#: editor/plugins/particles_editor_plugin.cpp
msgid "Clear Emitter"
@@ -4022,40 +4105,42 @@ msgid "Create Emitter"
msgstr "Crea Emitter"
#: editor/plugins/particles_editor_plugin.cpp
-#, fuzzy
msgid "Emission Points:"
-msgstr "Posizioni di Emissione:"
+msgstr "Punti Emissione:"
#: editor/plugins/particles_editor_plugin.cpp
-#, fuzzy
msgid "Surface Points"
-msgstr "Superficie %d"
+msgstr "Punti Superficie"
#: editor/plugins/particles_editor_plugin.cpp
msgid "Surface Points+Normal (Directed)"
-msgstr ""
+msgstr "Punti superficie+Normali (Dirette)"
#: editor/plugins/particles_editor_plugin.cpp
msgid "Volume"
msgstr "Volume"
#: editor/plugins/particles_editor_plugin.cpp
-#, fuzzy
msgid "Emission Source: "
-msgstr "Riempimento Emissione:"
+msgstr "Sorgente Emissione: "
#: editor/plugins/particles_editor_plugin.cpp
#, fuzzy
msgid "Generate Visibility AABB"
msgstr "Genera AABB"
-#: editor/plugins/particles_editor_plugin.cpp
+#: 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 "Generation Time (sec):"
-msgstr "Tempo Medio (sec)"
+msgid "Remove Out-Control from Curve"
+msgstr "Sposta Out-Control sulla Curva"
#: editor/plugins/path_2d_editor_plugin.cpp
-msgid "Remove Point from Curve"
+#, fuzzy
+msgid "Remove In-Control from Curve"
msgstr "Rimuovi Punto da Curva"
#: editor/plugins/path_2d_editor_plugin.cpp
@@ -4113,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"
@@ -4266,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"
@@ -4353,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"
@@ -4390,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."
@@ -4418,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"
@@ -4458,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"
@@ -4537,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"
@@ -4559,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"
@@ -4776,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)"
@@ -4864,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"
@@ -4876,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"
@@ -4908,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"
@@ -4932,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"
@@ -4952,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.):"
@@ -5298,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.."
@@ -5326,63 +5503,54 @@ 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!"
@@ -5390,13 +5558,13 @@ msgstr "Percorso di progetto invalido, il percorso deve esistere!"
#: editor/project_manager.cpp
#, fuzzy
-msgid "Invalid project path, *.godot must not exist."
-msgstr "Percorso di progetto invalido, engine.cfg non deve esistere."
+msgid "Invalid project path, project.godot must not exist."
+msgstr "Percorso di progetto invalido, godot.cfg non esiste."
#: editor/project_manager.cpp
#, fuzzy
-msgid "Invalid project path, *.godot must exist."
-msgstr "Percorso di progetto invalido, engine.cfg deve esistere."
+msgid "Invalid project path, project.godot must exist."
+msgstr "Percorso di progetto invalido, godot.cfg deve esistere."
#: editor/project_manager.cpp
msgid "Imported Project"
@@ -5408,8 +5576,8 @@ msgstr "Percorso di progetto invalido (cambiato qualcosa?)."
#: editor/project_manager.cpp
#, fuzzy
-msgid "Couldn't create *.godot project file in project path."
-msgstr "Impossibile creare engine.cfg nel percorso di progetto."
+msgid "Couldn't create project.godot in project path."
+msgstr "Impossibile creare godot.cfg nel percorso di progetto."
#: editor/project_manager.cpp
msgid "The following files failed extraction from package:"
@@ -5506,7 +5674,7 @@ msgstr "Nuovo Progetto"
#: editor/project_manager.cpp
#, fuzzy
msgid "Templates"
-msgstr "Rimuovi Elemento"
+msgstr "Rimuovi Template"
#: editor/project_manager.cpp
msgid "Exit"
@@ -5608,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"
@@ -5629,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"
@@ -5695,8 +5866,8 @@ msgstr "Rimuovi Opzione di Remap Rimorse"
#: editor/project_settings.cpp
#, fuzzy
-msgid "Project Settings "
-msgstr "Impostazioni Progetto"
+msgid "Project Settings (project.godot)"
+msgstr "Impostazioni Progetto (godot.cfg)"
#: editor/project_settings.cpp editor/settings_config_dialog.cpp
msgid "General"
@@ -5763,9 +5934,8 @@ msgid "AutoLoad"
msgstr "AutoLoad"
#: editor/property_editor.cpp
-#, fuzzy
msgid "Pick a Viewport"
-msgstr "1 Vista"
+msgstr "Scegli una Vista"
#: editor/property_editor.cpp
msgid "Ease In"
@@ -5804,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"
@@ -5963,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."
@@ -6006,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"
@@ -6046,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)"
@@ -6083,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:"
@@ -6131,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
@@ -6710,35 +6945,30 @@ msgid "just released"
msgstr "appena rilasciato"
#: platform/javascript/export/export.cpp
-#, fuzzy
msgid "Run in Browser"
-msgstr "Sfoglia"
+msgstr "Esegui nel Browser"
#: platform/javascript/export/export.cpp
msgid "Run exported HTML in the system's default browser."
-msgstr ""
+msgstr "Esegui HTML esportato all'interno del browser di sistema di default."
#: platform/javascript/export/export.cpp
-#, fuzzy
msgid "Could not write file:\n"
-msgstr "Impossibile trovare tile:"
+msgstr "Impossibile scrivere file:\n"
#: platform/javascript/export/export.cpp
-#, fuzzy
msgid "Could not read file:\n"
-msgstr "Impossibile trovare tile:"
+msgstr "Impossibile leggere file:\n"
#: platform/javascript/export/export.cpp
-#, fuzzy
msgid "Could not open template for export:\n"
-msgstr "Impossibile creare cartella."
+msgstr "Impossibile aprire template per l'esportazione:\n"
#: platform/uwp/export/export.cpp
-#, fuzzy
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
@@ -6918,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."
@@ -7011,12 +7241,6 @@ msgid ""
"Nothing is visible because meshes have not been assigned to draw passes."
msgstr ""
-#: scene/3d/particles.cpp
-msgid ""
-"A material to process the particles is not assigned, so no behavior is "
-"imprinted."
-msgstr ""
-
#: scene/3d/remote_transform.cpp
msgid "Path property must point to a valid Spatial node to work."
msgstr ""
@@ -7038,6 +7262,15 @@ 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!"
@@ -7082,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 ""
@@ -7101,9 +7343,64 @@ msgstr ""
#~ msgid "Import assets to the project."
#~ msgstr "Importa asset nel progetto."
-#, fuzzy
-#~ msgid "Project Settings (godot.cfg)"
-#~ msgstr "Impostazioni Progetto (engine.cfg)"
+#~ 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"
@@ -7324,9 +7621,6 @@ msgstr ""
#~ msgid "Trailing Silence:"
#~ msgstr "Silenzio di coda:"
-#~ msgid "Script"
-#~ msgstr "Script"
-
#~ msgid "Script Export Mode:"
#~ msgstr "Modalità Esportazione Script:"
@@ -7360,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"
@@ -7405,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 beeaf264a2..8fa50e4512 100644
--- a/editor/translations/ja.po
+++ b/editor/translations/ja.po
@@ -1,24 +1,24 @@
# Japanese translation of the Godot Engine editor
-# Copyright (C) 2007-2017 Juan Linietsky, Ariel Manzur
-# Copyright (C) 2014-2017 Godot Engine contributors (cf. AUTHORS.md)
+# 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.
#
# 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: 2017-01-25 08:56+0000\n"
-"Last-Translator: Lexi Grafen <shfeedly@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.11-dev\n"
+"X-Generator: Weblate 2.15-dev\n"
#: editor/animation_editor.cpp
msgid "Disabled"
@@ -42,7 +42,7 @@ msgstr ""
#: editor/animation_editor.cpp
msgid "Anim Change Value"
-msgstr ""
+msgstr "値を変更"
#: editor/animation_editor.cpp
msgid "Anim Change Call"
@@ -542,7 +542,8 @@ msgid "Search:"
msgstr "検索:"
#: editor/asset_library_editor_plugin.cpp editor/code_editor.cpp
-#: editor/editor_help.cpp editor/plugins/script_editor_plugin.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"
@@ -588,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 "コミュニティ"
@@ -691,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"
@@ -732,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 "削除"
@@ -840,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 ""
@@ -940,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 ""
@@ -951,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 ""
@@ -1019,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:"
@@ -1211,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 ""
@@ -1228,7 +1231,6 @@ msgid "Class:"
msgstr ""
#: editor/editor_help.cpp editor/scene_tree_editor.cpp
-#: editor/script_create_dialog.cpp
msgid "Inherits:"
msgstr ""
@@ -1400,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 ""
@@ -1463,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 ""
@@ -1519,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 ""
@@ -1557,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 ""
@@ -1610,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 ""
@@ -1638,35 +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"
+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
@@ -1674,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
@@ -1785,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
@@ -1806,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
@@ -1894,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 ""
@@ -1921,6 +1956,33 @@ 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
+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 "Installed Plugins:"
msgstr ""
@@ -2166,6 +2228,10 @@ msgid "Collapse all"
msgstr ""
#: editor/filesystem_dock.cpp
+msgid "Show In File Manager"
+msgstr ""
+
+#: editor/filesystem_dock.cpp
msgid "Instance"
msgstr ""
@@ -2194,10 +2260,6 @@ msgid "Info"
msgstr ""
#: editor/filesystem_dock.cpp
-msgid "Show In File Manager"
-msgstr ""
-
-#: editor/filesystem_dock.cpp
msgid "Re-Import.."
msgstr ""
@@ -2364,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
@@ -2839,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
@@ -3503,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 "決定"
@@ -3552,17 +3614,6 @@ msgstr ""
msgid "Set Handle"
msgstr ""
-#: editor/plugins/color_ramp_editor_plugin.cpp
-#: editor/plugins/gradient_texture_editor_plugin.cpp
-msgid "Add/Remove Color Ramp Point"
-msgstr ""
-
-#: editor/plugins/color_ramp_editor_plugin.cpp
-#: editor/plugins/gradient_texture_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 ""
@@ -3594,9 +3645,31 @@ 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 ""
@@ -3867,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 ""
@@ -3879,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
@@ -3890,20 +3976,33 @@ msgstr ""
msgid "Generated Point Count:"
msgstr ""
+#: editor/plugins/particles_2d_editor_plugin.cpp
#: editor/plugins/particles_editor_plugin.cpp
-msgid "Node does not contain geometry."
+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 (faces)."
+msgid "Node does not contain geometry."
msgstr ""
#: editor/plugins/particles_editor_plugin.cpp
-msgid "A processor material of type 'ParticlesMaterial' is required."
+msgid "Node does not contain geometry (faces)."
msgstr ""
#: editor/plugins/particles_editor_plugin.cpp
-msgid "Generating AABB"
+msgid "A processor material of type 'ParticlesMaterial' is required."
msgstr ""
#: editor/plugins/particles_editor_plugin.cpp
@@ -3958,12 +4057,16 @@ msgstr ""
msgid "Generate Visibility AABB"
msgstr ""
-#: editor/plugins/particles_editor_plugin.cpp
-msgid "Generation Time (sec):"
+#: editor/plugins/path_2d_editor_plugin.cpp
+msgid "Remove Point from Curve"
msgstr ""
#: editor/plugins/path_2d_editor_plugin.cpp
-msgid "Remove Point from Curve"
+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
@@ -4021,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 ""
@@ -4174,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 ""
@@ -4263,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 ""
@@ -4300,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
@@ -4364,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"
@@ -4443,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 ""
@@ -4465,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 ""
@@ -4682,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
@@ -4770,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
@@ -4814,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
@@ -4858,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 ""
@@ -5279,11 +5463,11 @@ msgid "Invalid project path, the path must exist!"
msgstr ""
#: editor/project_manager.cpp
-msgid "Invalid project path, *.godot must not exist."
+msgid "Invalid project path, project.godot must not exist."
msgstr ""
#: editor/project_manager.cpp
-msgid "Invalid project path, *.godot must exist."
+msgid "Invalid project path, project.godot must exist."
msgstr ""
#: editor/project_manager.cpp
@@ -5295,7 +5479,7 @@ msgid "Invalid project path (changed anything?)."
msgstr ""
#: editor/project_manager.cpp
-msgid "Couldn't create *.godot project file in project path."
+msgid "Couldn't create project.godot in project path."
msgstr ""
#: editor/project_manager.cpp
@@ -5512,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 "デãƒã‚¤ã‚¹"
@@ -5577,7 +5765,7 @@ msgid "Remove Resource Remap Option"
msgstr ""
#: editor/project_settings.cpp
-msgid "Project Settings "
+msgid "Project Settings (project.godot)"
msgstr ""
#: editor/project_settings.cpp editor/settings_config_dialog.cpp
@@ -5693,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 "ノードã¸ã®ãƒ‘ス:"
@@ -5884,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 ""
@@ -5959,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 ""
@@ -6007,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
@@ -6776,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."
@@ -6869,12 +7115,6 @@ msgid ""
"Nothing is visible because meshes have not been assigned to draw passes."
msgstr ""
-#: scene/3d/particles.cpp
-msgid ""
-"A material to process the particles is not assigned, so no behavior is "
-"imprinted."
-msgstr ""
-
#: scene/3d/remote_transform.cpp
#, fuzzy
msgid "Path property must point to a valid Spatial node to work."
@@ -6898,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 "警告!"
@@ -6943,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 "
@@ -6959,6 +7213,11 @@ msgstr ""
#~ 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 08b10d2f7a..ee409ab97f 100644
--- a/editor/translations/ko.po
+++ b/editor/translations/ko.po
@@ -1,6 +1,5 @@
# Korean translation of the Godot Engine editor
-# Copyright (C) 2007-2017 Juan Linietsky, Ariel Manzur
-# Copyright (C) 2014-2017 Godot Engine contributors (cf. AUTHORS.md)
+# 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-2017.
@@ -545,7 +544,8 @@ msgid "Search:"
msgstr "검색:"
#: editor/asset_library_editor_plugin.cpp editor/code_editor.cpp
-#: editor/editor_help.cpp editor/plugins/script_editor_plugin.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"
@@ -591,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 "커뮤니티"
@@ -737,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 "삭제"
@@ -846,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 "경로"
@@ -949,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 "로드"
@@ -960,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"
@@ -1030,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 "경로:"
@@ -1223,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 "ë„ì›€ë§ ê²€ìƒ‰"
@@ -1240,7 +1242,6 @@ msgid "Class:"
msgstr "í´ëž˜ìФ:"
#: editor/editor_help.cpp editor/scene_tree_editor.cpp
-#: editor/script_create_dialog.cpp
msgid "Inherits:"
msgstr "ìƒì†:"
@@ -1409,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' 항목ì—서 변경할 수 있습니다."
@@ -1472,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 "ì´ ì”¬ì€ ì €ìž¥ë˜ì§€ 않았습니다. ì‹¤í–‰ì „ì— ì €ìž¥í•˜ì‹œê² ìŠµë‹ˆê¹Œ?"
@@ -1530,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 "오우"
@@ -1570,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 "씬"
@@ -1623,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 "최근 ì—´ì—ˆë˜ í•­ëª©"
@@ -1651,84 +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 "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"
@@ -1818,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"
@@ -1840,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!"
@@ -1928,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 파ì¼ë¡œë¶€í„° í…œí”Œë¦¿ì„ ê°€ì ¸ì˜¤ê¸°"
@@ -1955,6 +1989,36 @@ 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 "ì„¤ì¹˜ëœ í”ŒëŸ¬ê·¸ì¸:"
@@ -2212,6 +2276,10 @@ msgid "Collapse all"
msgstr ""
#: editor/filesystem_dock.cpp
+msgid "Show In File Manager"
+msgstr "íŒŒì¼ ë§¤ë‹ˆì €ì—서 보기"
+
+#: editor/filesystem_dock.cpp
msgid "Instance"
msgstr "ì¸ìŠ¤í„´ìŠ¤"
@@ -2240,10 +2308,6 @@ msgid "Info"
msgstr "ì •ë³´"
#: editor/filesystem_dock.cpp
-msgid "Show In File Manager"
-msgstr "íŒŒì¼ ë§¤ë‹ˆì €ì—서 보기"
-
-#: editor/filesystem_dock.cpp
msgid "Re-Import.."
msgstr "다시 가져오기.."
@@ -2411,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 를 사용하세요."
@@ -2895,7 +2960,7 @@ msgstr "ì••ì¶•"
#: editor/io_plugins/editor_translation_import_plugin.cpp
#, fuzzy
-msgid "Add to Project (godot.cfg)"
+msgid "Add to Project (project.godot)"
msgstr "프로ì íŠ¸ì— ì¶”ê°€ (engine.cfg)"
#: editor/io_plugins/editor_translation_import_plugin.cpp
@@ -3558,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 "확ì¸"
@@ -3609,17 +3674,6 @@ msgstr "í´ë¦¬ê³¤3D 만들기"
msgid "Set Handle"
msgstr "핸들 설정"
-#: editor/plugins/color_ramp_editor_plugin.cpp
-#: editor/plugins/gradient_texture_editor_plugin.cpp
-msgid "Add/Remove Color Ramp Point"
-msgstr "ì¹¼ë¼ ëž¨í”„ í¬ì¸íЏ 추가/ì‚­ì œ"
-
-#: editor/plugins/color_ramp_editor_plugin.cpp
-#: editor/plugins/gradient_texture_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 "메쉬 ë¼ì´ë¸ŒëŸ¬ë¦¬ ìƒì„± 중"
@@ -3652,9 +3706,33 @@ 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"
@@ -3928,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 "ì´ë¯¸ì§€ 로드 ì—러:"
@@ -3940,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"
@@ -3951,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 "노드가 지오미트리를 í¬í•¨í•˜ê³  있지 않습니다."
@@ -3964,11 +4077,6 @@ msgid "A processor material of type 'ParticlesMaterial' is required."
msgstr ""
#: editor/plugins/particles_editor_plugin.cpp
-#, fuzzy
-msgid "Generating AABB"
-msgstr "AABB ìƒì„±"
-
-#: editor/plugins/particles_editor_plugin.cpp
msgid "Faces contain no area!"
msgstr "페ì´ìŠ¤ê°€ ì˜ì—­ì„ 가지고 있지 않습니다!"
@@ -4026,13 +4134,18 @@ msgstr "ì—미션 채움:"
msgid "Generate Visibility AABB"
msgstr "AABB ìƒì„±"
-#: editor/plugins/particles_editor_plugin.cpp
+#: editor/plugins/path_2d_editor_plugin.cpp
+msgid "Remove Point from Curve"
+msgstr "커브ì—서 í¬ì¸íЏ ì‚­ì œ"
+
+#: editor/plugins/path_2d_editor_plugin.cpp
#, fuzzy
-msgid "Generation Time (sec):"
-msgstr "í‰ê·  시간 (ì´ˆ)"
+msgid "Remove Out-Control from Curve"
+msgstr "ì»¤ë¸Œì˜ ì•„ì›ƒ-컨트롤 ì´ë™"
#: editor/plugins/path_2d_editor_plugin.cpp
-msgid "Remove Point from Curve"
+#, fuzzy
+msgid "Remove In-Control from Curve"
msgstr "커브ì—서 í¬ì¸íЏ ì‚­ì œ"
#: editor/plugins/path_2d_editor_plugin.cpp
@@ -4090,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 맵 만들기"
@@ -4243,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 "테마 저장 중 ì—러"
@@ -4330,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 "한 ë‹¨ê³„ì‹ ì½”ë“œ 실행"
@@ -4367,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."
@@ -4433,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"
@@ -4512,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 "ì´ì „ 찾기"
@@ -4534,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 ìƒìˆ˜ 변경"
@@ -4751,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
+#, fuzzy
+msgid "View Environment"
+msgstr "환경"
+
+#: editor/plugins/spatial_editor_plugin.cpp
+#, fuzzy
+msgid "View Gizmos"
+msgstr "기즈모"
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "No scene selected to instance!"
-msgstr "ì¸ìŠ¤í„´ìŠ¤í•  ì”¬ì´ ì„ íƒë˜ì§€ 않았습니다!"
+msgid "View Information"
+msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Instance at Cursor"
-msgstr "ì»¤ì„œì— ì¸ìŠ¤í„´ìŠ¤ 만들기"
+msgid "Audio Listener"
+msgstr "오디오 리스너"
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Could not instance scene!"
-msgstr "ì”¬ì„ ì¸ìŠ¤í„´ìŠ¤ í•  수 없습니다!"
+msgid "XForm Dialog"
+msgstr "변환 다ì´ì–¼ë¡œê·¸"
#: editor/plugins/spatial_editor_plugin.cpp
msgid "Move Mode (W)"
@@ -4839,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 "변환"
@@ -4851,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ê°œ ë·°í¬íЏ"
@@ -4883,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 "ì›ì  보기"
@@ -4907,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 "스냅 설정"
@@ -4927,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 "ì›ê·¼ 시야 (ë„):"
@@ -5361,12 +5571,12 @@ msgstr "프로ì íЏ 경로가 유효하지 않습니다. 경로가 반드시 ì¡
#: editor/project_manager.cpp
#, fuzzy
-msgid "Invalid project path, *.godot must not exist."
+msgid "Invalid project path, project.godot must not exist."
msgstr "프로ì íЏ 경로가 유효하지 않습니다. engine.cfgê°€ 있으면 안ë©ë‹ˆë‹¤."
#: editor/project_manager.cpp
#, fuzzy
-msgid "Invalid project path, *.godot must exist."
+msgid "Invalid project path, project.godot must exist."
msgstr "프로ì íЏ 경로가 유효하지 않습니다. engine.cfgê°€ 존재해야합니다."
#: editor/project_manager.cpp
@@ -5379,7 +5589,7 @@ msgstr "유효하지 ì•Šì€ í”„ë¡œì íЏ 경로 (뭔가 변경하신 ê±°ë¼ë„?)
#: editor/project_manager.cpp
#, fuzzy
-msgid "Couldn't create *.godot project file in project path."
+msgid "Couldn't create project.godot in project path."
msgstr "프로ì íЏ ê²½ë¡œì— engine.cfg를 ìƒì„±í•  수 없습니다."
#: editor/project_manager.cpp
@@ -5599,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 "기기"
@@ -5665,8 +5880,8 @@ msgstr "리소스 리맵핑 옵션 제거"
#: editor/project_settings.cpp
#, fuzzy
-msgid "Project Settings "
-msgstr "프로ì íЏ 설정"
+msgid "Project Settings (project.godot)"
+msgstr "프로ì íЏ 설정 (engine.cfg)"
#: editor/project_settings.cpp editor/settings_config_dialog.cpp
msgid "General"
@@ -5783,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 "노드 ì„ íƒ"
@@ -5973,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 "그룹 편집"
@@ -6049,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 "유효하지 ì•Šì€ ë…¸ë“œ ì´ë¦„입니다. 다ìŒì˜ 문ìžëŠ” 허용ë˜ì§€ 않습니다:"
@@ -6097,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
@@ -6846,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."
@@ -6933,12 +7218,6 @@ msgid ""
"Nothing is visible because meshes have not been assigned to draw passes."
msgstr ""
-#: scene/3d/particles.cpp
-msgid ""
-"A material to process the particles is not assigned, so no behavior is "
-"imprinted."
-msgstr ""
-
#: scene/3d/remote_transform.cpp
msgid "Path property must point to a valid Spatial node to work."
msgstr "Path ì†ì„±ì€ 유효한 Spatial 노드를 가리켜야 합니다."
@@ -6956,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 "경고!"
@@ -7000,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 "
@@ -7018,9 +7312,62 @@ msgstr ""
#~ msgid "Import assets to the project."
#~ msgstr "프로ì íŠ¸ë¡œ ì—ì…‹ 가져오기."
-#, fuzzy
-#~ msgid "Project Settings (godot.cfg)"
-#~ msgstr "프로ì íЏ 설정 (engine.cfg)"
+#~ 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 "출사면"
@@ -7216,9 +7563,6 @@ msgstr ""
#~ msgid "Trailing Silence:"
#~ msgstr "ëì˜ ë¬´ìŒ:"
-#~ msgid "Script"
-#~ msgstr "스í¬ë¦½íЏ"
-
#~ msgid "Script Export Mode:"
#~ msgstr "스í¬ë¦½íЏ 내보내기 모드:"
@@ -7252,9 +7596,6 @@ msgstr ""
#~ msgid "BakedLightInstance does not contain a BakedLight resource."
#~ msgstr "BakedLightInstance가 BakedLight 리소스를 가지고 있지 않습니다."
-#~ msgid "Vertex"
-#~ msgstr "버í…스"
-
#~ msgid "Fragment"
#~ msgstr "프래그먼트"
@@ -7290,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 7ce577ebfa..3e522bbe49 100644
--- a/editor/translations/nb.po
+++ b/editor/translations/nb.po
@@ -1,6 +1,5 @@
# Norwegian Bokmål translation of the Godot Engine editor
-# Copyright (C) 2007-2017 Juan Linietsky, Ariel Manzur
-# Copyright (C) 2014-2017 Godot Engine contributors (cf. AUTHORS.md)
+# 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.
@@ -9,7 +8,7 @@
msgid ""
msgstr ""
"Project-Id-Version: Godot Engine editor\n"
-"PO-Revision-Date: 2017-04-06 17:20+0000\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"
@@ -21,7 +20,7 @@ msgstr ""
#: editor/animation_editor.cpp
msgid "Disabled"
-msgstr ""
+msgstr "Avslått"
#: editor/animation_editor.cpp
msgid "All Selection"
@@ -29,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"
@@ -41,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"
@@ -81,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"
@@ -89,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"
@@ -141,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"
@@ -366,8 +365,9 @@ msgid "Version:"
msgstr ""
#: editor/asset_library_editor_plugin.cpp
+#, fuzzy
msgid "Contents:"
-msgstr ""
+msgstr "Kontinuerlig"
#: editor/asset_library_editor_plugin.cpp
msgid "View Files"
@@ -533,7 +533,8 @@ msgid "Search:"
msgstr ""
#: editor/asset_library_editor_plugin.cpp editor/code_editor.cpp
-#: editor/editor_help.cpp editor/plugins/script_editor_plugin.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"
@@ -579,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 ""
@@ -722,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 ""
@@ -827,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 ""
@@ -927,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 ""
@@ -938,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 ""
@@ -1006,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 ""
@@ -1198,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 ""
@@ -1215,7 +1218,6 @@ msgid "Class:"
msgstr ""
#: editor/editor_help.cpp editor/scene_tree_editor.cpp
-#: editor/script_create_dialog.cpp
msgid "Inherits:"
msgstr ""
@@ -1385,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
@@ -1440,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 ""
@@ -1496,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 ""
@@ -1534,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 ""
@@ -1586,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 ""
@@ -1614,35 +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"
+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
@@ -1650,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
@@ -1761,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"
@@ -1782,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
@@ -1870,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 ""
@@ -1897,6 +1928,30 @@ 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
+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 ""
@@ -2140,6 +2195,10 @@ msgid "Collapse all"
msgstr ""
#: editor/filesystem_dock.cpp
+msgid "Show In File Manager"
+msgstr ""
+
+#: editor/filesystem_dock.cpp
msgid "Instance"
msgstr ""
@@ -2168,10 +2227,6 @@ msgid "Info"
msgstr ""
#: editor/filesystem_dock.cpp
-msgid "Show In File Manager"
-msgstr ""
-
-#: editor/filesystem_dock.cpp
msgid "Re-Import.."
msgstr ""
@@ -2337,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
@@ -2812,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
@@ -3472,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 ""
@@ -3521,17 +3576,6 @@ msgstr ""
msgid "Set Handle"
msgstr ""
-#: editor/plugins/color_ramp_editor_plugin.cpp
-#: editor/plugins/gradient_texture_editor_plugin.cpp
-msgid "Add/Remove Color Ramp Point"
-msgstr ""
-
-#: editor/plugins/color_ramp_editor_plugin.cpp
-#: editor/plugins/gradient_texture_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 ""
@@ -3563,9 +3607,31 @@ 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 ""
@@ -3835,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 ""
@@ -3847,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
@@ -3858,20 +3937,33 @@ msgstr ""
msgid "Generated Point Count:"
msgstr ""
+#: editor/plugins/particles_2d_editor_plugin.cpp
#: editor/plugins/particles_editor_plugin.cpp
-msgid "Node does not contain geometry."
+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 (faces)."
+msgid "Node does not contain geometry."
msgstr ""
#: editor/plugins/particles_editor_plugin.cpp
-msgid "A processor material of type 'ParticlesMaterial' is required."
+msgid "Node does not contain geometry (faces)."
msgstr ""
#: editor/plugins/particles_editor_plugin.cpp
-msgid "Generating AABB"
+msgid "A processor material of type 'ParticlesMaterial' is required."
msgstr ""
#: editor/plugins/particles_editor_plugin.cpp
@@ -3926,12 +4018,16 @@ msgstr ""
msgid "Generate Visibility AABB"
msgstr ""
-#: editor/plugins/particles_editor_plugin.cpp
-msgid "Generation Time (sec):"
+#: editor/plugins/path_2d_editor_plugin.cpp
+msgid "Remove Point from Curve"
msgstr ""
#: editor/plugins/path_2d_editor_plugin.cpp
-msgid "Remove Point from Curve"
+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
@@ -3989,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 ""
@@ -4142,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 ""
@@ -4229,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 ""
@@ -4266,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
@@ -4329,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"
@@ -4408,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 ""
@@ -4430,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 ""
@@ -4647,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 "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
@@ -4735,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 "Local Coords"
msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Use Default sRGB"
+msgid "Transform Dialog.."
msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
@@ -4779,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
@@ -4823,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 ""
@@ -5243,11 +5418,11 @@ msgid "Invalid project path, the path must exist!"
msgstr ""
#: editor/project_manager.cpp
-msgid "Invalid project path, *.godot must not exist."
+msgid "Invalid project path, project.godot must not exist."
msgstr ""
#: editor/project_manager.cpp
-msgid "Invalid project path, *.godot must exist."
+msgid "Invalid project path, project.godot must exist."
msgstr ""
#: editor/project_manager.cpp
@@ -5259,7 +5434,7 @@ msgid "Invalid project path (changed anything?)."
msgstr ""
#: editor/project_manager.cpp
-msgid "Couldn't create *.godot project file in project path."
+msgid "Couldn't create project.godot in project path."
msgstr ""
#: editor/project_manager.cpp
@@ -5475,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 ""
@@ -5540,7 +5719,7 @@ msgid "Remove Resource Remap Option"
msgstr ""
#: editor/project_settings.cpp
-msgid "Project Settings "
+msgid "Project Settings (project.godot)"
msgstr ""
#: editor/project_settings.cpp editor/settings_config_dialog.cpp
@@ -5656,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
#, fuzzy
msgid "Pick a Node"
msgstr "Lim inn Noder"
@@ -5845,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 ""
@@ -5920,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 ""
@@ -5968,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 "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 ": Ugyldige argumenter: "
+
+#: 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
@@ -6693,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
@@ -6762,12 +6998,6 @@ msgid ""
"Nothing is visible because meshes have not been assigned to draw passes."
msgstr ""
-#: scene/3d/particles.cpp
-msgid ""
-"A material to process the particles is not assigned, so no behavior is "
-"imprinted."
-msgstr ""
-
#: scene/3d/remote_transform.cpp
msgid "Path property must point to a valid Spatial node to work."
msgstr ""
@@ -6783,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 ""
@@ -6825,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
index f0d54ebd9d..212397fd88 100644
--- a/editor/translations/nl.po
+++ b/editor/translations/nl.po
@@ -1,6 +1,5 @@
# Dutch translation of the Godot Engine editor
-# Copyright (C) 2007-2017 Juan Linietsky, Ariel Manzur
-# Copyright (C) 2014-2017 Godot Engine contributors (cf. AUTHORS.md)
+# 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
@@ -8,7 +7,7 @@
msgid ""
msgstr ""
"Project-Id-Version: Godot Engine editor\n"
-"PO-Revision-Date: 2017-04-06 20:13+0000\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"
@@ -16,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.13-dev\n"
+"X-Generator: Weblate 2.14-dev\n"
#: editor/animation_editor.cpp
msgid "Disabled"
@@ -542,7 +541,8 @@ msgid "Search:"
msgstr "Zoeken:"
#: editor/asset_library_editor_plugin.cpp editor/code_editor.cpp
-#: editor/editor_help.cpp editor/plugins/script_editor_plugin.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"
@@ -588,7 +588,7 @@ msgstr "Ondersteuning.."
msgid "Official"
msgstr "Officieel"
-#: editor/asset_library_editor_plugin.cpp
+#: editor/asset_library_editor_plugin.cpp editor/editor_node.cpp
msgid "Community"
msgstr "Gemeenschap"
@@ -735,6 +735,7 @@ 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"
@@ -845,6 +846,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 "Pad"
@@ -936,33 +938,33 @@ msgstr "Verwijder"
#: editor/editor_audio_buses.cpp
msgid "Save Audio Bus Layout As.."
-msgstr ""
+msgstr "Sla Audio Bus Layout Op Als.."
#: editor/editor_audio_buses.cpp
msgid "Location for New Layout.."
-msgstr ""
+msgstr "Locatie voor Nieuwe Layout.."
#: editor/editor_audio_buses.cpp
msgid "Open Audio Bus Layout"
-msgstr ""
+msgstr "Open Audio Bus Layout"
#: editor/editor_audio_buses.cpp
msgid "Add Bus"
-msgstr ""
+msgstr "Bus Toevoegen"
-#: 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 "Laden"
#: editor/editor_audio_buses.cpp
#: editor/plugins/animation_player_editor_plugin.cpp
msgid "Save As"
-msgstr ""
+msgstr "Opslaan Als"
#: editor/editor_audio_buses.cpp editor/editor_node.cpp editor/import_dock.cpp
+#: editor/script_create_dialog.cpp
msgid "Default"
-msgstr ""
+msgstr "Standaard"
#: editor/editor_autoload_settings.cpp
msgid "Invalid name."
@@ -1032,8 +1034,7 @@ msgid "Rearrange Autoloads"
msgstr "Herschik 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 "Pad:"
@@ -1103,7 +1104,7 @@ msgstr "Inpakken"
#: editor/editor_export.cpp platform/javascript/export/export.cpp
msgid "Template file not found:\n"
-msgstr ""
+msgstr "Template bestand niet gevonden:\n"
#: editor/editor_export.cpp
msgid "Added:"
@@ -1228,7 +1229,8 @@ msgstr "Scan Bronnen"
msgid "(Re)Importing Assets"
msgstr "Aan Het Herimporteren"
-#: 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 "Zoek Hulp"
@@ -1245,7 +1247,6 @@ msgid "Class:"
msgstr "Klasse:"
#: editor/editor_help.cpp editor/scene_tree_editor.cpp
-#: editor/script_create_dialog.cpp
msgid "Inherits:"
msgstr "Erft:"
@@ -1353,23 +1354,23 @@ msgstr "Mislukt om resource te laden."
#: editor/editor_node.cpp
msgid "Can't load MeshLibrary for merging!"
-msgstr ""
+msgstr "Kan MeshLibrary niet laden om te samenvoegen!"
#: editor/editor_node.cpp
msgid "Error saving MeshLibrary!"
-msgstr ""
+msgstr "Error bij het opslaan van MeshLibrary!"
#: editor/editor_node.cpp
msgid "Can't load TileSet for merging!"
-msgstr ""
+msgstr "Kan TileSet niet laden om te samenvoegen!"
#: editor/editor_node.cpp
msgid "Error saving TileSet!"
-msgstr ""
+msgstr "Error bij het opslaan van TileSet!"
#: editor/editor_node.cpp
msgid "Error trying to save layout!"
-msgstr ""
+msgstr "Error bij het opslaan van layout!"
#: editor/editor_node.cpp
msgid "Default editor layout overridden."
@@ -1418,8 +1419,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
@@ -1473,6 +1474,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 ""
@@ -1529,7 +1534,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 ""
@@ -1567,6 +1572,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 ""
@@ -1619,7 +1628,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 ""
@@ -1647,35 +1656,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"
+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
@@ -1683,47 +1680,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
@@ -1794,9 +1759,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 "Bewerken"
#: editor/editor_node.cpp editor/settings_config_dialog.cpp
msgid "Editor Settings"
@@ -1815,11 +1781,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
@@ -1903,6 +1925,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 ""
@@ -1930,6 +1960,34 @@ msgstr ""
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 ""
@@ -2176,6 +2234,10 @@ msgid "Collapse all"
msgstr ""
#: editor/filesystem_dock.cpp
+msgid "Show In File Manager"
+msgstr ""
+
+#: editor/filesystem_dock.cpp
msgid "Instance"
msgstr ""
@@ -2204,10 +2266,6 @@ msgid "Info"
msgstr ""
#: editor/filesystem_dock.cpp
-msgid "Show In File Manager"
-msgstr ""
-
-#: editor/filesystem_dock.cpp
msgid "Re-Import.."
msgstr ""
@@ -2376,7 +2434,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
@@ -2851,7 +2909,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
@@ -3512,7 +3570,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é"
@@ -3561,17 +3619,6 @@ msgstr ""
msgid "Set Handle"
msgstr ""
-#: editor/plugins/color_ramp_editor_plugin.cpp
-#: editor/plugins/gradient_texture_editor_plugin.cpp
-msgid "Add/Remove Color Ramp Point"
-msgstr ""
-
-#: editor/plugins/color_ramp_editor_plugin.cpp
-#: editor/plugins/gradient_texture_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 ""
@@ -3603,9 +3650,32 @@ 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 ""
@@ -3876,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 ""
@@ -3888,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
@@ -3899,20 +3982,33 @@ msgstr ""
msgid "Generated Point Count:"
msgstr ""
+#: editor/plugins/particles_2d_editor_plugin.cpp
#: editor/plugins/particles_editor_plugin.cpp
-msgid "Node does not contain geometry."
+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 (faces)."
+msgid "Node does not contain geometry."
msgstr ""
#: editor/plugins/particles_editor_plugin.cpp
-msgid "A processor material of type 'ParticlesMaterial' is required."
+msgid "Node does not contain geometry (faces)."
msgstr ""
#: editor/plugins/particles_editor_plugin.cpp
-msgid "Generating AABB"
+msgid "A processor material of type 'ParticlesMaterial' is required."
msgstr ""
#: editor/plugins/particles_editor_plugin.cpp
@@ -3967,12 +4063,16 @@ msgstr ""
msgid "Generate Visibility AABB"
msgstr ""
-#: editor/plugins/particles_editor_plugin.cpp
-msgid "Generation Time (sec):"
+#: editor/plugins/path_2d_editor_plugin.cpp
+msgid "Remove Point from Curve"
msgstr ""
#: editor/plugins/path_2d_editor_plugin.cpp
-msgid "Remove Point from Curve"
+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
@@ -4030,6 +4130,15 @@ msgstr ""
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 ""
@@ -4183,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 ""
@@ -4270,10 +4383,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 ""
@@ -4307,15 +4416,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
@@ -4371,6 +4472,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"
@@ -4450,6 +4567,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 "Verbind Aan Node:"
+
+#: editor/plugins/script_text_editor.cpp
#: editor/plugins/shader_editor_plugin.cpp
msgid "Find Previous"
msgstr ""
@@ -4472,6 +4598,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 ""
@@ -4689,35 +4819,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 "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 "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
@@ -4777,23 +4972,32 @@ msgid "Align Selection With View"
msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Transform"
+#, fuzzy
+msgid "Tool Select"
+msgstr "Alle Selectie"
+
+#: 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
@@ -4821,27 +5025,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
@@ -4865,14 +5057,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 ""
@@ -5289,11 +5473,11 @@ msgid "Invalid project path, the path must exist!"
msgstr ""
#: editor/project_manager.cpp
-msgid "Invalid project path, *.godot must not exist."
+msgid "Invalid project path, project.godot must not exist."
msgstr ""
#: editor/project_manager.cpp
-msgid "Invalid project path, *.godot must exist."
+msgid "Invalid project path, project.godot must exist."
msgstr ""
#: editor/project_manager.cpp
@@ -5305,7 +5489,7 @@ msgid "Invalid project path (changed anything?)."
msgstr ""
#: editor/project_manager.cpp
-msgid "Couldn't create *.godot project file in project path."
+msgid "Couldn't create project.godot in project path."
msgstr ""
#: editor/project_manager.cpp
@@ -5522,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 "Apparaat"
@@ -5587,7 +5775,7 @@ msgid "Remove Resource Remap Option"
msgstr ""
#: editor/project_settings.cpp
-msgid "Project Settings "
+msgid "Project Settings (project.godot)"
msgstr ""
#: editor/project_settings.cpp editor/settings_config_dialog.cpp
@@ -5703,10 +5891,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 "Plak Nodes"
@@ -5892,6 +6076,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 ""
@@ -5967,10 +6156,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 "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 ""
@@ -6015,75 +6251,90 @@ 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 "Map kon niet gemaakt worden."
#: 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 "Ongeldig Pad."
#: 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"
-msgstr ""
+#, fuzzy
+msgid "Invalid inherited parent name or path"
+msgstr "Ongeldige index eigenschap naam."
#: 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"
-msgstr ""
+#, fuzzy
+msgid "Create new script file"
+msgstr "Subscriptie Maken"
#: 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 "Erft:"
+
+#: editor/script_create_dialog.cpp
+#, fuzzy
+msgid "Class Name"
+msgstr "Klasse:"
#: editor/script_create_dialog.cpp
-msgid "Built-In Script"
+#, fuzzy
+msgid "Template"
+msgstr "Verwijder Selectie"
+
+#: editor/script_create_dialog.cpp
+msgid "Built-in Script"
msgstr ""
#: editor/script_create_dialog.cpp
@@ -6795,11 +7046,11 @@ msgstr ""
"ParallaxLayer node werkt alleen wanneer het een kind is van een "
"ParallaxBackground node."
-#: 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 eigenschap moet verwijzen naar een geldige Particles2D node om te "
-"werken."
#: scene/2d/path_2d.cpp
msgid "PathFollow2D only works when set as a child of a Path2D node."
@@ -6885,12 +7136,6 @@ msgid ""
"Nothing is visible because meshes have not been assigned to draw passes."
msgstr ""
-#: scene/3d/particles.cpp
-msgid ""
-"A material to process the particles is not assigned, so no behavior is "
-"imprinted."
-msgstr ""
-
#: scene/3d/remote_transform.cpp
msgid "Path property must point to a valid Spatial node to work."
msgstr ""
@@ -6911,6 +7156,14 @@ 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!"
@@ -6956,6 +7209,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 "
@@ -6971,6 +7230,11 @@ msgstr ""
#~ 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."
diff --git a/editor/translations/pl.po b/editor/translations/pl.po
index ccee170c57..79dc614836 100644
--- a/editor/translations/pl.po
+++ b/editor/translations/pl.po
@@ -1,6 +1,5 @@
# Polish translation of the Godot Engine editor
-# Copyright (C) 2007-2017 Juan Linietsky, Ariel Manzur
-# Copyright (C) 2014-2017 Godot Engine contributors (cf. AUTHORS.md)
+# 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.
#
# 8-bit Pixel <dawdejw@gmail.com>, 2016.
@@ -9,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.
@@ -16,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"
@@ -25,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"
@@ -65,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"
@@ -104,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"
@@ -127,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"
@@ -139,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"
@@ -148,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"
@@ -213,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"
@@ -241,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"
@@ -265,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."
@@ -310,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"
@@ -318,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"
@@ -330,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?"
@@ -338,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"
@@ -430,7 +439,7 @@ msgstr "Połącz.."
#: editor/asset_library_editor_plugin.cpp
#, fuzzy
msgid "Can't connect to host:"
-msgstr "Podłączanie Do Węzła:"
+msgstr "Podłącz do węzła:"
#: editor/asset_library_editor_plugin.cpp
msgid "No response from host:"
@@ -520,7 +529,7 @@ msgstr ""
#: editor/asset_library_editor_plugin.cpp
#, fuzzy
msgid "Download Error"
-msgstr "Wczytaj błędy"
+msgstr "Pobierz"
#: editor/asset_library_editor_plugin.cpp
msgid "Download for this asset is already in progress!"
@@ -554,7 +563,8 @@ msgid "Search:"
msgstr "Szukaj:"
#: editor/asset_library_editor_plugin.cpp editor/code_editor.cpp
-#: editor/editor_help.cpp editor/plugins/script_editor_plugin.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"
@@ -600,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ść"
@@ -609,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':"
@@ -730,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
@@ -744,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ń"
@@ -785,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.."
@@ -829,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"
@@ -850,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"
@@ -896,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"
@@ -938,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"
@@ -964,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"
@@ -997,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"
@@ -1006,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"
@@ -1018,7 +1040,7 @@ msgstr ""
#: editor/editor_autoload_settings.cpp
msgid "Move Autoload"
-msgstr ""
+msgstr "Przemieść Autoload"
#: editor/editor_autoload_settings.cpp
msgid "Remove Autoload"
@@ -1030,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:"
@@ -1070,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
@@ -1094,7 +1115,7 @@ msgstr "Wybierz"
#: editor/editor_export.cpp
msgid "Storing File:"
-msgstr "Zapisywanie Pliku:"
+msgstr "Zapisywanie pliku:"
#: editor/editor_export.cpp
msgid "Packing"
@@ -1102,7 +1123,7 @@ msgstr "Pakowanie"
#: 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:"
@@ -1186,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"
@@ -1226,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"
@@ -1243,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:"
@@ -1261,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:"
@@ -1282,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"
@@ -1367,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"
@@ -1404,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"
@@ -1415,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\"."
@@ -1480,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?"
@@ -1532,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"
@@ -1562,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"
@@ -1580,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"
@@ -1611,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.."
@@ -1633,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"
@@ -1661,84 +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 "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 "Export the project to many platforms."
-msgstr "Eksportuj projekt na inne platformy."
+msgid "Project Settings"
+msgstr "Ustawienia projektu"
+
+#: editor/editor_node.cpp
+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"
@@ -1754,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 ""
@@ -1824,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"
@@ -1834,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
@@ -1844,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!"
@@ -1867,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"
@@ -1876,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."
@@ -1920,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"
@@ -1935,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"
@@ -1962,6 +2021,36 @@ 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:"
@@ -2029,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"
@@ -2096,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
@@ -2109,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."
@@ -2117,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
@@ -2135,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:"
@@ -2145,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
@@ -2153,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
@@ -2173,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!"
@@ -2185,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."
@@ -2203,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:"
@@ -2215,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"
@@ -2250,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.."
@@ -2298,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
@@ -2344,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
@@ -2415,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."
@@ -2466,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
@@ -2500,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!"
@@ -2554,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"
@@ -2677,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"
@@ -2769,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"
@@ -2825,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:"
@@ -2849,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!"
@@ -2906,7 +2996,7 @@ msgstr "Skompresuj"
#: editor/io_plugins/editor_translation_import_plugin.cpp
#, fuzzy
-msgid "Add to Project (godot.cfg)"
+msgid "Add to Project (project.godot)"
msgstr "Dodaj do projektu (engine.cfg)"
#: editor/io_plugins/editor_translation_import_plugin.cpp
@@ -2995,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"
@@ -3015,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)"
@@ -3043,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"
@@ -3095,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"
@@ -3141,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!"
@@ -3150,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:"
@@ -3194,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"
@@ -3242,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.."
@@ -3311,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
@@ -3396,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."
@@ -3437,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"
@@ -3536,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
@@ -3545,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"
@@ -3553,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
@@ -3573,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"
@@ -3582,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
@@ -3612,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"
@@ -3622,20 +3717,9 @@ msgstr ""
msgid "Set Handle"
msgstr ""
-#: editor/plugins/color_ramp_editor_plugin.cpp
-#: editor/plugins/gradient_texture_editor_plugin.cpp
-msgid "Add/Remove Color Ramp Point"
-msgstr ""
-
-#: editor/plugins/color_ramp_editor_plugin.cpp
-#: editor/plugins/gradient_texture_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.."
@@ -3665,9 +3749,33 @@ 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"
@@ -3697,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
@@ -3762,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"
@@ -3918,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"
@@ -3941,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:"
@@ -3950,44 +4072,60 @@ 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 ""
+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
-#, fuzzy
-msgid "Generating AABB"
-msgstr "Generuj AABB"
-
-#: 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"
@@ -3995,11 +4133,11 @@ msgstr "Generuj AABB"
#: editor/plugins/particles_editor_plugin.cpp
msgid "Create Emission Points From Mesh"
-msgstr ""
+msgstr "Twórz punkty emisji z siatki"
#: editor/plugins/particles_editor_plugin.cpp
msgid "Create Emission Points From Node"
-msgstr ""
+msgstr "Twórz punkty emisji z węzła"
#: editor/plugins/particles_editor_plugin.cpp
msgid "Clear Emitter"
@@ -4011,7 +4149,7 @@ msgstr "Utwórz Emiter"
#: editor/plugins/particles_editor_plugin.cpp
msgid "Emission Points:"
-msgstr ""
+msgstr "Punkty emisji:"
#: editor/plugins/particles_editor_plugin.cpp
#, fuzzy
@@ -4028,30 +4166,35 @@ msgstr "Głośność"
#: editor/plugins/particles_editor_plugin.cpp
msgid "Emission Source: "
-msgstr ""
+msgstr "Źródła emisji: "
#: editor/plugins/particles_editor_plugin.cpp
#, fuzzy
msgid "Generate Visibility AABB"
msgstr "Generuj AABB"
-#: editor/plugins/particles_editor_plugin.cpp
+#: editor/plugins/path_2d_editor_plugin.cpp
+msgid "Remove Point from Curve"
+msgstr "Usuń punkt z krzywej"
+
+#: editor/plugins/path_2d_editor_plugin.cpp
#, fuzzy
-msgid "Generation Time (sec):"
-msgstr "Åšredni Czas (sek)"
+msgid "Remove Out-Control from Curve"
+msgstr "Usuń punkt z krzywej"
#: editor/plugins/path_2d_editor_plugin.cpp
-msgid "Remove Point from Curve"
-msgstr ""
+#, 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"
@@ -4081,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"
@@ -4099,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"
@@ -4154,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"
@@ -4183,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
@@ -4200,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:"
@@ -4208,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!"
@@ -4216,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"
@@ -4252,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"
@@ -4297,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"
@@ -4340,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"
@@ -4377,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."
@@ -4394,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."
@@ -4418,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"
@@ -4435,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
@@ -4442,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"
@@ -4481,15 +4652,15 @@ 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 ""
+msgstr "Przytnij końcowe spacje"
#: editor/plugins/script_text_editor.cpp
msgid "Convert Indent To Spaces"
@@ -4501,7 +4672,7 @@ msgstr ""
#: editor/plugins/script_text_editor.cpp
msgid "Auto Indent"
-msgstr ""
+msgstr "Automatyczne wcięcie"
#: editor/plugins/script_text_editor.cpp
#: modules/visual_script/visual_script_editor.cpp
@@ -4521,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"
@@ -4543,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"
@@ -4669,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."
@@ -4697,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"
@@ -4729,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"
@@ -4737,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)."
@@ -4760,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
-msgid "No scene selected to instance!"
+#, 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
+#, 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)"
@@ -4801,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"
@@ -4837,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 "Local Coords"
+msgstr "Koordynaty lokalne"
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Use Default sRGB"
-msgstr "Użyj domyślnie sRGB"
+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"
@@ -4969,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"
@@ -4985,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"
@@ -5005,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"
@@ -5025,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)"
@@ -5037,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>"
@@ -5057,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:"
@@ -5077,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"
@@ -5085,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:"
@@ -5111,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"
@@ -5123,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"
@@ -5138,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"
@@ -5196,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"
@@ -5204,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"
@@ -5256,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:"
@@ -5299,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.."
@@ -5316,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
@@ -5336,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
@@ -5354,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
@@ -5367,12 +5619,12 @@ msgstr "Niepoprawna ścieżka projektu, ścieżka musi istnieć!"
#: editor/project_manager.cpp
#, fuzzy
-msgid "Invalid project path, *.godot must not exist."
+msgid "Invalid project path, project.godot must not exist."
msgstr "Niepoprawna ścieżka projektu, engine.cfg nie może istnieć."
#: editor/project_manager.cpp
#, fuzzy
-msgid "Invalid project path, *.godot must exist."
+msgid "Invalid project path, project.godot must exist."
msgstr "Niepoprawna ścieżka projektu, engine.cfg musi istnieć."
#: editor/project_manager.cpp
@@ -5385,12 +5637,12 @@ msgstr "Niepoprawna ścieżka projektu (zmienić cokolwiek?)."
#: editor/project_manager.cpp
#, fuzzy
-msgid "Couldn't create *.godot project file in project path."
+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!"
@@ -5430,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"
@@ -5446,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"
@@ -5513,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
@@ -5536,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.."
@@ -5544,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"
@@ -5560,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"
@@ -5598,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"
@@ -5642,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"
@@ -5658,20 +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
#, fuzzy
-msgid "Project Settings "
-msgstr "Ustawienia projektu"
+msgid "Project Settings (project.godot)"
+msgstr "Ustawienia projektu (engine.cfg)"
#: editor/project_settings.cpp editor/settings_config_dialog.cpp
msgid "General"
@@ -5691,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:"
@@ -5719,7 +5978,7 @@ msgstr "Tłumaczenia:"
#: editor/project_settings.cpp
msgid "Remaps"
-msgstr ""
+msgstr "Mapowanie zasobów"
#: editor/project_settings.cpp
msgid "Resources:"
@@ -5727,19 +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 ""
+msgstr "Autoładowanie"
#: editor/property_editor.cpp
msgid "Pick a Viewport"
-msgstr ""
+msgstr "Wybierz Viewport"
#: editor/property_editor.cpp
msgid "Ease In"
@@ -5771,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
@@ -5788,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ł"
@@ -5802,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"
@@ -5814,7 +6069,7 @@ msgstr "Właściwości:"
#: editor/property_editor.cpp
msgid "Sections:"
-msgstr ""
+msgstr "Kategorie:"
#: editor/property_selector.cpp
#, fuzzy
@@ -5828,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"
@@ -5867,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"
@@ -5892,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"
@@ -5959,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)"
@@ -5983,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"
@@ -5995,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"
@@ -6012,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"
@@ -6042,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
@@ -6062,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:"
@@ -6083,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
@@ -6111,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
@@ -6760,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)."
@@ -6791,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 ""
@@ -6849,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!"
@@ -6883,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."
@@ -6972,12 +7300,6 @@ msgid ""
"Nothing is visible because meshes have not been assigned to draw passes."
msgstr ""
-#: scene/3d/particles.cpp
-msgid ""
-"A material to process the particles is not assigned, so no behavior is "
-"imprinted."
-msgstr ""
-
#: scene/3d/remote_transform.cpp
#, fuzzy
msgid "Path property must point to a valid Spatial node to work."
@@ -6999,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!"
@@ -7043,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 ""
@@ -7062,9 +7403,61 @@ msgstr ""
#~ 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 "Project Settings (godot.cfg)"
-#~ msgstr "Ustawienia projektu (engine.cfg)"
+#~ 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"
@@ -7210,9 +7603,6 @@ msgstr ""
#~ msgid "Trim"
#~ msgstr "Przytnij"
-#~ msgid "Script"
-#~ msgstr "Skrypt"
-
#~ msgid "Script Export Mode:"
#~ msgstr "Tryb eksportu skryptów:"
@@ -7243,9 +7633,6 @@ msgstr ""
#~ msgid "Export Preset:"
#~ msgstr "Szablon eksportu:"
-#~ msgid "Vertex"
-#~ msgstr "Wierzchołek"
-
#~ msgid "Global"
#~ msgstr "Globalne"
@@ -7271,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 4629c24f45..905c263061 100644
--- a/editor/translations/pr.po
+++ b/editor/translations/pr.po
@@ -1,6 +1,5 @@
# Pirate translation of the Godot Engine editor
-# Copyright (C) 2007-2017 Juan Linietsky, Ariel Manzur
-# Copyright (C) 2014-2017 Godot Engine contributors (cf. AUTHORS.md)
+# 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-2017.
@@ -532,7 +531,8 @@ msgid "Search:"
msgstr ""
#: editor/asset_library_editor_plugin.cpp editor/code_editor.cpp
-#: editor/editor_help.cpp editor/plugins/script_editor_plugin.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"
@@ -578,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 ""
@@ -721,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 ""
@@ -826,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 ""
@@ -926,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 ""
@@ -937,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 ""
@@ -1005,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 ""
@@ -1197,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 ""
@@ -1214,7 +1216,6 @@ msgid "Class:"
msgstr ""
#: editor/editor_help.cpp editor/scene_tree_editor.cpp
-#: editor/script_create_dialog.cpp
msgid "Inherits:"
msgstr ""
@@ -1384,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
@@ -1439,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 ""
@@ -1495,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 ""
@@ -1533,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 ""
@@ -1585,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 ""
@@ -1613,35 +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"
+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
@@ -1649,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
@@ -1760,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"
@@ -1781,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
@@ -1869,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 ""
@@ -1896,6 +1926,30 @@ 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
+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 ""
@@ -2141,6 +2195,10 @@ msgid "Collapse all"
msgstr ""
#: editor/filesystem_dock.cpp
+msgid "Show In File Manager"
+msgstr ""
+
+#: editor/filesystem_dock.cpp
msgid "Instance"
msgstr ""
@@ -2169,10 +2227,6 @@ msgid "Info"
msgstr ""
#: editor/filesystem_dock.cpp
-msgid "Show In File Manager"
-msgstr ""
-
-#: editor/filesystem_dock.cpp
msgid "Re-Import.."
msgstr ""
@@ -2338,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
@@ -2813,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
@@ -3473,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 ""
@@ -3522,17 +3576,6 @@ msgstr ""
msgid "Set Handle"
msgstr ""
-#: editor/plugins/color_ramp_editor_plugin.cpp
-#: editor/plugins/gradient_texture_editor_plugin.cpp
-msgid "Add/Remove Color Ramp Point"
-msgstr ""
-
-#: editor/plugins/color_ramp_editor_plugin.cpp
-#: editor/plugins/gradient_texture_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 ""
@@ -3564,9 +3607,32 @@ 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 ""
@@ -3836,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 ""
@@ -3848,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
@@ -3859,20 +3938,33 @@ msgstr ""
msgid "Generated Point Count:"
msgstr ""
+#: editor/plugins/particles_2d_editor_plugin.cpp
#: editor/plugins/particles_editor_plugin.cpp
-msgid "Node does not contain geometry."
+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 (faces)."
+msgid "Node does not contain geometry."
msgstr ""
#: editor/plugins/particles_editor_plugin.cpp
-msgid "A processor material of type 'ParticlesMaterial' is required."
+msgid "Node does not contain geometry (faces)."
msgstr ""
#: editor/plugins/particles_editor_plugin.cpp
-msgid "Generating AABB"
+msgid "A processor material of type 'ParticlesMaterial' is required."
msgstr ""
#: editor/plugins/particles_editor_plugin.cpp
@@ -3927,12 +4019,16 @@ msgstr ""
msgid "Generate Visibility AABB"
msgstr ""
-#: editor/plugins/particles_editor_plugin.cpp
-msgid "Generation Time (sec):"
+#: editor/plugins/path_2d_editor_plugin.cpp
+msgid "Remove Point from Curve"
msgstr ""
#: editor/plugins/path_2d_editor_plugin.cpp
-msgid "Remove Point from Curve"
+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
@@ -3990,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 ""
@@ -4143,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 ""
@@ -4230,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 ""
@@ -4267,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
@@ -4330,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"
@@ -4409,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 ""
@@ -4431,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 ""
@@ -4648,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 "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
@@ -4736,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
@@ -4780,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
@@ -4824,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 ""
@@ -5244,11 +5419,11 @@ msgid "Invalid project path, the path must exist!"
msgstr ""
#: editor/project_manager.cpp
-msgid "Invalid project path, *.godot must not exist."
+msgid "Invalid project path, project.godot must not exist."
msgstr ""
#: editor/project_manager.cpp
-msgid "Invalid project path, *.godot must exist."
+msgid "Invalid project path, project.godot must exist."
msgstr ""
#: editor/project_manager.cpp
@@ -5260,7 +5435,7 @@ msgid "Invalid project path (changed anything?)."
msgstr ""
#: editor/project_manager.cpp
-msgid "Couldn't create *.godot project file in project path."
+msgid "Couldn't create project.godot in project path."
msgstr ""
#: editor/project_manager.cpp
@@ -5477,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 ""
@@ -5542,7 +5721,7 @@ msgid "Remove Resource Remap Option"
msgstr ""
#: editor/project_settings.cpp
-msgid "Project Settings "
+msgid "Project Settings (project.godot)"
msgstr ""
#: editor/project_settings.cpp editor/settings_config_dialog.cpp
@@ -5658,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
#, fuzzy
msgid "Pick a Node"
msgstr "Paste yer Node"
@@ -5847,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 ""
@@ -5922,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 ""
@@ -5970,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
@@ -6714,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
@@ -6783,12 +7021,6 @@ msgid ""
"Nothing is visible because meshes have not been assigned to draw passes."
msgstr ""
-#: scene/3d/particles.cpp
-msgid ""
-"A material to process the particles is not assigned, so no behavior is "
-"imprinted."
-msgstr ""
-
#: scene/3d/remote_transform.cpp
msgid "Path property must point to a valid Spatial node to work."
msgstr ""
@@ -6804,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 ""
@@ -6846,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 25055a0b7b..b812b6f8ef 100644
--- a/editor/translations/pt_BR.po
+++ b/editor/translations/pt_BR.po
@@ -1,6 +1,5 @@
# Portuguese (Brazil) translation of the Godot Engine editor
-# Copyright (C) 2007-2017 Juan Linietsky, Ariel Manzur
-# Copyright (C) 2014-2017 Godot Engine contributors (cf. AUTHORS.md)
+# 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.
@@ -550,7 +549,8 @@ msgid "Search:"
msgstr "Pesquisar:"
#: editor/asset_library_editor_plugin.cpp editor/code_editor.cpp
-#: editor/editor_help.cpp editor/plugins/script_editor_plugin.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"
@@ -596,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"
@@ -740,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"
@@ -849,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"
@@ -953,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"
@@ -964,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"
@@ -1035,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:"
@@ -1228,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"
@@ -1245,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:"
@@ -1416,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 "
@@ -1482,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?"
@@ -1540,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"
@@ -1580,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"
@@ -1633,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"
@@ -1661,84 +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 "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 "Export the project to many platforms."
-msgstr "Exportar o projeto para diversas plataformas."
+msgid "Project Settings"
+msgstr "Configurações do Projeto"
+
+#: editor/editor_node.cpp
+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"
@@ -1827,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"
@@ -1850,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!"
@@ -1938,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"
@@ -1965,6 +1999,36 @@ 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:"
@@ -2224,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"
@@ -2252,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..."
@@ -2422,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."
@@ -2909,7 +2974,7 @@ msgstr "Comprimir"
#: editor/io_plugins/editor_translation_import_plugin.cpp
#, fuzzy
-msgid "Add to Project (godot.cfg)"
+msgid "Add to Project (project.godot)"
msgstr "Adicionar ao Projeto (engine.cfg)"
#: editor/io_plugins/editor_translation_import_plugin.cpp
@@ -3583,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"
@@ -3632,17 +3697,6 @@ msgstr "Criar Polígono 3D"
msgid "Set Handle"
msgstr "Definir Manipulador"
-#: editor/plugins/color_ramp_editor_plugin.cpp
-#: editor/plugins/gradient_texture_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/gradient_texture_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"
@@ -3675,9 +3729,33 @@ 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"
@@ -3952,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:"
@@ -3964,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"
@@ -3975,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."
@@ -3988,11 +4101,6 @@ msgid "A processor material of type 'ParticlesMaterial' is required."
msgstr ""
#: editor/plugins/particles_editor_plugin.cpp
-#, fuzzy
-msgid "Generating AABB"
-msgstr "Gerar AABB"
-
-#: editor/plugins/particles_editor_plugin.cpp
msgid "Faces contain no area!"
msgstr "As faces não têm área!"
@@ -4050,13 +4158,18 @@ msgstr "Preenchimento de Emissão:"
msgid "Generate Visibility AABB"
msgstr "Gerar AABB"
-#: editor/plugins/particles_editor_plugin.cpp
+#: 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 "Generation Time (sec):"
-msgstr "Tempo Médio (seg)"
+msgid "Remove Out-Control from Curve"
+msgstr "Mover Controle de Saída na Curva"
#: editor/plugins/path_2d_editor_plugin.cpp
-msgid "Remove Point from Curve"
+#, fuzzy
+msgid "Remove In-Control from Curve"
msgstr "Remover Ponto da Curva"
#: editor/plugins/path_2d_editor_plugin.cpp
@@ -4114,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"
@@ -4267,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"
@@ -4355,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"
@@ -4392,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."
@@ -4461,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"
@@ -4540,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"
@@ -4562,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"
@@ -4779,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
+#, fuzzy
+msgid "View Environment"
+msgstr "Ambiente"
+
+#: editor/plugins/spatial_editor_plugin.cpp
+#, fuzzy
+msgid "View Gizmos"
+msgstr "Gizmos"
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "No scene selected to instance!"
-msgstr "Nenhuma cena selecionada para instanciar!"
+msgid "View Information"
+msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Instance at Cursor"
-msgstr "Instanciar no Cursor"
+msgid "Audio Listener"
+msgstr "Ouvinte de Ãudio"
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Could not instance scene!"
-msgstr "Não foi possível instanciar cena!"
+msgid "XForm Dialog"
+msgstr "Diálogo XForm"
#: editor/plugins/spatial_editor_plugin.cpp
msgid "Move Mode (W)"
@@ -4868,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"
@@ -4880,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"
@@ -4912,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"
@@ -4936,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"
@@ -4956,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.):"
@@ -5395,12 +5605,12 @@ msgstr "Caminho de projeto inválido, o caminho deve existir!"
#: editor/project_manager.cpp
#, fuzzy
-msgid "Invalid project path, *.godot must not exist."
+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
#, fuzzy
-msgid "Invalid project path, *.godot must exist."
+msgid "Invalid project path, project.godot must exist."
msgstr "Caminho de projeto inválido, engine.cfg deve existir."
#: editor/project_manager.cpp
@@ -5413,7 +5623,7 @@ msgstr "Caminho de projeto inválido (mudou alguma coisa?)."
#: editor/project_manager.cpp
#, fuzzy
-msgid "Couldn't create *.godot project file in project path."
+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
@@ -5635,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"
@@ -5701,8 +5916,8 @@ msgstr "Remover Opção de Remapeamento de Recurso"
#: editor/project_settings.cpp
#, fuzzy
-msgid "Project Settings "
-msgstr "Configurações do Projeto"
+msgid "Project Settings (project.godot)"
+msgstr "Configurações do Projeto (engine.cfg)"
#: editor/project_settings.cpp editor/settings_config_dialog.cpp
msgid "General"
@@ -5820,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ó"
@@ -6016,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"
@@ -6097,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:"
@@ -6145,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
@@ -6913,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."
@@ -7003,12 +7286,6 @@ msgid ""
"Nothing is visible because meshes have not been assigned to draw passes."
msgstr ""
-#: scene/3d/particles.cpp
-msgid ""
-"A material to process the particles is not assigned, so no behavior is "
-"imprinted."
-msgstr ""
-
#: scene/3d/remote_transform.cpp
#, fuzzy
msgid "Path property must point to a valid Spatial node to work."
@@ -7029,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!"
@@ -7074,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 "
@@ -7092,9 +7384,63 @@ msgstr ""
#~ msgid "Import assets to the project."
#~ msgstr "Importar assets ao projeto."
-#, fuzzy
-#~ msgid "Project Settings (godot.cfg)"
-#~ msgstr "Configurações do Projeto (engine.cfg)"
+#~ 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"
@@ -7298,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:"
@@ -7334,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"
@@ -7365,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 fa4629c5c1..738eea37a9 100644
--- a/editor/translations/pt_PT.po
+++ b/editor/translations/pt_PT.po
@@ -1,6 +1,5 @@
# Portuguese (Portugal) translation of the Godot Engine editor
-# Copyright (C) 2007-2017 Juan Linietsky, Ariel Manzur
-# Copyright (C) 2014-2017 Godot Engine contributors (cf. AUTHORS.md)
+# 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.
#
# António Sarmento <antonio.luis.sarmento@gmail.com>, 2016.
@@ -532,7 +531,8 @@ msgid "Search:"
msgstr ""
#: editor/asset_library_editor_plugin.cpp editor/code_editor.cpp
-#: editor/editor_help.cpp editor/plugins/script_editor_plugin.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"
@@ -578,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 ""
@@ -721,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 ""
@@ -826,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 ""
@@ -926,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 ""
@@ -937,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 ""
@@ -1005,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 ""
@@ -1197,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 ""
@@ -1214,7 +1216,6 @@ msgid "Class:"
msgstr ""
#: editor/editor_help.cpp editor/scene_tree_editor.cpp
-#: editor/script_create_dialog.cpp
msgid "Inherits:"
msgstr ""
@@ -1384,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
@@ -1439,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 ""
@@ -1495,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 ""
@@ -1533,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 ""
@@ -1585,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 ""
@@ -1613,35 +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"
+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
@@ -1649,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
@@ -1760,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"
@@ -1781,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
@@ -1869,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 ""
@@ -1896,6 +1926,30 @@ 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
+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 ""
@@ -2140,6 +2194,10 @@ msgid "Collapse all"
msgstr ""
#: editor/filesystem_dock.cpp
+msgid "Show In File Manager"
+msgstr ""
+
+#: editor/filesystem_dock.cpp
msgid "Instance"
msgstr ""
@@ -2168,10 +2226,6 @@ msgid "Info"
msgstr ""
#: editor/filesystem_dock.cpp
-msgid "Show In File Manager"
-msgstr ""
-
-#: editor/filesystem_dock.cpp
msgid "Re-Import.."
msgstr ""
@@ -2337,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
@@ -2812,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
@@ -3472,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 ""
@@ -3521,17 +3575,6 @@ msgstr ""
msgid "Set Handle"
msgstr ""
-#: editor/plugins/color_ramp_editor_plugin.cpp
-#: editor/plugins/gradient_texture_editor_plugin.cpp
-msgid "Add/Remove Color Ramp Point"
-msgstr ""
-
-#: editor/plugins/color_ramp_editor_plugin.cpp
-#: editor/plugins/gradient_texture_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 ""
@@ -3563,9 +3606,32 @@ 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 ""
@@ -3835,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 ""
@@ -3847,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
@@ -3858,20 +3937,33 @@ msgstr ""
msgid "Generated Point Count:"
msgstr ""
+#: editor/plugins/particles_2d_editor_plugin.cpp
#: editor/plugins/particles_editor_plugin.cpp
-msgid "Node does not contain geometry."
+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 (faces)."
+msgid "Node does not contain geometry."
msgstr ""
#: editor/plugins/particles_editor_plugin.cpp
-msgid "A processor material of type 'ParticlesMaterial' is required."
+msgid "Node does not contain geometry (faces)."
msgstr ""
#: editor/plugins/particles_editor_plugin.cpp
-msgid "Generating AABB"
+msgid "A processor material of type 'ParticlesMaterial' is required."
msgstr ""
#: editor/plugins/particles_editor_plugin.cpp
@@ -3926,12 +4018,16 @@ msgstr ""
msgid "Generate Visibility AABB"
msgstr ""
-#: editor/plugins/particles_editor_plugin.cpp
-msgid "Generation Time (sec):"
+#: editor/plugins/path_2d_editor_plugin.cpp
+msgid "Remove Point from Curve"
msgstr ""
#: editor/plugins/path_2d_editor_plugin.cpp
-msgid "Remove Point from Curve"
+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
@@ -3989,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 ""
@@ -4142,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 ""
@@ -4230,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 ""
@@ -4267,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
@@ -4330,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"
@@ -4409,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 ""
@@ -4431,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 ""
@@ -4648,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
@@ -4736,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 "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
@@ -4780,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
@@ -4824,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 ""
@@ -5244,11 +5419,11 @@ msgid "Invalid project path, the path must exist!"
msgstr ""
#: editor/project_manager.cpp
-msgid "Invalid project path, *.godot must not exist."
+msgid "Invalid project path, project.godot must not exist."
msgstr ""
#: editor/project_manager.cpp
-msgid "Invalid project path, *.godot must exist."
+msgid "Invalid project path, project.godot must exist."
msgstr ""
#: editor/project_manager.cpp
@@ -5260,7 +5435,7 @@ msgid "Invalid project path (changed anything?)."
msgstr ""
#: editor/project_manager.cpp
-msgid "Couldn't create *.godot project file in project path."
+msgid "Couldn't create project.godot in project path."
msgstr ""
#: editor/project_manager.cpp
@@ -5477,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 ""
@@ -5542,7 +5721,7 @@ msgid "Remove Resource Remap Option"
msgstr ""
#: editor/project_settings.cpp
-msgid "Project Settings "
+msgid "Project Settings (project.godot)"
msgstr ""
#: editor/project_settings.cpp editor/settings_config_dialog.cpp
@@ -5658,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 ""
@@ -5847,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 ""
@@ -5921,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 ""
@@ -5969,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
@@ -6702,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
@@ -6771,12 +7009,6 @@ msgid ""
"Nothing is visible because meshes have not been assigned to draw passes."
msgstr ""
-#: scene/3d/particles.cpp
-msgid ""
-"A material to process the particles is not assigned, so no behavior is "
-"imprinted."
-msgstr ""
-
#: scene/3d/remote_transform.cpp
msgid "Path property must point to a valid Spatial node to work."
msgstr ""
@@ -6792,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 ""
@@ -6834,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 0c4a29fb63..3acaa82736 100644
--- a/editor/translations/ru.po
+++ b/editor/translations/ru.po
@@ -1,9 +1,9 @@
# Russian translation of the Godot Engine editor
-# Copyright (C) 2007-2017 Juan Linietsky, Ariel Manzur
-# Copyright (C) 2014-2017 Godot Engine contributors (cf. AUTHORS.md)
+# 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-2017.
+# ijet <my-ijet@mail.ru>, 2017.
# Maxim Kim <habamax@gmail.com>, 2016.
# Maxim toby3d Lebedev <mail@toby3d.ru>, 2016.
#
@@ -11,8 +11,8 @@ msgid ""
msgstr ""
"Project-Id-Version: Godot Engine editor\n"
"POT-Creation-Date: \n"
-"PO-Revision-Date: 2017-01-09 02:56+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"
@@ -21,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.11-dev\n"
+"X-Generator: Weblate 2.14-dev\n"
#: editor/animation_editor.cpp
msgid "Disabled"
-msgstr "Отключить"
+msgstr "Отключено"
#: editor/animation_editor.cpp
msgid "All Selection"
@@ -37,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"
@@ -110,7 +109,7 @@ msgstr "Дублировать выделенное"
#: editor/animation_editor.cpp
msgid "Duplicate Transposed"
-msgstr "Дублировать перемещённый"
+msgstr "Дублировать и перемеÑтить"
#: editor/animation_editor.cpp
msgid "Remove Selection"
@@ -130,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"
@@ -208,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."
@@ -272,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"
@@ -288,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"
@@ -304,7 +303,7 @@ msgstr "МакÑ. Угловые погрешноÑти:"
#: editor/animation_editor.cpp
msgid "Max Optimizable Angle:"
-msgstr "МакÑимальный оптимизируемы угол:"
+msgstr "МакÑимальный оптимизируемый угол:"
#: editor/animation_editor.cpp
msgid "Optimize"
@@ -328,7 +327,7 @@ msgstr "КоÑффициент маÑштабированиÑ:"
#: editor/animation_editor.cpp
msgid "Call Functions in Which Node?"
-msgstr "Вызвать функции в каком узле?"
+msgstr "Из какого узла вызвать функцию?"
#: editor/animation_editor.cpp
msgid "Remove invalid keys"
@@ -378,7 +377,7 @@ msgstr "КонÑтанты:"
#: editor/asset_library_editor_plugin.cpp
#, fuzzy
msgid "View Files"
-msgstr "Файл"
+msgstr " Файлы"
#: editor/asset_library_editor_plugin.cpp editor/create_dialog.cpp
#: editor/editor_help.cpp editor/property_selector.cpp
@@ -514,7 +513,7 @@ msgstr ""
#: editor/asset_library_editor_plugin.cpp
#, fuzzy
msgid "Download Error"
-msgstr "Вниз"
+msgstr "Загрузка"
#: editor/asset_library_editor_plugin.cpp
msgid "Download for this asset is already in progress!"
@@ -548,7 +547,8 @@ msgid "Search:"
msgstr "ПоиÑк:"
#: editor/asset_library_editor_plugin.cpp editor/code_editor.cpp
-#: editor/editor_help.cpp editor/plugins/script_editor_plugin.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"
@@ -576,7 +576,7 @@ msgstr "Сортировать:"
#: editor/asset_library_editor_plugin.cpp
msgid "Reverse"
-msgstr "Обратный"
+msgstr "Обратно"
#: editor/asset_library_editor_plugin.cpp editor/project_settings.cpp
msgid "Category:"
@@ -592,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"
@@ -608,7 +608,7 @@ 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"
@@ -639,7 +639,6 @@ msgid "No Matches"
msgstr "Ðет Ñовпадений"
#: editor/code_editor.cpp
-#, fuzzy
msgid "Replaced %d occurrence(s)."
msgstr "Заменено %d Ñовпадений."
@@ -677,7 +676,7 @@ msgstr "Ðе найдено!"
#: editor/code_editor.cpp
msgid "Replace By"
-msgstr "Заменить чем"
+msgstr "Заменить на"
#: editor/code_editor.cpp
msgid "Case Sensitive"
@@ -740,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 "Удалить"
@@ -849,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 "Путь"
@@ -937,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 "Загрузить"
@@ -963,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 "По-умолчанию"
@@ -1006,7 +1006,7 @@ msgstr "Ðе в пути реÑурÑов."
#: editor/editor_autoload_settings.cpp
msgid "Add AutoLoad"
-msgstr "Добавлена автозагрузка"
+msgstr "Добавить автозагрузку"
#: editor/editor_autoload_settings.cpp
msgid "Autoload '%s' already exists!"
@@ -1018,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"
@@ -1037,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 "Путь:"
@@ -1106,7 +1105,7 @@ msgstr "Упаковывание"
#: editor/editor_export.cpp platform/javascript/export/export.cpp
msgid "Template file not found:\n"
-msgstr ""
+msgstr "Файл шаблона не найден:\n"
#: editor/editor_export.cpp
msgid "Added:"
@@ -1223,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:"
@@ -1247,7 +1246,6 @@ msgid "Class:"
msgstr "КлаÑÑ:"
#: editor/editor_help.cpp editor/scene_tree_editor.cpp
-#: editor/script_create_dialog.cpp
msgid "Inherits:"
msgstr "ÐаÑледует:"
@@ -1417,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"
@@ -1483,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 "Эта Ñцена никогда не была Ñохранена. Сохранить перед запуÑком?"
@@ -1539,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 "ЯÑно"
@@ -1582,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 "Сцена"
@@ -1599,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."
@@ -1635,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 "Открыть поÑледнее"
@@ -1663,84 +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 "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"
@@ -1829,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"
@@ -1846,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!"
@@ -1924,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"
@@ -1939,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 файла"
@@ -1966,6 +1998,36 @@ 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 "УÑтановленные плагины:"
@@ -2083,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."
@@ -2121,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:"
@@ -2152,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!"
@@ -2189,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."
@@ -2216,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"
@@ -2253,10 +2307,6 @@ msgid "Info"
msgstr "ИнформациÑ"
#: editor/filesystem_dock.cpp
-msgid "Show In File Manager"
-msgstr "ПроÑмотреть в проводнике"
-
-#: editor/filesystem_dock.cpp
msgid "Re-Import.."
msgstr "Переимпортировать.."
@@ -2270,7 +2320,7 @@ msgstr "Следующий каталог"
#: editor/filesystem_dock.cpp
msgid "Re-Scan Filesystem"
-msgstr "Повторное Ñканирование файловой ÑиÑтемы"
+msgstr "ПереÑканировать файловую ÑиÑтему"
#: editor/filesystem_dock.cpp
msgid "Toggle folder status as Favorite"
@@ -2278,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"
@@ -2334,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!"
@@ -2423,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."
@@ -2466,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"
@@ -2477,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."
@@ -2505,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
@@ -2547,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"
@@ -2579,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)"
@@ -2608,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."
@@ -2624,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:"
@@ -2640,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"
@@ -2656,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"
@@ -2911,8 +2959,8 @@ msgstr "Сжимать"
#: editor/io_plugins/editor_translation_import_plugin.cpp
#, fuzzy
-msgid "Add to Project (godot.cfg)"
-msgstr "Добавить в проект (engine.cfg)"
+msgid "Add to Project (project.godot)"
+msgstr "Добавить к проекту (godot.cfg)"
#: editor/io_plugins/editor_translation_import_plugin.cpp
msgid "Import Languages:"
@@ -2951,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
@@ -3579,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 "Ок"
@@ -3630,17 +3677,6 @@ msgstr "Создан Poly3D"
msgid "Set Handle"
msgstr "УÑтановить обработчик"
-#: editor/plugins/color_ramp_editor_plugin.cpp
-#: editor/plugins/gradient_texture_editor_plugin.cpp
-msgid "Add/Remove Color Ramp Point"
-msgstr "Добавить/Удалить точку Color Ramp"
-
-#: editor/plugins/color_ramp_editor_plugin.cpp
-#: editor/plugins/gradient_texture_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 "Создание библиотеки полиÑеток"
@@ -3673,8 +3709,31 @@ 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 "Изменена карта кривой"
+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"
@@ -3713,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
@@ -3737,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
@@ -3758,7 +3814,6 @@ msgid "Add Point (in empty space)"
msgstr "Добавить точку (в пуÑтом проÑтранÑтрве)"
#: editor/plugins/line_2d_editor_plugin.cpp
-#, fuzzy
msgid "Split Segment (in line)"
msgstr "Разделить Ñегмент (в кривой)"
@@ -3949,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 "Ошибка при загрузке изображениÑ:"
@@ -3961,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"
@@ -3972,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 "Узел не Ñодержит геометрии."
@@ -3982,12 +4072,7 @@ msgstr "Узел не Ñодержит геометрии (грани)."
#: editor/plugins/particles_editor_plugin.cpp
msgid "A processor material of type 'ParticlesMaterial' is required."
-msgstr ""
-
-#: editor/plugins/particles_editor_plugin.cpp
-#, fuzzy
-msgid "Generating AABB"
-msgstr "Сгенерировать AABB"
+msgstr "ТребуетÑÑ Ð¼Ð°Ñ‚ÐµÑ€Ð¸Ð°Ð» типа 'ParticlesMaterial'."
#: editor/plugins/particles_editor_plugin.cpp
msgid "Faces contain no area!"
@@ -3999,15 +4084,13 @@ msgstr "Ðет граней!"
#: editor/plugins/particles_editor_plugin.cpp
msgid "Generate AABB"
-msgstr "Сгенерировать AABB"
+msgstr "Генерировать AABB"
#: editor/plugins/particles_editor_plugin.cpp
-#, fuzzy
msgid "Create Emission Points From Mesh"
msgstr "Создать излучатель из полиÑетки"
#: editor/plugins/particles_editor_plugin.cpp
-#, fuzzy
msgid "Create Emission Points From Node"
msgstr "Создать излучатель из узла"
@@ -4020,40 +4103,42 @@ msgid "Create Emitter"
msgstr "Создать излучатель"
#: editor/plugins/particles_editor_plugin.cpp
-#, fuzzy
msgid "Emission Points:"
-msgstr "КоличеÑтво выброÑов:"
+msgstr "Точек излучениÑ:"
#: editor/plugins/particles_editor_plugin.cpp
-#, fuzzy
msgid "Surface Points"
-msgstr "ПоверхноÑтей %d"
+msgstr "Точки поверхноÑти"
#: editor/plugins/particles_editor_plugin.cpp
msgid "Surface Points+Normal (Directed)"
-msgstr ""
+msgstr "Точки поверхноÑти + Ðормаль(ÐаправленнаÑ)"
#: editor/plugins/particles_editor_plugin.cpp
msgid "Volume"
msgstr "Объём"
#: editor/plugins/particles_editor_plugin.cpp
-#, fuzzy
msgid "Emission Source: "
-msgstr "Заполнение излучателÑ:"
+msgstr "ИÑточник излучениÑ: "
#: editor/plugins/particles_editor_plugin.cpp
#, fuzzy
msgid "Generate Visibility AABB"
-msgstr "Сгенерировать AABB"
+msgstr "Генерировать AABB"
-#: editor/plugins/particles_editor_plugin.cpp
+#: editor/plugins/path_2d_editor_plugin.cpp
+msgid "Remove Point from Curve"
+msgstr "Удалена точка Ñ ÐºÑ€Ð¸Ð²Ð¾Ð¹"
+
+#: editor/plugins/path_2d_editor_plugin.cpp
#, fuzzy
-msgid "Generation Time (sec):"
-msgstr "Среднее Ð²Ñ€ÐµÐ¼Ñ (Ñек.)"
+msgid "Remove Out-Control from Curve"
+msgstr "Передвинут выходной луч у кривой"
#: editor/plugins/path_2d_editor_plugin.cpp
-msgid "Remove Point from Curve"
+#, fuzzy
+msgid "Remove In-Control from Curve"
msgstr "Удалена точка Ñ ÐºÑ€Ð¸Ð²Ð¾Ð¹"
#: editor/plugins/path_2d_editor_plugin.cpp
@@ -4111,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 карту"
@@ -4264,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 "Ошибка во Ð²Ñ€ÐµÐ¼Ñ ÑÐ¾Ñ…Ñ€Ð°Ð½ÐµÐ½Ð¸Ñ Ñ‚ÐµÐ¼Ñ‹"
@@ -4351,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 "Шаг через"
@@ -4388,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."
@@ -4416,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"
@@ -4456,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"
@@ -4515,7 +4620,7 @@ 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
@@ -4535,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 "Ðайти предыдущее"
@@ -4557,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 "Изменена чиÑÐ»Ð¾Ð²Ð°Ñ ÐºÐ¾Ð½Ñтанта"
@@ -4774,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
-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 "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)"
@@ -4862,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 "Преобразование"
@@ -4874,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 Окно"
@@ -4906,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 "Отображать начало координат"
@@ -4930,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 "Параметры привÑзки"
@@ -4950,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 перÑпективы (градуÑÑ‹):"
@@ -5132,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"
@@ -5296,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.."
@@ -5324,61 +5501,52 @@ 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!"
@@ -5386,13 +5554,13 @@ msgstr "Ðеверный путь к проекту, путь должен ÑуÑ
#: editor/project_manager.cpp
#, fuzzy
-msgid "Invalid project path, *.godot must not exist."
-msgstr "ÐедопуÑтимый путь к проекту, engine.cfg не должен ÑущеÑтвовать."
+msgid "Invalid project path, project.godot must not exist."
+msgstr "ÐедопуÑтимый путь, не должен приÑутÑтвовать godot.cfg."
#: editor/project_manager.cpp
#, fuzzy
-msgid "Invalid project path, *.godot must exist."
-msgstr "ÐедопуÑтимый путь к проекту, engine.cfg должен ÑущеÑтвовать."
+msgid "Invalid project path, project.godot must exist."
+msgstr "ÐедопуÑтимый путь, должен приÑутÑтвовать godot.cfg."
#: editor/project_manager.cpp
msgid "Imported Project"
@@ -5404,8 +5572,8 @@ msgstr "Ðеверный путь к проекту (Что-то изменилÐ
#: editor/project_manager.cpp
#, fuzzy
-msgid "Couldn't create *.godot project file in project path."
-msgstr "Ðе могу Ñоздать engine.cfg в папке проекта."
+msgid "Couldn't create project.godot in project path."
+msgstr "Ðе удалоÑÑŒ Ñоздать godot.cfg в папке проекта."
#: editor/project_manager.cpp
msgid "The following files failed extraction from package:"
@@ -5502,7 +5670,7 @@ msgstr "Ðовый проект"
#: editor/project_manager.cpp
#, fuzzy
msgid "Templates"
-msgstr "Удалить Ñлемент"
+msgstr "Удалить шаблон"
#: editor/project_manager.cpp
msgid "Exit"
@@ -5604,7 +5772,6 @@ msgid "Button 9"
msgstr "Кнопка 9"
#: editor/project_settings.cpp
-#, fuzzy
msgid "Joypad Axis Index:"
msgstr "Ð˜Ð½Ð´ÐµÐºÑ Ð¾Ñи джойÑтика:"
@@ -5613,7 +5780,6 @@ msgid "Axis"
msgstr "ОÑÑŒ"
#: editor/project_settings.cpp
-#, fuzzy
msgid "Joypad Button Index:"
msgstr "Ð˜Ð½Ð´ÐµÐºÑ ÐºÐ½Ð¾Ð¿ÐºÐ¸ джойÑтика:"
@@ -5625,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 "УÑтройÑтво"
@@ -5691,8 +5862,8 @@ msgstr "Удалён параметр реÑурÑа перенаправленÐ
#: editor/project_settings.cpp
#, fuzzy
-msgid "Project Settings "
-msgstr "Параметры проекта"
+msgid "Project Settings (project.godot)"
+msgstr "ÐаÑтройки проекта (engine.cfg)"
#: editor/project_settings.cpp editor/settings_config_dialog.cpp
msgid "General"
@@ -5759,17 +5930,16 @@ msgid "AutoLoad"
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"
@@ -5777,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.."
@@ -5800,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."
@@ -5827,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:"
@@ -5961,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."
@@ -6004,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 "Редактировать группы"
@@ -6044,7 +6213,6 @@ msgid "Save Branch as Scene"
msgstr "Сохранить ветку, как Ñцену"
#: editor/scene_tree_dock.cpp
-#, fuzzy
msgid "Copy Node Path"
msgstr "Копировать путь"
@@ -6081,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 "Ðекорректное Ð¸Ð¼Ñ ÑƒÐ·Ð»Ð°, Ñледующие Ñимволы недопуÑтимы:"
@@ -6129,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
@@ -6705,31 +6940,26 @@ msgid "just released"
msgstr "проÑто отпущена"
#: platform/javascript/export/export.cpp
-#, fuzzy
msgid "Run in Browser"
-msgstr "Обзор"
+msgstr "ЗапуÑтить в браузере"
#: platform/javascript/export/export.cpp
msgid "Run exported HTML in the system's default browser."
-msgstr ""
+msgstr "ЗапуÑтить HTML в Ñтандартном браузере ÑиÑтемы."
#: platform/javascript/export/export.cpp
-#, fuzzy
msgid "Could not write file:\n"
-msgstr "Ðевозможно найти тайл:"
+msgstr "Ðе удалоÑÑŒ запиÑать файл:\n"
#: platform/javascript/export/export.cpp
-#, fuzzy
msgid "Could not read file:\n"
-msgstr "Ðевозможно найти тайл:"
+msgstr "Ðе удалоÑÑŒ прочитать файл:\n"
#: platform/javascript/export/export.cpp
-#, fuzzy
msgid "Could not open template for export:\n"
-msgstr "Ðевозможно Ñоздать папку."
+msgstr "Ðе удалоÑÑŒ открыть шаблон Ð´Ð»Ñ ÑкÑпорта:\n"
#: platform/uwp/export/export.cpp
-#, fuzzy
msgid ""
"Couldn't read the certificate file. Are the path and password both correct?"
msgstr "Ðе могу прочитать файл Ñертификата. Уверены, что путь и пароль верны?"
@@ -6894,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."
@@ -6986,12 +7216,6 @@ msgid ""
"Nothing is visible because meshes have not been assigned to draw passes."
msgstr ""
-#: scene/3d/particles.cpp
-msgid ""
-"A material to process the particles is not assigned, so no behavior is "
-"imprinted."
-msgstr ""
-
#: scene/3d/remote_transform.cpp
msgid "Path property must point to a valid Spatial node to work."
msgstr "СвойÑтво Path должно указывать на дейÑтвительный Spatial узел."
@@ -7011,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 "Внимание!"
@@ -7045,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 ""
@@ -7055,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 ""
@@ -7075,9 +7318,64 @@ msgstr ""
#~ msgid "Import assets to the project."
#~ msgstr "Импортировать аÑÑеты в проект."
-#, fuzzy
-#~ msgid "Project Settings (godot.cfg)"
-#~ msgstr "ÐаÑтройки проекта (engine.cfg)"
+#~ 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 "ПоверхноÑть"
@@ -7298,9 +7596,6 @@ msgstr ""
#~ msgid "Trailing Silence:"
#~ msgstr "Удаление тишины:"
-#~ msgid "Script"
-#~ msgstr "Скрипт"
-
#~ msgid "Script Export Mode:"
#~ msgstr "Режим ÑкÑÐ¿Ð¾Ñ€Ñ‚Ð¸Ñ€Ð¾Ð²Ð°Ð½Ð¸Ñ Ñкриптов:"
@@ -7334,9 +7629,6 @@ msgstr ""
#~ msgid "BakedLightInstance does not contain a BakedLight resource."
#~ msgstr "BakedLightInstance не Ñодержит BakedLight реÑурÑ."
-#~ msgid "Vertex"
-#~ msgstr "ВертекÑ"
-
#~ msgid "Fragment"
#~ msgstr "Фрагмент"
@@ -7379,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 b0bee6aa6f..0b30bc80f4 100644
--- a/editor/translations/sk.po
+++ b/editor/translations/sk.po
@@ -1,6 +1,5 @@
# Slovak translation of the Godot Engine editor
-# Copyright (C) 2007-2017 Juan Linietsky, Ariel Manzur
-# Copyright (C) 2014-2017 Godot Engine contributors (cf. AUTHORS.md)
+# 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.
#
# J08nY <johnenter@gmail.com>, 2016.
@@ -535,7 +534,8 @@ msgid "Search:"
msgstr ""
#: editor/asset_library_editor_plugin.cpp editor/code_editor.cpp
-#: editor/editor_help.cpp editor/plugins/script_editor_plugin.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"
@@ -581,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"
@@ -724,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 ""
@@ -829,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 ""
@@ -929,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 ""
@@ -940,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 ""
@@ -1008,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:"
@@ -1200,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 ""
@@ -1217,7 +1219,6 @@ msgid "Class:"
msgstr "Trieda:"
#: editor/editor_help.cpp editor/scene_tree_editor.cpp
-#: editor/script_create_dialog.cpp
msgid "Inherits:"
msgstr ""
@@ -1388,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
@@ -1443,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 ""
@@ -1499,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 ""
@@ -1537,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 ""
@@ -1590,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 ""
@@ -1618,35 +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"
+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
@@ -1654,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
@@ -1765,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
@@ -1786,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
@@ -1874,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 ""
@@ -1901,6 +1930,32 @@ msgstr ""
msgid "Load Errors"
msgstr ""
+#: 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 "Installed Plugins:"
msgstr ""
@@ -2145,6 +2200,10 @@ msgid "Collapse all"
msgstr ""
#: editor/filesystem_dock.cpp
+msgid "Show In File Manager"
+msgstr ""
+
+#: editor/filesystem_dock.cpp
msgid "Instance"
msgstr ""
@@ -2173,10 +2232,6 @@ msgid "Info"
msgstr ""
#: editor/filesystem_dock.cpp
-msgid "Show In File Manager"
-msgstr ""
-
-#: editor/filesystem_dock.cpp
msgid "Re-Import.."
msgstr ""
@@ -2343,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
@@ -2818,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
@@ -3478,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 ""
@@ -3527,17 +3582,6 @@ msgstr ""
msgid "Set Handle"
msgstr ""
-#: editor/plugins/color_ramp_editor_plugin.cpp
-#: editor/plugins/gradient_texture_editor_plugin.cpp
-msgid "Add/Remove Color Ramp Point"
-msgstr ""
-
-#: editor/plugins/color_ramp_editor_plugin.cpp
-#: editor/plugins/gradient_texture_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 ""
@@ -3569,9 +3613,32 @@ 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 ""
@@ -3841,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 ""
@@ -3853,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
@@ -3864,20 +3944,33 @@ msgstr ""
msgid "Generated Point Count:"
msgstr ""
+#: editor/plugins/particles_2d_editor_plugin.cpp
#: editor/plugins/particles_editor_plugin.cpp
-msgid "Node does not contain geometry."
+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 (faces)."
+msgid "Node does not contain geometry."
msgstr ""
#: editor/plugins/particles_editor_plugin.cpp
-msgid "A processor material of type 'ParticlesMaterial' is required."
+msgid "Node does not contain geometry (faces)."
msgstr ""
#: editor/plugins/particles_editor_plugin.cpp
-msgid "Generating AABB"
+msgid "A processor material of type 'ParticlesMaterial' is required."
msgstr ""
#: editor/plugins/particles_editor_plugin.cpp
@@ -3932,12 +4025,16 @@ msgstr ""
msgid "Generate Visibility AABB"
msgstr ""
-#: editor/plugins/particles_editor_plugin.cpp
-msgid "Generation Time (sec):"
+#: editor/plugins/path_2d_editor_plugin.cpp
+msgid "Remove Point from Curve"
msgstr ""
#: editor/plugins/path_2d_editor_plugin.cpp
-msgid "Remove Point from Curve"
+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
@@ -3995,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 ""
@@ -4148,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 ""
@@ -4236,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 ""
@@ -4273,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
@@ -4336,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"
@@ -4415,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 ""
@@ -4437,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 ""
@@ -4654,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 "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
@@ -4744,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 "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
@@ -4788,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
@@ -4832,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 ""
@@ -5253,11 +5428,11 @@ msgid "Invalid project path, the path must exist!"
msgstr ""
#: editor/project_manager.cpp
-msgid "Invalid project path, *.godot must not exist."
+msgid "Invalid project path, project.godot must not exist."
msgstr ""
#: editor/project_manager.cpp
-msgid "Invalid project path, *.godot must exist."
+msgid "Invalid project path, project.godot must exist."
msgstr ""
#: editor/project_manager.cpp
@@ -5269,7 +5444,7 @@ msgid "Invalid project path (changed anything?)."
msgstr ""
#: editor/project_manager.cpp
-msgid "Couldn't create *.godot project file in project path."
+msgid "Couldn't create project.godot in project path."
msgstr ""
#: editor/project_manager.cpp
@@ -5486,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"
@@ -5551,7 +5730,7 @@ msgid "Remove Resource Remap Option"
msgstr ""
#: editor/project_settings.cpp
-msgid "Project Settings "
+msgid "Project Settings (project.godot)"
msgstr ""
#: editor/project_settings.cpp editor/settings_config_dialog.cpp
@@ -5668,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ť"
@@ -5857,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 ""
@@ -5933,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 ""
@@ -5981,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
@@ -6717,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
@@ -6786,12 +7024,6 @@ msgid ""
"Nothing is visible because meshes have not been assigned to draw passes."
msgstr ""
-#: scene/3d/particles.cpp
-msgid ""
-"A material to process the particles is not assigned, so no behavior is "
-"imprinted."
-msgstr ""
-
#: scene/3d/remote_transform.cpp
msgid "Path property must point to a valid Spatial node to work."
msgstr ""
@@ -6807,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 ""
@@ -6849,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 ea634658ce..e50f907b65 100644
--- a/editor/translations/sl.po
+++ b/editor/translations/sl.po
@@ -1,6 +1,5 @@
# Slovenian translation of the Godot Engine editor
-# Copyright (C) 2007-2017 Juan Linietsky, Ariel Manzur
-# Copyright (C) 2014-2017 Godot Engine contributors (cf. AUTHORS.md)
+# 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.
#
# matevž lapajne <sivar.lapajne@gmail.com>, 2016.
@@ -533,7 +532,8 @@ msgid "Search:"
msgstr ""
#: editor/asset_library_editor_plugin.cpp editor/code_editor.cpp
-#: editor/editor_help.cpp editor/plugins/script_editor_plugin.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"
@@ -579,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 ""
@@ -722,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 ""
@@ -827,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 ""
@@ -927,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 ""
@@ -938,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 ""
@@ -1006,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 ""
@@ -1198,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 ""
@@ -1215,7 +1217,6 @@ msgid "Class:"
msgstr ""
#: editor/editor_help.cpp editor/scene_tree_editor.cpp
-#: editor/script_create_dialog.cpp
msgid "Inherits:"
msgstr ""
@@ -1385,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
@@ -1440,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 ""
@@ -1496,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 ""
@@ -1534,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 ""
@@ -1586,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 ""
@@ -1614,35 +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"
+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
@@ -1650,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
@@ -1761,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"
@@ -1782,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
@@ -1870,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 ""
@@ -1897,6 +1927,30 @@ 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
+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 ""
@@ -2141,6 +2195,10 @@ msgid "Collapse all"
msgstr ""
#: editor/filesystem_dock.cpp
+msgid "Show In File Manager"
+msgstr ""
+
+#: editor/filesystem_dock.cpp
msgid "Instance"
msgstr ""
@@ -2169,10 +2227,6 @@ msgid "Info"
msgstr ""
#: editor/filesystem_dock.cpp
-msgid "Show In File Manager"
-msgstr ""
-
-#: editor/filesystem_dock.cpp
msgid "Re-Import.."
msgstr ""
@@ -2338,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
@@ -2813,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
@@ -3473,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 ""
@@ -3522,17 +3576,6 @@ msgstr ""
msgid "Set Handle"
msgstr ""
-#: editor/plugins/color_ramp_editor_plugin.cpp
-#: editor/plugins/gradient_texture_editor_plugin.cpp
-msgid "Add/Remove Color Ramp Point"
-msgstr ""
-
-#: editor/plugins/color_ramp_editor_plugin.cpp
-#: editor/plugins/gradient_texture_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 ""
@@ -3564,9 +3607,32 @@ 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 ""
@@ -3836,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 ""
@@ -3848,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
@@ -3859,20 +3938,33 @@ msgstr ""
msgid "Generated Point Count:"
msgstr ""
+#: editor/plugins/particles_2d_editor_plugin.cpp
#: editor/plugins/particles_editor_plugin.cpp
-msgid "Node does not contain geometry."
+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 (faces)."
+msgid "Node does not contain geometry."
msgstr ""
#: editor/plugins/particles_editor_plugin.cpp
-msgid "A processor material of type 'ParticlesMaterial' is required."
+msgid "Node does not contain geometry (faces)."
msgstr ""
#: editor/plugins/particles_editor_plugin.cpp
-msgid "Generating AABB"
+msgid "A processor material of type 'ParticlesMaterial' is required."
msgstr ""
#: editor/plugins/particles_editor_plugin.cpp
@@ -3927,12 +4019,16 @@ msgstr ""
msgid "Generate Visibility AABB"
msgstr ""
-#: editor/plugins/particles_editor_plugin.cpp
-msgid "Generation Time (sec):"
+#: editor/plugins/path_2d_editor_plugin.cpp
+msgid "Remove Point from Curve"
msgstr ""
#: editor/plugins/path_2d_editor_plugin.cpp
-msgid "Remove Point from Curve"
+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
@@ -3990,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 ""
@@ -4143,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 ""
@@ -4231,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 ""
@@ -4268,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
@@ -4331,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"
@@ -4410,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 ""
@@ -4432,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 ""
@@ -4649,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
@@ -4737,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 "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
@@ -4781,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
@@ -4825,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 ""
@@ -5245,11 +5420,11 @@ msgid "Invalid project path, the path must exist!"
msgstr ""
#: editor/project_manager.cpp
-msgid "Invalid project path, *.godot must not exist."
+msgid "Invalid project path, project.godot must not exist."
msgstr ""
#: editor/project_manager.cpp
-msgid "Invalid project path, *.godot must exist."
+msgid "Invalid project path, project.godot must exist."
msgstr ""
#: editor/project_manager.cpp
@@ -5261,7 +5436,7 @@ msgid "Invalid project path (changed anything?)."
msgstr ""
#: editor/project_manager.cpp
-msgid "Couldn't create *.godot project file in project path."
+msgid "Couldn't create project.godot in project path."
msgstr ""
#: editor/project_manager.cpp
@@ -5478,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 ""
@@ -5543,7 +5722,7 @@ msgid "Remove Resource Remap Option"
msgstr ""
#: editor/project_settings.cpp
-msgid "Project Settings "
+msgid "Project Settings (project.godot)"
msgstr ""
#: editor/project_settings.cpp editor/settings_config_dialog.cpp
@@ -5659,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 ""
@@ -5848,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 ""
@@ -5922,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 ""
@@ -5970,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
@@ -6714,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
@@ -6783,12 +7021,6 @@ msgid ""
"Nothing is visible because meshes have not been assigned to draw passes."
msgstr ""
-#: scene/3d/particles.cpp
-msgid ""
-"A material to process the particles is not assigned, so no behavior is "
-"imprinted."
-msgstr ""
-
#: scene/3d/remote_transform.cpp
msgid "Path property must point to a valid Spatial node to work."
msgstr ""
@@ -6804,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 ""
@@ -6846,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
index b31532f3bf..9e140b2375 100644
--- a/editor/translations/th.po
+++ b/editor/translations/th.po
@@ -1,35 +1,35 @@
# Thai translation of the Godot Engine editor
-# Copyright (C) 2007-2017 Juan Linietsky, Ariel Manzur
-# Copyright (C) 2014-2017 Godot Engine contributors (cf. AUTHORS.md)
+# 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.
#
-# Poommetee Ketson <poommetee@protonmail.com>, 2017.
+# 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-04-03 00:59+0000\n"
-"Last-Translator: Poommetee Ketson <poommetee@protonmail.com>\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.13-dev\n"
+"X-Generator: Weblate 2.14-dev\n"
#: editor/animation_editor.cpp
-#, fuzzy
msgid "Disabled"
msgstr "ปิดใช้งาน"
#: editor/animation_editor.cpp
msgid "All Selection"
-msgstr ""
+msgstr "เลือà¸à¸—ั้งหมด"
#: editor/animation_editor.cpp
+#, fuzzy
msgid "Move Add Key"
-msgstr ""
+msgstr "เลื่อนหรือเพิ่มคีย์à¹à¸­à¸™à¸´à¹€à¸¡à¸Šà¸±à¸™"
#: editor/animation_editor.cpp
msgid "Anim Change Transition"
@@ -76,18 +76,16 @@ msgid "Anim Track Rename"
msgstr "เปลี่ยนชื่อà¹à¸—ร็à¸à¹à¸­à¸™à¸´à¹€à¸¡à¸Šà¸±à¸™"
#: editor/animation_editor.cpp
-#, fuzzy
msgid "Anim Track Change Interpolation"
-msgstr "à¹à¸à¹‰à¹„ขà¸à¸²à¸£à¹€à¸Šà¸·à¹ˆà¸­à¸¡à¸—่าà¹à¸­à¸™à¸´à¹€à¸¡à¸Šà¸±à¸™"
+msgstr "à¹à¸à¹‰à¹„ขà¸à¸²à¸£à¹€à¸Šà¸·à¹ˆà¸­à¸¡à¹à¸—ร็à¸à¹à¸­à¸™à¸´à¹€à¸¡à¸Šà¸±à¸™"
#: editor/animation_editor.cpp
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"
@@ -103,12 +101,11 @@ msgstr "ลบคีย์à¹à¸­à¸™à¸´à¹€à¸¡à¸Šà¸±à¸™"
#: editor/animation_editor.cpp editor/plugins/tile_map_editor_plugin.cpp
msgid "Duplicate Selection"
-msgstr "ทำซ้ำที่เลือà¸"
+msgstr "ทำซ้ำในà¹à¸—ร็à¸à¹€à¸”ิม"
#: editor/animation_editor.cpp
-#, fuzzy
msgid "Duplicate Transposed"
-msgstr "ทำซ้ำเคลื่อน"
+msgstr "ทำซ้ำในà¹à¸—ร็à¸à¸—ี่เลือà¸"
#: editor/animation_editor.cpp
msgid "Remove Selection"
@@ -116,15 +113,15 @@ msgstr "ลบที่เลือà¸"
#: editor/animation_editor.cpp
msgid "Continuous"
-msgstr "ต่อเนื่อง"
+msgstr "ผันà¹à¸›à¸£"
#: editor/animation_editor.cpp
msgid "Discrete"
-msgstr "ไม่ต่อเนื่อง"
+msgstr "ค้าง"
#: editor/animation_editor.cpp
msgid "Trigger"
-msgstr ""
+msgstr "ไม่ค้าง"
#: editor/animation_editor.cpp
msgid "Anim Add Key"
@@ -136,11 +133,11 @@ 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"
@@ -187,14 +184,12 @@ msgid "Clean-Up Animation"
msgstr "เà¸à¹‡à¸šà¸à¸§à¸²à¸”à¹à¸­à¸™à¸´à¹€à¸¡à¸Šà¸±à¸™"
#: editor/animation_editor.cpp
-#, fuzzy
msgid "Create NEW track for %s and insert key?"
msgstr "เพิ่มà¹à¸—ร็à¸à¹ƒà¸«à¸¡à¹ˆà¸ªà¸³à¸«à¸£à¸±à¸š %s à¹à¸¥à¸°à¹€à¸žà¸´à¹ˆà¸¡à¸„ีย์?"
#: editor/animation_editor.cpp
-#, fuzzy
msgid "Create %d NEW tracks and insert keys?"
-msgstr "เพิ่มà¹à¸—ร็à¸à¹ƒà¸«à¸¡à¹ˆ %d à¹à¸—ร็à¸à¹à¸¥à¸°à¹€à¸žà¸´à¹ˆà¸¡à¸„ีย์?"
+msgstr "เพิ่ม %d à¹à¸—ร็à¸à¹ƒà¸«à¸¡à¹ˆà¹à¸¥à¸°à¹€à¸žà¸´à¹ˆà¸¡à¸„ีย์?"
#: editor/animation_editor.cpp editor/create_dialog.cpp
#: editor/editor_audio_buses.cpp
@@ -248,20 +243,19 @@ msgstr "ซูมà¹à¸­à¸™à¸´à¹€à¸¡à¸Šà¸±à¸™"
#: editor/animation_editor.cpp
msgid "Length (s):"
-msgstr "ความยาว (วิ):"
+msgstr "ความยาว (วินาที):"
#: editor/animation_editor.cpp
-#, fuzzy
msgid "Animation length (in seconds)."
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."
@@ -297,16 +291,15 @@ msgstr "ตัวเพิ่มประสิทธิภาพà¹à¸­à¸™à¸´à¹€
#: editor/animation_editor.cpp
msgid "Max. Linear Error:"
-msgstr "ผิดพลาดเชิงเส้นมาà¸à¸—ี่สุด:"
+msgstr "คลาดเคลื่อนเชิงเส้นมาà¸à¸—ี่สุด:"
#: editor/animation_editor.cpp
-#, fuzzy
msgid "Max. Angular Error:"
-msgstr "ผิดพลาดเชิงมุมมาà¸à¸—ี่สุด:"
+msgstr "คลาดเคลื่อนเชิงมุมมาà¸à¸—ี่สุด:"
#: editor/animation_editor.cpp
msgid "Max Optimizable Angle:"
-msgstr ""
+msgstr "ปรับà¹à¸à¹‰à¹€à¸Šà¸´à¸‡à¸¡à¸¸à¸¡à¸¡à¸²à¸à¸—ี่สุด:"
#: editor/animation_editor.cpp
msgid "Optimize"
@@ -326,7 +319,7 @@ msgstr "ทรานสิชัน"
#: editor/animation_editor.cpp
msgid "Scale Ratio:"
-msgstr "อัตราส่วนขนาด:"
+msgstr "อัตราส่วนเวลา:"
#: editor/animation_editor.cpp
msgid "Call Functions in Which Node?"
@@ -353,19 +346,16 @@ msgid "Clean-Up"
msgstr "เà¸à¹‡à¸šà¸à¸§à¸²à¸”"
#: editor/array_property_edit.cpp
-#, fuzzy
msgid "Resize Array"
msgstr "ปรับขนาดอาร์เรย์"
#: editor/array_property_edit.cpp
-#, fuzzy
msgid "Change Array Value Type"
-msgstr "à¹à¸à¹‰à¹„ขชนิดตัวà¹à¸›à¸£à¹ƒà¸™à¸­à¸²à¸£à¹Œà¹€à¸£à¸¢à¹Œ"
+msgstr "เปลี่ยนประเภทตัวà¹à¸›à¸£à¹ƒà¸™à¸­à¸²à¸£à¹Œà¹€à¸£à¸¢à¹Œ"
#: editor/array_property_edit.cpp
-#, fuzzy
msgid "Change Array Value"
-msgstr "à¹à¸à¹‰à¹„ขค่าในอาร์เรย์"
+msgstr "เปลี่ยนค่าในอาร์เรย์"
#: editor/asset_library_editor_plugin.cpp
msgid "Free"
@@ -383,12 +373,11 @@ msgstr "ค่าคงที่:"
#: editor/asset_library_editor_plugin.cpp
#, fuzzy
msgid "View Files"
-msgstr "ไฟล์"
+msgstr " ไฟล์"
#: editor/asset_library_editor_plugin.cpp editor/create_dialog.cpp
#: editor/editor_help.cpp editor/property_selector.cpp
#: editor/script_editor_debugger.cpp
-#, fuzzy
msgid "Description:"
msgstr "รายละเอียด:"
@@ -430,7 +419,7 @@ msgstr "เชื่อมโยง.."
#: editor/asset_library_editor_plugin.cpp
#, fuzzy
msgid "Can't connect to host:"
-msgstr "เชื่อมโยงà¸à¸±à¸šà¹‚หนด:"
+msgstr "เชื่อมไปยังโหนด:"
#: editor/asset_library_editor_plugin.cpp
msgid "No response from host:"
@@ -520,7 +509,7 @@ msgstr ""
#: editor/asset_library_editor_plugin.cpp
#, fuzzy
msgid "Download Error"
-msgstr "ลง"
+msgstr "ดาวน์โหลด"
#: editor/asset_library_editor_plugin.cpp
msgid "Download for this asset is already in progress!"
@@ -543,7 +532,6 @@ msgid "last"
msgstr ""
#: editor/asset_library_editor_plugin.cpp
-#, fuzzy
msgid "All"
msgstr "ทั้งหมด"
@@ -551,12 +539,12 @@ msgstr "ทั้งหมด"
#: 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
-#, fuzzy
msgid "Search:"
msgstr "ค้นหา:"
#: editor/asset_library_editor_plugin.cpp editor/code_editor.cpp
-#: editor/editor_help.cpp editor/plugins/script_editor_plugin.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"
@@ -571,7 +559,6 @@ msgstr "ค้นหา"
#: editor/io_plugins/editor_texture_import_plugin.cpp
#: editor/io_plugins/editor_translation_import_plugin.cpp
#: editor/project_manager.cpp
-#, fuzzy
msgid "Import"
msgstr "นำเข้า"
@@ -580,7 +567,6 @@ msgid "Plugins"
msgstr "ปลั๊à¸à¸­à¸´à¸™"
#: editor/asset_library_editor_plugin.cpp
-#, fuzzy
msgid "Sort:"
msgstr "เรียงตาม:"
@@ -589,41 +575,34 @@ msgid "Reverse"
msgstr "ย้อนà¸à¸¥à¸±à¸š"
#: editor/asset_library_editor_plugin.cpp editor/project_settings.cpp
-#, fuzzy
msgid "Category:"
-msgstr "ประเภท:"
+msgstr "หมวดหมู่:"
#: editor/asset_library_editor_plugin.cpp
-#, fuzzy
msgid "Site:"
msgstr "ไซต์:"
#: editor/asset_library_editor_plugin.cpp
-#, fuzzy
msgid "Support.."
-msgstr "à¸à¸²à¸£à¸ªà¸™à¸±à¸šà¸ªà¸™à¸¸à¸™"
+msgstr "à¸à¸²à¸£à¸ªà¸™à¸±à¸šà¸ªà¸™à¸¸à¸™.."
#: editor/asset_library_editor_plugin.cpp
-#, fuzzy
msgid "Official"
-msgstr "ผู้ผลิต"
+msgstr "ผู้พัฒนา"
-#: editor/asset_library_editor_plugin.cpp
-#, fuzzy
+#: editor/asset_library_editor_plugin.cpp editor/editor_node.cpp
msgid "Community"
msgstr "ชุมชน"
#: editor/asset_library_editor_plugin.cpp
-#, fuzzy
msgid "Testing"
msgstr "ทดสอบ"
#: editor/asset_library_editor_plugin.cpp
msgid "Assets ZIP File"
-msgstr ""
+msgstr "ไฟล์ ZIP"
#: editor/call_dialog.cpp
-#, fuzzy
msgid "Method List For '%s':"
msgstr "รายชื่อเมท็อดของ '%s':"
@@ -632,112 +611,90 @@ msgid "Call"
msgstr "เรียà¸"
#: editor/call_dialog.cpp
-#, fuzzy
msgid "Method List:"
msgstr "รายชื่อเมท็อด:"
#: editor/call_dialog.cpp
-#, fuzzy
msgid "Arguments:"
msgstr "ตัวà¹à¸›à¸£:"
#: editor/call_dialog.cpp
-#, fuzzy
msgid "Return:"
msgstr "คืนค่า:"
#: editor/code_editor.cpp
-#, fuzzy
msgid "Go to Line"
msgstr "ไปยังบรรทัด"
#: editor/code_editor.cpp
-#, fuzzy
msgid "Line Number:"
msgstr "บรรทัดที่:"
#: editor/code_editor.cpp
-#, fuzzy
msgid "No Matches"
msgstr "ไม่พบ"
#: editor/code_editor.cpp
-#, fuzzy
msgid "Replaced %d occurrence(s)."
msgstr "à¹à¸—นที่à¹à¸¥à¹‰à¸§ %d ครั้ง"
#: editor/code_editor.cpp
-#, fuzzy
msgid "Replace"
msgstr "à¹à¸—นที่"
#: editor/code_editor.cpp
-#, fuzzy
msgid "Replace All"
msgstr "à¹à¸—นที่ทั้งหมด"
#: editor/code_editor.cpp
-#, fuzzy
msgid "Match Case"
-msgstr "ตรงตามตัวพิมพ์ใหà¸à¹ˆ-เล็à¸"
+msgstr "ตรงตามอัà¸à¸©à¸£à¸žà¸´à¸¡à¸žà¹Œà¹€à¸¥à¹‡à¸-ใหà¸à¹ˆ"
#: editor/code_editor.cpp
-#, fuzzy
msgid "Whole Words"
msgstr "ทั้งคำ"
#: editor/code_editor.cpp
-#, fuzzy
msgid "Selection Only"
-msgstr "เฉพาะที่เลือà¸à¹„ว้"
+msgstr "เฉพาะที่à¸à¸³à¸¥à¸±à¸‡à¹€à¸¥à¸·à¸­à¸"
#: editor/code_editor.cpp editor/editor_help.cpp
-#, fuzzy
msgid "Find"
msgstr "ค้นหา"
#: editor/code_editor.cpp
-#, fuzzy
msgid "Next"
msgstr "ต่อไป"
#: editor/code_editor.cpp
-#, fuzzy
msgid "Not found!"
msgstr "ไม่พบ!"
#: editor/code_editor.cpp
-#, fuzzy
msgid "Replace By"
msgstr "à¹à¸—นที่ด้วย"
#: editor/code_editor.cpp
-#, fuzzy
msgid "Case Sensitive"
-msgstr "ตรงตามตัวพิมพ์ใหà¸à¹ˆ-เล็à¸"
+msgstr "ตรงตามอัà¸à¸©à¸£à¸žà¸´à¸¡à¸žà¹Œà¹€à¸¥à¹‡à¸-ใหà¸à¹ˆ"
#: editor/code_editor.cpp
-#, fuzzy
msgid "Backwards"
msgstr "ย้อนà¸à¸¥à¸±à¸š"
#: editor/code_editor.cpp
-#, fuzzy
msgid "Prompt On Replace"
msgstr "เตือนà¸à¹ˆà¸­à¸™à¹à¸—นที่"
#: editor/code_editor.cpp
-#, fuzzy
msgid "Skip"
msgstr "ข้าม"
#: editor/code_editor.cpp editor/plugins/canvas_item_editor_plugin.cpp
-#, fuzzy
msgid "Zoom In"
msgstr "ขยาย"
#: editor/code_editor.cpp editor/plugins/canvas_item_editor_plugin.cpp
-#, fuzzy
msgid "Zoom Out"
msgstr "ย่อ"
@@ -750,12 +707,10 @@ msgid "Line:"
msgstr "บรรทัด:"
#: editor/code_editor.cpp
-#, fuzzy
msgid "Col:"
msgstr "คอลัมน์:"
#: editor/connections_dialog.cpp
-#, fuzzy
msgid "Method in target Node must be specified!"
msgstr "ต้องระบุเมท็อดในโหนดปลายทาง!"
@@ -766,162 +721,137 @@ msgid ""
msgstr "ไม่พบเมท็อดปลายทาง! ระบุเมท็อดให้ถูà¸à¸•้องหรือเพิ่มสคริปต์ในโหนดปลายทาง"
#: editor/connections_dialog.cpp
-#, fuzzy
msgid "Connect To Node:"
-msgstr "เชื่อมโยงà¸à¸±à¸šà¹‚หนด:"
+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
-#, fuzzy
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
-#, fuzzy
+#: editor/project_settings.cpp
msgid "Remove"
msgstr "ลบ"
#: editor/connections_dialog.cpp
-#, fuzzy
msgid "Add Extra Call Argument:"
msgstr "เพิ่มตัวà¹à¸›à¸£:"
#: editor/connections_dialog.cpp
-#, fuzzy
msgid "Extra Call Arguments:"
msgstr "ตัวà¹à¸›à¸£à¹€à¸žà¸´à¹ˆà¸¡à¹€à¸•ิม:"
#: editor/connections_dialog.cpp
-#, fuzzy
msgid "Path to Node:"
msgstr "ตำà¹à¸«à¸™à¹ˆà¸‡à¸—ี่อยู่โหนด:"
#: editor/connections_dialog.cpp
-#, fuzzy
msgid "Make Function"
-msgstr "สร้างฟังà¸à¹Œà¸Šà¸±à¸™à¹ƒà¸«à¸¡à¹ˆ"
+msgstr "สร้างฟังà¸à¹Œà¸Šà¸±à¸™"
#: editor/connections_dialog.cpp
-#, fuzzy
msgid "Deferred"
msgstr "เรียà¸à¸ à¸²à¸¢à¸«à¸¥à¸±à¸‡"
#: editor/connections_dialog.cpp
-#, fuzzy
msgid "Oneshot"
msgstr "ครั้งเดียว"
#: editor/connections_dialog.cpp
-#, fuzzy
msgid "Connect"
-msgstr "เชื่อมโยง"
+msgstr "เชื่อม"
#: editor/connections_dialog.cpp
msgid "Connect '%s' to '%s'"
-msgstr "เชื่อมโยง '%s' à¸à¸±à¸š '%s'"
+msgstr "เชื่อม '%s' à¸à¸±à¸š '%s'"
#: editor/connections_dialog.cpp
-#, fuzzy
msgid "Connecting Signal:"
msgstr "เชื่อมโยงสัà¸à¸à¸²à¸“:"
#: editor/connections_dialog.cpp
msgid "Create Subscription"
-msgstr ""
+msgstr "ลบà¸à¸²à¸£à¹€à¸Šà¸·à¹ˆà¸­à¸¡à¹‚ยง"
#: editor/connections_dialog.cpp
-#, fuzzy
msgid "Connect.."
msgstr "เชื่อมโยง.."
#: editor/connections_dialog.cpp
#: editor/plugins/animation_tree_editor_plugin.cpp
-#, fuzzy
msgid "Disconnect"
-msgstr "ลบ"
+msgstr "ลบà¸à¸²à¸£à¹€à¸Šà¸·à¹ˆà¸­à¸¡à¹‚ยง"
#: editor/connections_dialog.cpp editor/node_dock.cpp
-#, fuzzy
msgid "Signals"
msgstr "สัà¸à¸à¸²à¸“"
#: editor/create_dialog.cpp
-#, fuzzy
msgid "Create New"
msgstr "สร้างใหม่"
#: editor/create_dialog.cpp editor/editor_file_dialog.cpp
#: editor/filesystem_dock.cpp
-#, fuzzy
msgid "Favorites:"
msgstr "ที่ชื่นชอบ:"
#: editor/create_dialog.cpp editor/editor_file_dialog.cpp
-#, fuzzy
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
-#, fuzzy
msgid "Matches:"
msgstr "พบ:"
#: editor/dependency_editor.cpp
-#, fuzzy
msgid "Search Replacement For:"
-msgstr "หาตัวà¹à¸—นสำหรับ:"
+msgstr "หาตัวà¹à¸—นของ:"
#: editor/dependency_editor.cpp
-#, fuzzy
msgid "Dependencies For:"
msgstr "à¸à¸²à¸£à¸­à¹‰à¸²à¸‡à¸­à¸´à¸‡à¸‚อง:"
#: editor/dependency_editor.cpp
-#, fuzzy
msgid ""
"Scene '%s' is currently being edited.\n"
"Changes will not take effect unless reloaded."
msgstr ""
-"ฉาภ'%s' à¸à¸³à¸¥à¸±à¸‡à¹€à¸›à¸´à¸”à¹à¸à¹‰à¹„ขอยู่\n"
+"ฉาภ'%s' à¸à¸³à¸¥à¸±à¸‡à¸–ูà¸à¹€à¸›à¸´à¸”à¹à¸à¹‰à¹„ข\n"
"à¸à¸²à¸£à¹à¸à¹‰à¹„ขจะไม่ส่งผลจนà¸à¸§à¹ˆà¸²à¸ˆà¸°à¹‚หลดใหม่"
#: editor/dependency_editor.cpp
-#, fuzzy
msgid ""
"Resource '%s' is in use.\n"
"Changes will take effect when reloaded."
msgstr ""
-"รีซอร์ส '%s' อยู่ระหว่างà¸à¸²à¸£à¹ƒà¸Šà¹‰à¸‡à¸²à¸™\n"
+"รีซอร์ส '%s' à¸à¸³à¸¥à¸±à¸‡à¸–ูà¸à¹ƒà¸Šà¹‰à¸‡à¸²à¸™\n"
"à¸à¸²à¸£à¹à¸à¹‰à¹„ขจะไม่ส่งผลจนà¸à¸§à¹ˆà¸²à¸ˆà¸°à¹‚หลดใหม่"
#: editor/dependency_editor.cpp
-#, fuzzy
msgid "Dependencies"
msgstr "à¸à¸²à¸£à¸­à¹‰à¸²à¸‡à¸­à¸´à¸‡"
#: editor/dependency_editor.cpp
-#, fuzzy
msgid "Resource"
msgstr "รีซอร์ส"
#: editor/dependency_editor.cpp editor/editor_autoload_settings.cpp
#: editor/project_manager.cpp editor/project_settings.cpp
-#, fuzzy
+#: editor/script_create_dialog.cpp
msgid "Path"
msgstr "ตำà¹à¸«à¸™à¹ˆà¸‡"
#: editor/dependency_editor.cpp
-#, fuzzy
msgid "Dependencies:"
msgstr "à¸à¸²à¸£à¸­à¹‰à¸²à¸‡à¸­à¸´à¸‡:"
#: editor/dependency_editor.cpp
-#, fuzzy
msgid "Fix Broken"
msgstr "ซ่อมà¹à¸‹à¸¡"
@@ -955,7 +885,6 @@ msgid "Error loading:"
msgstr "ผิดพลาดขณะโหลด:"
#: editor/dependency_editor.cpp
-#, fuzzy
msgid "Scene failed to load due to missing dependencies:"
msgstr "โหลดฉาà¸à¹„ม่ได้เนื่องจาà¸à¸à¸²à¸£à¸­à¹‰à¸²à¸‡à¸­à¸´à¸‡à¸ªà¸¹à¸à¸«à¸²à¸¢:"
@@ -992,36 +921,32 @@ msgid "Orphan Resource Explorer"
msgstr "ตัวจัดà¸à¸²à¸£à¸£à¸µà¸‹à¸­à¸£à¹Œà¸ªà¸—ี่ไม่มีเจ้าของ"
#: editor/dependency_editor.cpp
-#, fuzzy
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
-#, fuzzy
msgid "Delete"
msgstr "ลบ"
#: editor/editor_audio_buses.cpp
msgid "Save Audio Bus Layout As.."
-msgstr ""
+msgstr "บันทึà¸à¹€à¸¥à¸¢à¹Œà¹€à¸­à¸²à¸•์ของ Audio 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 "เปิดเลย์เอาต์ของ Audio 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 "โหลด"
@@ -1031,31 +956,27 @@ 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
-#, fuzzy
msgid "Invalid name."
msgstr "ชื่อผิดพลาด"
#: editor/editor_autoload_settings.cpp
-#, fuzzy
msgid "Valid characters:"
msgstr "ตัวอัà¸à¸©à¸£à¸—ี่ใช้ได้:"
#: editor/editor_autoload_settings.cpp
-#, fuzzy
msgid "Invalid name. Must not collide with an existing engine class name."
msgstr "ชื่อผิดพลาด ต้องไม่ใช้ชื่อเดียวà¸à¸±à¸šà¸„ลาสของโปรà¹à¸à¸£à¸¡"
#: editor/editor_autoload_settings.cpp
-#, fuzzy
msgid "Invalid name. Must not collide with an existing buit-in type name."
msgstr "ชื่อผิดพลาด ต้องไม่ใช้ชื่อเดียวà¸à¸±à¸šà¸Šà¸™à¸´à¸”ตัวà¹à¸›à¸£"
#: editor/editor_autoload_settings.cpp
-#, fuzzy
msgid "Invalid name. Must not collide with an existing global constant name."
msgstr "ชื่อผิดพลาด ต้องไม่ใช้ชื่อเดียวà¸à¸±à¸šà¸„่าคงที่"
@@ -1064,42 +985,34 @@ msgid "Invalid Path."
msgstr "ตำà¹à¸«à¸™à¹ˆà¸‡à¸œà¸´à¸”พลาด"
#: editor/editor_autoload_settings.cpp
-#, fuzzy
msgid "File does not exist."
msgstr "ไม่พบไฟล์"
#: editor/editor_autoload_settings.cpp
-#, fuzzy
msgid "Not in resource path."
msgstr "ไม่อยู่ในโฟลเดอร์รีซอร์ส"
#: editor/editor_autoload_settings.cpp
-#, fuzzy
msgid "Add AutoLoad"
msgstr "เพิ่มออโต้โหลด"
#: editor/editor_autoload_settings.cpp
-#, fuzzy
msgid "Autoload '%s' already exists!"
msgstr "มีออโต้โหลด '%s' อยู่à¹à¸¥à¹‰à¸§!"
#: editor/editor_autoload_settings.cpp
-#, fuzzy
msgid "Rename Autoload"
-msgstr "à¹à¸à¹‰à¹„ขชื่อออโต้โหลด"
+msgstr "เปลี่ยนชื่อออโต้โหลด"
#: editor/editor_autoload_settings.cpp
-#, fuzzy
msgid "Toggle AutoLoad Globals"
-msgstr "เปิดปิดออโต้โหลด"
+msgstr "เปิด/ปิดซิงเà¸à¸´à¸¥à¸•ัน"
#: editor/editor_autoload_settings.cpp
-#, fuzzy
msgid "Move Autoload"
-msgstr "ย้ายออโต้โหลด"
+msgstr "เลื่อนออโต้โหลด"
#: editor/editor_autoload_settings.cpp
-#, fuzzy
msgid "Remove Autoload"
msgstr "ลบออโต้โหลด"
@@ -1108,19 +1021,15 @@ msgid "Enable"
msgstr "เปิด"
#: editor/editor_autoload_settings.cpp
-#, fuzzy
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
-#, fuzzy
+#: editor/io_plugins/editor_font_import_plugin.cpp scene/gui/file_dialog.cpp
msgid "Path:"
msgstr "ตำà¹à¸«à¸™à¹ˆà¸‡:"
#: editor/editor_autoload_settings.cpp
-#, fuzzy
msgid "Node Name:"
msgstr "ชื่อโหนด:"
@@ -1131,16 +1040,14 @@ msgid "Name"
msgstr "ชื่อ"
#: editor/editor_autoload_settings.cpp
-#, fuzzy
msgid "Singleton"
-msgstr "สคริปต์เดี่ยว"
+msgstr "ซิงเà¸à¸´à¸¥à¸•ัน"
#: editor/editor_autoload_settings.cpp
msgid "List:"
msgstr "รายชื่อ:"
#: editor/editor_data.cpp
-#, fuzzy
msgid "Updating Scene"
msgstr "อัพเดทฉาà¸"
@@ -1149,18 +1056,15 @@ msgid "Storing local changes.."
msgstr "เà¸à¹‡à¸šà¸à¸²à¸£à¹€à¸›à¸¥à¸µà¹ˆà¸¢à¸™à¹à¸›à¸¥à¸‡à¸ à¸²à¸¢à¹ƒà¸™.."
#: editor/editor_data.cpp
-#, fuzzy
msgid "Updating scene.."
msgstr "อัพเดทฉาà¸.."
#: editor/editor_dir_dialog.cpp
-#, fuzzy
msgid "Choose a Directory"
msgstr "เลือà¸à¹‚ฟลเดอร์"
#: editor/editor_dir_dialog.cpp editor/editor_file_dialog.cpp
#: scene/gui/file_dialog.cpp
-#, fuzzy
msgid "Create Folder"
msgstr "สร้างโฟลเดอร์"
@@ -1172,7 +1076,6 @@ msgstr "ชื่อ:"
#: editor/editor_dir_dialog.cpp editor/editor_file_dialog.cpp
#: scene/gui/file_dialog.cpp
-#, fuzzy
msgid "Could not create folder."
msgstr "ไม่สามารถสร้างโฟลเดอร์"
@@ -1190,7 +1093,7 @@ msgstr "à¸à¸³à¸¥à¸±à¸‡à¸£à¸§à¸šà¸£à¸§à¸¡"
#: editor/editor_export.cpp platform/javascript/export/export.cpp
msgid "Template file not found:\n"
-msgstr ""
+msgstr "ไม่พบà¹à¸¡à¹ˆà¹à¸šà¸š:\n"
#: editor/editor_export.cpp
msgid "Added:"
@@ -1209,7 +1112,6 @@ msgid "Could not save atlas subtexture:"
msgstr "บันทึภtexture ย่อยของ atlas ไม่ได้:"
#: editor/editor_export.cpp
-#, fuzzy
msgid "Exporting for %s"
msgstr "ส่งออà¸à¸ªà¸³à¸«à¸£à¸±à¸š %s"
@@ -1218,17 +1120,14 @@ msgid "Setting Up.."
msgstr "à¸à¸³à¸¥à¸±à¸‡à¸•ั้งค่า.."
#: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp
-#, fuzzy
msgid "File Exists, Overwrite?"
-msgstr "มีไฟล์นี้อยู่à¹à¸¥à¹‰à¸§ เขียนทับ?"
+msgstr "มีไฟล์นี้อยู่à¹à¸¥à¹‰à¸§ จะเขียนทับหรือไม่?"
#: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp
-#, fuzzy
msgid "All Recognized"
msgstr "ทุà¸à¸™à¸²à¸¡à¸ªà¸¸à¸à¸¥à¸—ี่รู้จัà¸"
#: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp
-#, fuzzy
msgid "All Files (*)"
msgstr "ทุà¸à¹„ฟล์ (*)"
@@ -1261,39 +1160,35 @@ msgid "Go Up"
msgstr "ขึ้นบน"
#: editor/editor_file_dialog.cpp
-#, fuzzy
msgid "Refresh"
msgstr "รีเฟรช"
#: editor/editor_file_dialog.cpp
-#, fuzzy
msgid "Toggle Hidden Files"
-msgstr "เปิด/ปิด ไฟล์ที่ซ่อน"
+msgstr "เปิด/ปิดไฟล์ที่ซ่อน"
#: editor/editor_file_dialog.cpp
-#, fuzzy
msgid "Toggle Favorite"
-msgstr "เลือà¸/ลบ ที่ชื่นชอบ"
+msgstr "เลือà¸/ลบโฟลเดอร์ที่ชอบ"
#: editor/editor_file_dialog.cpp
-#, fuzzy
msgid "Toggle Mode"
msgstr "สลับโหมด"
#: editor/editor_file_dialog.cpp
+#, fuzzy
msgid "Focus Path"
-msgstr ""
+msgstr "à¹à¸à¹‰à¹„ขตำà¹à¸«à¸™à¹ˆà¸‡"
#: editor/editor_file_dialog.cpp
msgid "Move Favorite Up"
-msgstr "เลื่อนที่ชื่นชอบขึ้น"
+msgstr "เลื่อนโฟลเดอร์ที่ชอบขึ้น"
#: editor/editor_file_dialog.cpp
msgid "Move Favorite Down"
-msgstr "เลื่อนที่ชื่นชอบลง"
+msgstr "เลื่อนโฟลเดอร์ที่ชอบลง"
#: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp
-#, fuzzy
msgid "Directories & Files:"
msgstr "ไฟล์à¹à¸¥à¸°à¹‚ฟลเดอร์:"
@@ -1307,12 +1202,10 @@ msgid "File:"
msgstr "ไฟล์:"
#: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp
-#, fuzzy
msgid "Filter:"
msgstr "ตัวà¸à¸£à¸­à¸‡:"
#: editor/editor_file_dialog.cpp scene/gui/file_dialog.cpp
-#, fuzzy
msgid "Must use a valid extension."
msgstr "นามสà¸à¸¸à¸¥à¹„ฟล์ไม่ถูà¸à¸•้อง"
@@ -1321,11 +1214,11 @@ msgid "ScanSources"
msgstr ""
#: editor/editor_file_system.cpp
-#, fuzzy
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 "ค้นหาในคู่มือ"
@@ -1342,7 +1235,6 @@ msgid "Class:"
msgstr "คลาส:"
#: editor/editor_help.cpp editor/scene_tree_editor.cpp
-#: editor/script_create_dialog.cpp
msgid "Inherits:"
msgstr "สืบทอดจาà¸:"
@@ -1355,9 +1247,8 @@ msgid "Brief Description:"
msgstr "รายละเอียด:"
#: editor/editor_help.cpp modules/visual_script/visual_script_editor.cpp
-#, fuzzy
msgid "Members:"
-msgstr "สมาชิà¸:"
+msgstr "ตัวà¹à¸›à¸£:"
#: editor/editor_help.cpp
msgid "Public Methods:"
@@ -1366,10 +1257,9 @@ msgstr "เมท็อด:"
#: editor/editor_help.cpp
#, fuzzy
msgid "GUI Theme Items:"
-msgstr "ธีม:"
+msgstr "ธีมหน้าต่าง:"
#: editor/editor_help.cpp modules/visual_script/visual_script_editor.cpp
-#, fuzzy
msgid "Signals:"
msgstr "สัà¸à¸à¸²à¸“:"
@@ -1378,31 +1268,27 @@ msgid "Constants:"
msgstr "ค่าคงที่:"
#: editor/editor_help.cpp
-#, fuzzy
msgid "Property Description:"
msgstr "รายละเอียดตัวà¹à¸›à¸£:"
#: editor/editor_help.cpp
-#, fuzzy
msgid "Method Description:"
msgstr "รายละเอียดเมท็อด:"
#: editor/editor_help.cpp
-#, fuzzy
msgid "Search Text"
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
-#, fuzzy
msgid "Clear"
-msgstr "ลบทั้งหมด"
+msgstr "ลบ"
#: editor/editor_node.cpp editor/plugins/animation_player_editor_plugin.cpp
#: editor/resources_dock.cpp
@@ -1444,10 +1330,9 @@ msgid "Creating Thumbnail"
msgstr "à¸à¸³à¸¥à¸±à¸‡à¸ªà¸£à¹‰à¸²à¸‡à¸£à¸¹à¸›à¸•ัวอย่าง"
#: editor/editor_node.cpp
-#, fuzzy
msgid ""
"Couldn't save scene. Likely dependencies (instances) couldn't be satisfied."
-msgstr "บันทึà¸à¸‰à¸²à¸à¹„ม่ได้"
+msgstr "บันทึà¸à¸‰à¸²à¸à¹„ม่ได้ อาจจะมีà¸à¸²à¸£à¸­à¹‰à¸²à¸‡à¸­à¸´à¸‡à¹„ม่สมบูรณ์"
#: editor/editor_node.cpp
msgid "Failed to load resource."
@@ -1470,32 +1355,26 @@ msgid "Error saving TileSet!"
msgstr "ผิดพลาดขณะบันทึภTileSet!"
#: editor/editor_node.cpp
-#, fuzzy
msgid "Error trying to save layout!"
msgstr "ผิดพลาดขณะบันทึà¸à¹€à¸¥à¸¢à¹Œà¹€à¸­à¸²à¸•์!"
#: editor/editor_node.cpp
-#, fuzzy
msgid "Default editor layout overridden."
msgstr "à¹à¸—นที่เลย์เอาต์เริ่มต้น"
#: editor/editor_node.cpp
-#, fuzzy
msgid "Layout name not found!"
msgstr "ไม่พบชื่อเลย์เอาต์!"
#: editor/editor_node.cpp
-#, fuzzy
msgid "Restored default layout to base settings."
-msgstr "คืนà¸à¸¥à¸±à¸šà¹€à¸¥à¸¢à¹Œà¹€à¸­à¸²à¸•์เป็นค่าเริ่มต้น"
+msgstr "คืนเลย์เอาต์เป็นค่าเริ่มต้น"
#: editor/editor_node.cpp
-#, fuzzy
msgid "Copy Params"
msgstr "คัดลอà¸à¸•ัวà¹à¸›à¸£"
#: editor/editor_node.cpp
-#, fuzzy
msgid "Paste Params"
msgstr "วางตัวà¹à¸›à¸£"
@@ -1508,7 +1387,6 @@ msgid "Copy Resource"
msgstr "คัดลอà¸à¸£à¸µà¸‹à¸­à¸£à¹Œà¸ª"
#: editor/editor_node.cpp
-#, fuzzy
msgid "Make Built-In"
msgstr "à¸à¸±à¸‡"
@@ -1521,18 +1399,18 @@ msgid "Open in Help"
msgstr "เปิดในคู่มือ"
#: editor/editor_node.cpp
-#, fuzzy
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'"
+"ยังไม่ได้à¸à¸³à¸«à¸™à¸”ฉาà¸à¹€à¸£à¸´à¹ˆà¸¡à¸•้น à¸à¸³à¸«à¸™à¸”ตอนนี้หรือไม่?\n"
+"สามารถà¹à¸à¹‰à¹„ขภายหลังที่ \"ตัวเลือà¸à¹‚ปรเจà¸à¸•์\" ใต้หัวข้อ 'application'"
#: editor/editor_node.cpp
msgid ""
@@ -1540,8 +1418,8 @@ msgid ""
"You can change it later in \"Project Settings\" under the 'application' "
"category."
msgstr ""
-"ไม่มีฉาภ'%s' ที่เลือà¸à¹„ว้ เลือà¸à¹ƒà¸«à¸¡à¹ˆà¸•อนนี้?\n"
-"สามารถเปลี่ยนได้ภายหลังที่ \"ตัวเลือà¸à¹‚ปรเจà¸à¸•์\" หัวข้อย่อย 'application'"
+"ไม่มีฉาภ'%s' ที่เลือà¸à¹„ว้ เลือà¸à¹ƒà¸«à¸¡à¹ˆà¸•อนนี้หรือไม่?\n"
+"สามารถà¹à¸à¹‰à¹„ขภายหลังที่ \"ตัวเลือà¸à¹‚ปรเจà¸à¸•์\" ใต้หัวข้อ 'application'"
#: editor/editor_node.cpp
msgid ""
@@ -1549,8 +1427,8 @@ msgid ""
"You can change it later in \"Project Settings\" under the 'application' "
"category."
msgstr ""
-"'%s' ไม่ใช่ไฟล์ฉาภเลือà¸à¹ƒà¸«à¸¡à¹ˆà¸•อนนี้?\n"
-"สามารถเปลี่ยนได้ภายหลังที่ \"ตัวเลือà¸à¹‚ปรเจà¸à¸•์\" หัวข้อย่อย 'application'"
+"'%s' ไม่ใช่ไฟล์ฉาภเลือà¸à¹ƒà¸«à¸¡à¹ˆà¸•อนนี้หรือไม่?\n"
+"สามารถà¹à¸à¹‰à¹„ขภายหลังที่ \"ตัวเลือà¸à¹‚ปรเจà¸à¸•์\" ใต้หัวข้อ 'application'"
#: editor/editor_node.cpp
msgid "Current scene was never saved, please save it prior to running."
@@ -1558,7 +1436,7 @@ msgstr "ฉาà¸à¸›à¸±à¸ˆà¸ˆà¸¸à¸šà¸±à¸™à¸¢à¸±à¸‡à¹„ม่ได้บันท
#: editor/editor_node.cpp
msgid "Could not start subprocess!"
-msgstr ""
+msgstr "ไม่สามารถเริ่มขั้นตอนย่อย!"
#: editor/editor_node.cpp
msgid "Open Scene"
@@ -1569,12 +1447,10 @@ msgid "Open Base Scene"
msgstr "เปิดไฟล์ฉาà¸à¸—ี่ใช้สืบทอด"
#: editor/editor_node.cpp
-#, fuzzy
msgid "Quick Open Scene.."
msgstr "เปิดไฟล์ฉาà¸à¸”่วน.."
#: editor/editor_node.cpp
-#, fuzzy
msgid "Quick Open Script.."
msgstr "เปิดไฟล์สคริปต์ด่วน.."
@@ -1591,6 +1467,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 "ฉาà¸à¸™à¸µà¹‰à¸¢à¸±à¸‡à¹„ม่ได้บันทึภบันทึà¸à¸à¹ˆà¸­à¸™à¹€à¸£à¸´à¹ˆà¸¡?"
@@ -1607,7 +1488,6 @@ msgid "Quit"
msgstr "ออà¸"
#: editor/editor_node.cpp
-#, fuzzy
msgid "Exit the editor?"
msgstr "ออà¸à¹‚ปรà¹à¸à¸£à¸¡?"
@@ -1620,12 +1500,10 @@ msgid "Can't reload a scene that was never saved."
msgstr "ฉาà¸à¸¢à¸±à¸‡à¹„ม่ได้บันทึภไม่สามารถโหลดใหม่ได้"
#: editor/editor_node.cpp
-#, fuzzy
msgid "Revert"
msgstr "คืนà¸à¸¥à¸±à¸š"
#: editor/editor_node.cpp
-#, fuzzy
msgid "This action cannot be undone. Revert anyway?"
msgstr "à¸à¸²à¸£à¸„ืนà¸à¸¥à¸±à¸šà¹„ม่สามารถยà¸à¹€à¸¥à¸´à¸à¹„ด้ คืนà¸à¸¥à¸±à¸š?"
@@ -1650,11 +1528,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 ""
+"ฉาภ'%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 "เอ่อะ"
+msgstr "เออะ"
#: editor/editor_node.cpp
msgid ""
@@ -1673,12 +1553,10 @@ msgid "Scene '%s' has broken dependencies:"
msgstr "ฉาภ'%s' มีà¸à¸²à¸£à¸­à¹‰à¸²à¸‡à¸­à¸´à¸‡à¸ªà¸¹à¸à¸«à¸²à¸¢:"
#: editor/editor_node.cpp
-#, fuzzy
msgid "Save Layout"
msgstr "บันทึà¸à¹€à¸¥à¸¢à¹Œà¹€à¸­à¸²à¸•์"
#: editor/editor_node.cpp
-#, fuzzy
msgid "Delete Layout"
msgstr "ลบเลย์เอาต์"
@@ -1687,17 +1565,18 @@ msgid "Switch Scene Tab"
msgstr "สลับฉาà¸"
#: editor/editor_node.cpp
-#, fuzzy
msgid "%d more file(s)"
msgstr "à¹à¸¥à¸°à¸­à¸µà¸ %d ไฟล์"
#: editor/editor_node.cpp
-#, fuzzy
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 "ฉาà¸"
@@ -1706,19 +1585,16 @@ msgid "Go to previously opened scene."
msgstr "ไปยังฉาà¸à¸—ี่เพิ่งเปิด"
#: editor/editor_node.cpp
-#, fuzzy
msgid "Next tab"
msgstr "à¹à¸—็บต่อไป"
#: editor/editor_node.cpp
-#, fuzzy
msgid "Previous tab"
msgstr "à¹à¸—็บà¸à¹ˆà¸­à¸™à¸«à¸™à¹‰à¸²"
#: editor/editor_node.cpp
-#, fuzzy
msgid "Filter Files.."
-msgstr "à¸à¸£à¸­à¸‡à¹„ฟล์ด่วน.."
+msgstr "คัดà¸à¸£à¸­à¸‡à¹„ฟล์.."
#: editor/editor_node.cpp
msgid "Operations with scene files."
@@ -1752,7 +1628,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 "เปิดไฟล์ล่าสุด"
@@ -1762,105 +1638,59 @@ msgstr "à¹à¸›à¸¥à¸‡à¹€à¸›à¹‡à¸™.."
#: editor/editor_node.cpp
msgid "MeshLibrary.."
-msgstr "M"
+msgstr "MeshLibrary.."
#: editor/editor_node.cpp
msgid "TileSet.."
-msgstr ""
+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
-#, fuzzy
msgid "Undo"
msgstr "เลิà¸à¸—ำ"
#: editor/editor_node.cpp editor/plugins/script_text_editor.cpp
#: editor/plugins/shader_editor_plugin.cpp
-#, fuzzy
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 "ปิดà¹à¸¥à¸°à¸à¸¥à¸±à¸šà¸ªà¸¹à¹ˆà¸£à¸²à¸¢à¸Šà¸·à¹ˆà¸­à¹‚ปรเจà¸à¸•์"
+msgid "Miscellaneous project or scene-wide tools."
+msgstr "โปรเจà¸à¸•์à¹à¸¥à¸°à¹€à¸„รื่องมืออื่น ๆ"
#: editor/editor_node.cpp
#, fuzzy
-msgid "Distraction Free Mode"
-msgstr "โหมดไร้สิ่งรบà¸à¸§à¸™"
-
-#: editor/editor_node.cpp
-msgid "Miscellaneous project or scene-wide tools."
-msgstr ""
+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 "เล่นโปรเจà¸à¸•์"
-
-#: 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"
@@ -1885,10 +1715,9 @@ msgid ""
"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 เพื่อประสิทธิภาพที่ดีà¸à¸§à¹ˆà¸² "
-"ตัวเลือà¸à¸™à¸µà¹‰à¸ˆà¸°à¸Šà¹ˆà¸§à¸¢à¹ƒà¸™à¸à¸²à¸£à¸—ดสอบเà¸à¸¡à¸—ี่มีขนาดใหà¸à¹ˆ"
+"ถ้าเปิดตัวเลือà¸à¸™à¸µà¹‰ ตัวเà¸à¸¡à¸—ี่ส่งออà¸à¸ˆà¸°à¸¡à¸µà¸‚นาดà¹à¸„่พอใช้งานได้\n"
+"ตัวเà¸à¸¡à¸ˆà¸°à¹„ด้รับระบบไฟล์จาà¸à¹‚ปรà¹à¸à¸£à¸¡à¹à¸à¹‰à¹„ขผ่านเครือข่าย\n"
+"à¸à¸²à¸£à¸ªà¹ˆà¸‡à¸­à¸­à¸à¸šà¸™ Android จะใช้สาย USB เพื่อให้เร็วขึ้น ตัวเลือà¸à¸™à¸µà¹‰à¸ˆà¸°à¸Šà¹ˆà¸§à¸¢à¹ƒà¸™à¸à¸²à¸£à¸—ดสอบเà¸à¸¡à¸—ี่มีขนาดใหà¸à¹ˆ"
#: editor/editor_node.cpp
msgid "Visible Collision Shapes"
@@ -1925,7 +1754,6 @@ msgstr ""
"เมื่อใช้à¸à¸±à¸šà¸­à¸¸à¸›à¸à¸£à¸“์à¹à¸šà¸šà¸£à¸µà¹‚มท จะดีà¸à¸§à¹ˆà¸²à¸–้าเปิดระบบไฟล์เครือข่ายด้วย"
#: editor/editor_node.cpp
-#, fuzzy
msgid "Sync Script Changes"
msgstr "ซิงค์à¸à¸²à¸£à¹à¸à¹‰à¹„ขสคริปต์"
@@ -1939,9 +1767,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"
@@ -1956,21 +1785,75 @@ 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
-#, fuzzy
msgid "Spins when the editor window repaints!"
msgstr "หมุนเมื่อมีà¸à¸²à¸£à¸§à¸²à¸”หน้าต่างโปรà¹à¸à¸£à¸¡à¹ƒà¸«à¸¡à¹ˆ!"
@@ -1988,7 +1871,7 @@ msgstr "ปิดà¸à¸²à¸£à¸­à¸±à¸žà¹€à¸”ทตัวหมุน"
#: editor/editor_node.cpp
msgid "Inspector"
-msgstr "ตัวตรวจสอบ"
+msgstr "คุณสมบัติ"
#: editor/editor_node.cpp
msgid "Create a new resource in memory and edit it."
@@ -2031,7 +1914,6 @@ msgid "Node"
msgstr "โหนด"
#: editor/editor_node.cpp
-#, fuzzy
msgid "Output"
msgstr "เอาท์พุต"
@@ -2052,6 +1934,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"
@@ -2060,7 +1950,6 @@ msgid "Export Project"
msgstr "ส่งออà¸à¹‚ปรเจà¸à¸•์"
#: editor/editor_node.cpp
-#, fuzzy
msgid "Export Library"
msgstr "ส่งออà¸à¹„ลบรารี"
@@ -2080,6 +1969,36 @@ 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 "ปลั๊à¸à¸­à¸´à¸™à¸—ี่ติดตั้งà¹à¸¥à¹‰à¸§:"
@@ -2170,7 +2089,7 @@ msgstr "สร้างอินสà¹à¸•นซ์ของสคริปต์
#: editor/editor_run_script.cpp
msgid "Did you forget the 'tool' keyword?"
-msgstr "ลืมคีย์เวิร์ด 'tool' หรือเปล่า?"
+msgstr "ลืมคีย์เวิร์ด 'tool' หรือไม่?"
#: editor/editor_run_script.cpp
msgid "Couldn't run script:"
@@ -2178,7 +2097,7 @@ msgstr "รันสคริปต์ไม่ได้:"
#: editor/editor_run_script.cpp
msgid "Did you forget the '_run' method?"
-msgstr "ลืมใส่เมท็อด '_run' หรือเปล่า?"
+msgstr "ลืมใส่เมท็อด '_run' หรือไม่?"
#: editor/editor_settings.cpp
msgid "Default (Same as Editor)"
@@ -2197,37 +2116,32 @@ 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."
@@ -2235,22 +2149,22 @@ msgstr "เปิดไฟล์ zip à¹à¸¡à¹ˆà¹à¸šà¸šà¸ªà¹ˆà¸‡à¸­à¸­à¸à¹„มà
#: editor/export_template_manager.cpp
msgid "Invalid version.txt format inside templates."
-msgstr ""
+msgstr "รูปà¹à¸šà¸šà¸‚อง version.txt ในà¹à¸¡à¹ˆà¹à¸šà¸šà¹„ม่ถูà¸à¸•้อง"
#: editor/export_template_manager.cpp
+#, fuzzy
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 "ผิดพลาดขณะบันทึภatlas:"
+msgstr "ผิดพลาดขณะสร้างตำà¹à¸«à¸™à¹ˆà¸‡à¹à¸¡à¹ˆà¹à¸šà¸š:\n"
#: editor/export_template_manager.cpp
#, fuzzy
@@ -2266,34 +2180,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!"
@@ -2301,7 +2209,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."
@@ -2329,11 +2237,15 @@ msgstr "ไม่ได้เลือà¸à¹„ฟล์ไว้!"
#: editor/filesystem_dock.cpp
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"
@@ -2364,10 +2276,6 @@ msgid "Info"
msgstr "ข้อมูล"
#: editor/filesystem_dock.cpp
-msgid "Show In File Manager"
-msgstr "à¹à¸ªà¸”งในตัวจัดà¸à¸²à¸£à¹„ฟล์"
-
-#: editor/filesystem_dock.cpp
msgid "Re-Import.."
msgstr "นำเข้าอีà¸à¸„รั้ง.."
@@ -2445,23 +2353,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 ""
+msgstr "à¹à¸šà¸š.."
#: editor/import_dock.cpp
-#, fuzzy
msgid "Reimport"
-msgstr "นำเข้าอีà¸à¸„รั้ง"
+msgstr "นำเข้าใหม่"
#: editor/io_plugins/editor_bitmask_import_plugin.cpp
msgid "No bit masks to import!"
@@ -2534,9 +2439,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"
@@ -2597,7 +2503,6 @@ msgstr "ผิดพลาดขณะเริ่มต้น FreeType"
#: editor/io_plugins/editor_font_import_plugin.cpp
#: scene/resources/dynamic_font.cpp
-#, fuzzy
msgid "Unknown font format."
msgstr "ไม่ทราบประเภทของฟอนต์"
@@ -2608,7 +2513,6 @@ msgstr "ผิดพลาดขณะโหลดฟอนต์"
#: editor/io_plugins/editor_font_import_plugin.cpp
#: scene/resources/dynamic_font.cpp
-#, fuzzy
msgid "Invalid font size."
msgstr "ขนาดฟอนต์ผิดพลาด"
@@ -2750,7 +2654,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"
@@ -3017,8 +2921,8 @@ msgstr "บีบอัด"
#: editor/io_plugins/editor_translation_import_plugin.cpp
#, fuzzy
-msgid "Add to Project (godot.cfg)"
-msgstr "เพิ่มเข้าโปรเจà¸à¸•์ (engine.cfg)"
+msgid "Add to Project (project.godot)"
+msgstr "เพิ่มเข้าโปรเจà¸à¸•์ (godot.cfg)"
#: editor/io_plugins/editor_translation_import_plugin.cpp
msgid "Import Languages:"
@@ -3057,9 +2961,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
@@ -3146,7 +3049,7 @@ 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."
@@ -3224,7 +3127,7 @@ 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):"
@@ -3236,15 +3139,16 @@ msgstr "เฟดออภ(วิ):"
#: editor/plugins/animation_tree_editor_plugin.cpp
msgid "Blend"
-msgstr ""
+msgstr "ผสม"
#: editor/plugins/animation_tree_editor_plugin.cpp
+#, fuzzy
msgid "Mix"
-msgstr ""
+msgstr "ร่วม"
#: editor/plugins/animation_tree_editor_plugin.cpp
msgid "Auto Restart:"
-msgstr ""
+msgstr "เริ่มใหม่อัตโนมัติ:"
#: editor/plugins/animation_tree_editor_plugin.cpp
msgid "Restart (s):"
@@ -3265,19 +3169,19 @@ msgstr "จำนวน:"
#: editor/plugins/animation_tree_editor_plugin.cpp
msgid "Blend:"
-msgstr ""
+msgstr "ผสม:"
#: editor/plugins/animation_tree_editor_plugin.cpp
msgid "Blend 0:"
-msgstr ""
+msgstr "ผสม 0:"
#: editor/plugins/animation_tree_editor_plugin.cpp
msgid "Blend 1:"
-msgstr ""
+msgstr "ผสม 1:"
#: editor/plugins/animation_tree_editor_plugin.cpp
msgid "X-Fade Time (s):"
-msgstr ""
+msgstr "ระยะเวลาเฟด (วินาที):"
#: editor/plugins/animation_tree_editor_plugin.cpp
msgid "Current:"
@@ -3285,7 +3189,7 @@ msgstr "ปัจจุบัน:"
#: editor/plugins/animation_tree_editor_plugin.cpp
msgid "Add Input"
-msgstr ""
+msgstr "เพิ่มอินพุต"
#: editor/plugins/animation_tree_editor_plugin.cpp
msgid "Clear Auto-Advance"
@@ -3297,7 +3201,7 @@ msgstr ""
#: editor/plugins/animation_tree_editor_plugin.cpp
msgid "Delete Input"
-msgstr ""
+msgstr "ลบอินพุต"
#: editor/plugins/animation_tree_editor_plugin.cpp
msgid "Rename"
@@ -3317,31 +3221,31 @@ msgstr "โหนดà¹à¸­à¸™à¸´à¹€à¸¡à¸Šà¸±à¸™"
#: editor/plugins/animation_tree_editor_plugin.cpp
msgid "OneShot Node"
-msgstr ""
+msgstr "โหนด OneShot"
#: 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 "โหนด Blend2"
#: editor/plugins/animation_tree_editor_plugin.cpp
msgid "Blend3 Node"
-msgstr ""
+msgstr "โหนด Blend3"
#: editor/plugins/animation_tree_editor_plugin.cpp
msgid "Blend4 Node"
-msgstr ""
+msgstr "โหนด Blend4"
#: editor/plugins/animation_tree_editor_plugin.cpp
msgid "TimeScale Node"
-msgstr ""
+msgstr "โหนดอัตราส่วนเวลา"
#: editor/plugins/animation_tree_editor_plugin.cpp
msgid "TimeSeek Node"
-msgstr ""
+msgstr "โหนด TimeSeek"
#: editor/plugins/animation_tree_editor_plugin.cpp
msgid "Transition Node"
@@ -3473,7 +3377,7 @@ msgstr "วางท่าทาง"
#: editor/plugins/canvas_item_editor_plugin.cpp
msgid "Select Mode"
-msgstr "เลือà¸à¹‚หมด"
+msgstr "โหมดเลือà¸"
#: editor/plugins/canvas_item_editor_plugin.cpp
msgid "Drag: Rotate"
@@ -3488,7 +3392,6 @@ msgid "Press 'v' to Change Pivot, 'Shift+v' to Drag Pivot (while moving)."
msgstr "à¸à¸” 'v' เพื่อเปลี่ยนจุดหมุน 'Shift+v' เพื่อลาà¸à¸ˆà¸¸à¸”หมุน"
#: editor/plugins/canvas_item_editor_plugin.cpp
-#, fuzzy
msgid "Alt+RMB: Depth list selection"
msgstr "Alt+คลิà¸à¸‚วา: เลือà¸à¸—ี่ซ้อนà¸à¸±à¸™"
@@ -3518,12 +3421,10 @@ msgid "Pan Mode"
msgstr "โหมดมุมมอง"
#: editor/plugins/canvas_item_editor_plugin.cpp
-#, fuzzy
msgid "Lock the selected object in place (can't be moved)."
msgstr "ล็อคไม่ให้วัตถุที่เลือà¸à¸¢à¹‰à¸²à¸¢à¸•ำà¹à¸«à¸™à¹ˆà¸‡"
#: editor/plugins/canvas_item_editor_plugin.cpp
-#, fuzzy
msgid "Unlock the selected object (can be moved)."
msgstr "ปลดล็อควัตถุที่เลือà¸"
@@ -3572,7 +3473,7 @@ msgstr "ใช้ Snap พิà¸à¹€à¸‹à¸¥"
#: editor/plugins/canvas_item_editor_plugin.cpp
msgid "Expand to Parent"
-msgstr ""
+msgstr "ขยายให้เต็มโหนดà¹à¸¡à¹ˆ"
#: editor/plugins/canvas_item_editor_plugin.cpp
msgid "Skeleton.."
@@ -3684,7 +3585,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 "ตà¸à¸¥à¸‡"
@@ -3735,19 +3636,6 @@ msgstr "à¹à¸à¹‰à¹„ขรูปหลายเหลี่ยม 3D"
msgid "Set Handle"
msgstr ""
-#: editor/plugins/color_ramp_editor_plugin.cpp
-#: editor/plugins/gradient_texture_editor_plugin.cpp
-#, fuzzy
-msgid "Add/Remove Color Ramp Point"
-msgstr "เพิ่ม/ลบตำà¹à¸«à¸™à¹ˆà¸‡à¸ªà¸µ"
-
-#: editor/plugins/color_ramp_editor_plugin.cpp
-#: editor/plugins/gradient_texture_editor_plugin.cpp
-#: editor/plugins/shader_graph_editor_plugin.cpp
-#, fuzzy
-msgid "Modify Color Ramp"
-msgstr "à¹à¸à¹‰à¹„ขà¸à¸²à¸£à¹„ล่สี"
-
#: editor/plugins/cube_grid_theme_editor_plugin.cpp
msgid "Creating Mesh Library"
msgstr "à¸à¸³à¸¥à¸±à¸‡à¸ªà¸£à¹‰à¸²à¸‡ Mesh Library"
@@ -3780,7 +3668,30 @@ 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
@@ -3820,19 +3731,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 "เพิ่มจุดในเส้นโค้ง"
+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
@@ -3844,7 +3752,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+ลาà¸: เลือà¸à¹€à¸ªà¹‰à¸™à¸ªà¸±à¸¡à¸œà¸±à¸ª"
#: editor/plugins/line_2d_editor_plugin.cpp
#: editor/plugins/path_2d_editor_plugin.cpp
@@ -3865,9 +3773,8 @@ msgid "Add Point (in empty space)"
msgstr "เพิ่มจุด (ในที่ว่าง)"
#: editor/plugins/line_2d_editor_plugin.cpp
-#, fuzzy
msgid "Split Segment (in line)"
-msgstr "à¹à¸¢à¸à¸ªà¹ˆà¸§à¸™ (ในเส้นโค้ง)"
+msgstr "à¹à¸¢à¸à¸ªà¹ˆà¸§à¸™ (ในเส้น)"
#: editor/plugins/line_2d_editor_plugin.cpp
#: editor/plugins/path_2d_editor_plugin.cpp
@@ -4056,6 +3963,20 @@ 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 "ผิดพลาดขณะโหลดรูป:"
@@ -4068,8 +3989,8 @@ msgid "Set Emission Mask"
msgstr "à¸à¸³à¸«à¸™à¸” Mask à¸à¸²à¸£à¸›à¸¥à¹ˆà¸­à¸¢"
#: editor/plugins/particles_2d_editor_plugin.cpp
-msgid "Clear Emission Mask"
-msgstr "ลบ Mask à¸à¸²à¸£à¸›à¸¥à¹ˆà¸­à¸¢"
+msgid "Generate Visibility Rect"
+msgstr ""
#: editor/plugins/particles_2d_editor_plugin.cpp
msgid "Load Emission Mask"
@@ -4079,6 +4000,27 @@ msgstr "โหลด 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 "à¸à¸³à¸«à¸™à¸” 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"
@@ -4092,11 +4034,6 @@ msgid "A processor material of type 'ParticlesMaterial' is required."
msgstr ""
#: editor/plugins/particles_editor_plugin.cpp
-#, fuzzy
-msgid "Generating AABB"
-msgstr "สร้าง AABB"
-
-#: editor/plugins/particles_editor_plugin.cpp
msgid "Faces contain no area!"
msgstr "หน้าไม่มีพื้นที่!"
@@ -4125,14 +4062,12 @@ msgid "Create Emitter"
msgstr ""
#: editor/plugins/particles_editor_plugin.cpp
-#, fuzzy
msgid "Emission Points:"
-msgstr "à¸à¸³à¸«à¸™à¸” Mask à¸à¸²à¸£à¸›à¸¥à¹ˆà¸­à¸¢"
+msgstr ""
#: editor/plugins/particles_editor_plugin.cpp
-#, fuzzy
msgid "Surface Points"
-msgstr "%d พื้นผิว"
+msgstr ""
#: editor/plugins/particles_editor_plugin.cpp
msgid "Surface Points+Normal (Directed)"
@@ -4151,13 +4086,18 @@ msgstr ""
msgid "Generate Visibility AABB"
msgstr "สร้าง AABB"
-#: editor/plugins/particles_editor_plugin.cpp
+#: editor/plugins/path_2d_editor_plugin.cpp
+msgid "Remove Point from Curve"
+msgstr "ลบจุดในเส้นโค้ง"
+
+#: editor/plugins/path_2d_editor_plugin.cpp
#, fuzzy
-msgid "Generation Time (sec):"
-msgstr "เวลาเฉลี่ย (วินาที)"
+msgid "Remove Out-Control from Curve"
+msgstr "ลบจุดในเส้นโค้ง"
#: editor/plugins/path_2d_editor_plugin.cpp
-msgid "Remove Point from Curve"
+#, fuzzy
+msgid "Remove In-Control from Curve"
msgstr "ลบจุดในเส้นโค้ง"
#: editor/plugins/path_2d_editor_plugin.cpp
@@ -4179,7 +4119,7 @@ msgstr ""
#: editor/plugins/path_2d_editor_plugin.cpp
msgid "Select Control Points (Shift+Drag)"
-msgstr "เลือà¸à¸ˆà¸¸à¸”ควบคุม (Shift+ลาà¸)"
+msgstr "เลือà¸à¹€à¸ªà¹‰à¸™à¸ªà¸±à¸¡à¸œà¸±à¸ª (Shift+ลาà¸)"
#: editor/plugins/path_2d_editor_plugin.cpp
#: editor/plugins/path_editor_plugin.cpp
@@ -4215,6 +4155,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"
@@ -4368,6 +4318,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 "ผิดพลาดขณะบันทึà¸à¸˜à¸µà¸¡"
@@ -4455,17 +4410,13 @@ 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 ""
+msgstr "บรรทัดต่อไป"
#: editor/plugins/script_editor_plugin.cpp editor/script_editor_debugger.cpp
msgid "Step Into"
-msgstr ""
+msgstr "คำสั่งต่อไป"
#: editor/plugins/script_editor_plugin.cpp editor/script_editor_debugger.cpp
msgid "Break"
@@ -4492,16 +4443,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."
@@ -4520,9 +4464,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"
@@ -4554,11 +4497,27 @@ msgid ""
msgstr "สคริปต์à¸à¸±à¸‡à¸ˆà¸°à¹à¸à¹‰à¹„ขได้ต่อเมื่อฉาà¸à¸—ี่à¸à¸±à¸‡à¸ªà¸„ริปต์นั้นถูà¸à¹€à¸›à¸´à¸”อยู่"
#: editor/plugins/script_text_editor.cpp
-#, fuzzy
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"
@@ -4593,9 +4552,8 @@ msgid "Indent Right"
msgstr "ย่อหน้าขวา"
#: editor/plugins/script_text_editor.cpp
-#, fuzzy
msgid "Toggle Comment"
-msgstr "เปิดปิด ความคิดเห็น"
+msgstr "เปิด/ปิด ความคิดเห็น"
#: editor/plugins/script_text_editor.cpp
msgid "Clone Down"
@@ -4623,21 +4581,30 @@ msgstr "ย่อหน้าอัตโนมัติ"
#: editor/plugins/script_text_editor.cpp
#: modules/visual_script/visual_script_editor.cpp
-#, fuzzy
msgid "Toggle Breakpoint"
-msgstr "เปิดปิดจุดพัà¸"
+msgstr "เปิด/ปิด จุดพัà¸à¹‚ปรà¹à¸à¸£à¸¡"
#: editor/plugins/script_text_editor.cpp
msgid "Remove All Breakpoints"
-msgstr "ลบจุดพัà¸à¹‚ปรà¹à¸à¸£à¸¡à¸—ั้งหมด"
+msgstr "ลบจุดพัà¸à¸—ั้งหมด"
#: editor/plugins/script_text_editor.cpp
msgid "Goto Next Breakpoint"
-msgstr "ไปจุดพัà¸à¹‚ปรà¹à¸à¸£à¸¡à¸•่อไป"
+msgstr "ไปจุดพัà¸à¸•่อไป"
#: editor/plugins/script_text_editor.cpp
msgid "Goto Previous Breakpoint"
-msgstr "ไปจุดพัà¸à¹‚ปรà¹à¸à¸£à¸¡à¸à¹ˆà¸­à¸™à¸«à¸™à¹‰à¸²"
+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
@@ -4660,6 +4627,10 @@ 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
@@ -4735,7 +4706,6 @@ msgid "Change Comment"
msgstr "เปลี่ยนข้อคิดเห็น"
#: editor/plugins/shader_graph_editor_plugin.cpp
-#, fuzzy
msgid "Add/Remove to Color Ramp"
msgstr "เพิ่ม/ลบในà¸à¸²à¸£à¹„ล่สี"
@@ -4880,36 +4850,107 @@ 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"
-msgstr "สภาพà¹à¸§à¸”ล้อม"
+msgid "Freelook Right"
+msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Audio Listener"
-msgstr "ตัวรับเสียง"
+#, fuzzy
+msgid "Freelook Forward"
+msgstr "ไปหน้า"
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Gizmos"
+#, fuzzy
+msgid "Freelook Backwards"
+msgstr "ย้อนà¸à¸¥à¸±à¸š"
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Freelook Up"
msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "XForm Dialog"
+#, fuzzy
+msgid "Freelook Down"
+msgstr "ล้อเมาส์ลง"
+
+#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Freelook Speed Modifier"
msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "No scene selected to instance!"
+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 "Instance at Cursor"
+#, 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 "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)"
@@ -4957,34 +4998,46 @@ msgstr "à¹à¸—รà¸à¸„ีย์à¹à¸­à¸™à¸´à¹€à¸¡à¸Šà¸±à¸™"
#: editor/plugins/spatial_editor_plugin.cpp
msgid "Focus Origin"
-msgstr ""
+msgstr "มองไปที่จุดà¸à¸³à¹€à¸™à¸´à¸”"
#: editor/plugins/spatial_editor_plugin.cpp
msgid "Focus Selection"
-msgstr ""
+msgstr "มองวัตถุที่เลือà¸"
#: editor/plugins/spatial_editor_plugin.cpp
msgid "Align Selection With View"
-msgstr ""
+msgstr "ย้ายวัตถุที่เลือà¸à¸¡à¸²à¸—ี่à¸à¸¥à¹‰à¸­à¸‡"
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Transform"
-msgstr ""
+#, fuzzy
+msgid "Tool Select"
+msgstr "เลือà¸"
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Local Coords"
-msgstr "พิà¸à¸±à¸”ภายใน"
+#, fuzzy
+msgid "Tool Move"
+msgstr "ย้าย"
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Transform Dialog.."
-msgstr ""
+#, fuzzy
+msgid "Tool Rotate"
+msgstr "Ctrl: หมุน"
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Use Default Light"
-msgstr ""
+#, fuzzy
+msgid "Tool Scale"
+msgstr "อัตราส่วน:"
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Use Default sRGB"
+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
@@ -5012,22 +5065,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 "à¹à¸ªà¸”งจุดà¸à¸³à¹€à¸™à¸´à¸”"
@@ -5036,6 +5073,10 @@ msgid "View Grid"
msgstr "à¹à¸ªà¸”งเส้นตาราง"
#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Settings"
+msgstr "ตัวเลือà¸"
+
+#: editor/plugins/spatial_editor_plugin.cpp
msgid "Snap Settings"
msgstr "ตั้งค่า Snap"
@@ -5056,15 +5097,6 @@ msgid "Viewport Settings"
msgstr "ตั้งค่ามุมมอง"
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Default Light Normal:"
-msgstr ""
-
-#: editor/plugins/spatial_editor_plugin.cpp
-#, fuzzy
-msgid "Ambient Light Color:"
-msgstr "สีของà¹à¸ªà¸‡à¹‚ดยรอบ:"
-
-#: editor/plugins/spatial_editor_plugin.cpp
msgid "Perspective FOV (deg.):"
msgstr "FOV เพอร์สเปà¸à¸—ีฟ (องศา):"
@@ -5242,7 +5274,6 @@ msgid "Create Empty Template"
msgstr "สร้างà¹à¸¡à¹ˆà¹à¸šà¸šà¹€à¸›à¸¥à¹ˆà¸²"
#: editor/plugins/theme_editor_plugin.cpp
-#, fuzzy
msgid "Create Empty Editor Template"
msgstr "สร้างà¹à¸¡à¹ˆà¹à¸šà¸šà¹€à¸›à¸¥à¹ˆà¸²"
@@ -5404,23 +5435,22 @@ 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
msgid "Presets"
-msgstr ""
+msgstr "à¸à¸²à¸£à¸ªà¹ˆà¸‡à¸­à¸­à¸"
#: editor/project_export.cpp editor/project_settings.cpp
msgid "Add.."
@@ -5428,60 +5458,53 @@ msgstr "เพิ่ม.."
#: editor/project_export.cpp
msgid "Resources"
-msgstr ""
+msgstr "รีซอร์ส"
#: editor/project_export.cpp
-#, fuzzy
msgid "Export all resources in the project"
-msgstr "นำเข้าไฟล์มายังโปรเจà¸à¸•์"
+msgstr "ส่งออà¸à¸—ุà¸à¸£à¸µà¸‹à¸­à¸£à¹Œà¸ªà¹ƒà¸™à¹‚ปรเจà¸à¸•์"
#: editor/project_export.cpp
msgid "Export selected scenes (and dependencies)"
-msgstr ""
+msgstr "ส่งออà¸à¸‰à¸²à¸à¸—ี่เลือภ(รวมถึงà¸à¸²à¸£à¸­à¹‰à¸²à¸‡à¸­à¸´à¸‡)"
#: editor/project_export.cpp
msgid "Export selected resources (and dependencies)"
-msgstr ""
+msgstr "ส่งออà¸à¸£à¸µà¸‹à¸­à¸£à¹Œà¸ªà¸—ี่เลือภ(รวมถึงà¸à¸²à¸£à¸­à¹‰à¸²à¸‡à¸­à¸´à¸‡)"
#: editor/project_export.cpp
msgid "Export Mode:"
-msgstr ""
+msgstr "วิธีà¸à¸²à¸£à¸ªà¹ˆà¸‡à¸­à¸­à¸:"
#: editor/project_export.cpp
-#, fuzzy
msgid "Resources to export:"
-msgstr "รีซอร์ส:"
+msgstr "รีซอร์สที่จะส่งออà¸:"
#: editor/project_export.cpp
-#, fuzzy
msgid ""
"Filters to export non-resource files (comma separated, e.g: *.json, *.txt)"
-msgstr "ตัวà¸à¸£à¸­à¸‡à¹„ฟล์ที่จะส่งออà¸à¹€à¸žà¸´à¹ˆà¸¡à¹€à¸•ิม (คั่นด้วยจุลภาค ตัวอย่างเช่น: *.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):"
+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 "ส่งออภTile Set"
+msgstr "ส่งออà¸à¸žà¸£à¹‰à¸­à¸¡à¸•ัวดีบัค"
#: editor/project_manager.cpp
msgid "Invalid project path, the path must exist!"
@@ -5489,13 +5512,13 @@ msgstr "ที่อยู่โปรเจà¸à¸•์ผิดพลาด ตà¹
#: editor/project_manager.cpp
#, fuzzy
-msgid "Invalid project path, *.godot must not exist."
-msgstr "ที่อยู่โปรเจà¸à¸•์ผิดพลาด ต้องไม่มี engine.cfg"
+msgid "Invalid project path, project.godot must not exist."
+msgstr "ที่อยู่โปรเจà¸à¸•์ผิดพลาด ต้องไม่มี godot.cfg"
#: editor/project_manager.cpp
#, fuzzy
-msgid "Invalid project path, *.godot must exist."
-msgstr "ที่อยู่โปรเจà¸à¸•์ผิดพลาด ต้องมี engine.cfg"
+msgid "Invalid project path, project.godot must exist."
+msgstr "ที่อยู่โปรเจà¸à¸•์ผิดพลาด ต้องมี godot.cfg"
#: editor/project_manager.cpp
msgid "Imported Project"
@@ -5503,16 +5526,17 @@ msgstr "นำเข้าโปรเจà¸à¸•์à¹à¸¥à¹‰à¸§"
#: editor/project_manager.cpp
msgid "Invalid project path (changed anything?)."
-msgstr ""
+msgstr "ตำà¹à¸«à¸™à¹ˆà¸‡à¹‚ปรเจà¸à¸•์ผิดพลาด (ได้à¹à¸à¹‰à¹„ขอะไรไปหรือไม่?)"
#: editor/project_manager.cpp
#, fuzzy
-msgid "Couldn't create *.godot project file in project path."
-msgstr "สร้างไฟล์ engine.cfg ไม่ได้"
+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 ""
+msgstr "ผิดพลาดขณะà¹à¸¢à¸à¹„ฟล์ต่อไปนี้จาà¸à¹à¸žà¸„เà¸à¸ˆ:"
#: editor/project_manager.cpp
msgid "Package Installed Successfully!"
@@ -5548,11 +5572,11 @@ msgstr "เลือà¸"
#: editor/project_manager.cpp
msgid "New Game Project"
-msgstr ""
+msgstr "โปรเจà¸à¸•์ใหม่"
#: editor/project_manager.cpp
msgid "That's a BINGO!"
-msgstr ""
+msgstr "บิงโà¸!"
#: editor/project_manager.cpp
msgid "Unnamed Project"
@@ -5603,7 +5627,7 @@ msgstr "โปรเจà¸à¸•์ใหม่"
#: editor/project_manager.cpp
#, fuzzy
msgid "Templates"
-msgstr "ลบไอเทม"
+msgstr "ลบà¹à¸¡à¹ˆà¹à¸šà¸š"
#: editor/project_manager.cpp
msgid "Exit"
@@ -5627,7 +5651,7 @@ msgstr "ปุ่มเมาส์"
#: editor/project_settings.cpp
msgid "Invalid action (anything goes but '/' or ':')."
-msgstr "ชื่อà¸à¸²à¸£à¸à¸£à¸°à¸—ำผิดพลาด (อะไรà¸à¹‡à¹„ด้ยà¸à¹€à¸§à¹‰à¸™ '/' à¹à¸¥à¸° ':')"
+msgstr "ใช้ชื่อนี้ไม่ได้ (มี '/' หรือ ':')"
#: editor/project_settings.cpp
msgid "Action '%s' already exists!"
@@ -5643,7 +5667,6 @@ msgstr "เพิ่มà¸à¸²à¸£à¸à¸£à¸°à¸—ำ"
#: editor/project_settings.cpp editor/settings_config_dialog.cpp
#: scene/gui/input_action.cpp
-#, fuzzy
msgid "Meta+"
msgstr "Meta+"
@@ -5654,7 +5677,6 @@ msgstr "Shift+"
#: editor/project_settings.cpp editor/settings_config_dialog.cpp
#: scene/gui/input_action.cpp
-#, fuzzy
msgid "Alt+"
msgstr "Alt+"
@@ -5707,17 +5729,14 @@ msgid "Button 9"
msgstr "ปุ่ม 9"
#: editor/project_settings.cpp
-#, fuzzy
msgid "Joypad Axis Index:"
msgstr "คันบังคับจอย:"
#: editor/project_settings.cpp scene/gui/input_action.cpp
-#, fuzzy
msgid "Axis"
msgstr "à¹à¸à¸™"
#: editor/project_settings.cpp
-#, fuzzy
msgid "Joypad Button Index:"
msgstr "ปุ่มจอย:"
@@ -5729,8 +5748,12 @@ msgstr "เพิ่มà¸à¸²à¸£à¸à¸£à¸°à¸—ำ"
msgid "Erase Input Action Event"
msgstr "ลบà¸à¸²à¸£à¸à¸£à¸°à¸—ำ"
-#: editor/project_settings.cpp scene/gui/input_action.cpp
+#: editor/project_settings.cpp
#, fuzzy
+msgid "Add Event"
+msgstr "เพิ่มà¹à¸šà¸šà¸§à¹ˆà¸²à¸‡à¹€à¸›à¸¥à¹ˆà¸²"
+
+#: editor/project_settings.cpp scene/gui/input_action.cpp
msgid "Device"
msgstr "อุปà¸à¸£à¸“์"
@@ -5739,27 +5762,22 @@ msgid "Button"
msgstr "ปุ่ม"
#: editor/project_settings.cpp scene/gui/input_action.cpp
-#, fuzzy
msgid "Left Button."
msgstr "ปุ่มเมาส์ซ้าย"
#: editor/project_settings.cpp scene/gui/input_action.cpp
-#, fuzzy
msgid "Right Button."
msgstr "ปุ่มเมาส์ขวา"
#: editor/project_settings.cpp scene/gui/input_action.cpp
-#, fuzzy
msgid "Middle Button."
msgstr "ปุ่มเมาส์à¸à¸¥à¸²à¸‡"
#: editor/project_settings.cpp scene/gui/input_action.cpp
-#, fuzzy
msgid "Wheel Up."
msgstr "ล้อเมาส์ขึ้น"
#: editor/project_settings.cpp scene/gui/input_action.cpp
-#, fuzzy
msgid "Wheel Down."
msgstr "ล้อเมาส์ลง"
@@ -5785,7 +5803,7 @@ msgstr "เพิ่มตำà¹à¸«à¸™à¹ˆà¸‡à¹à¸—นที่"
#: editor/project_settings.cpp
msgid "Resource Remap Add Remap"
-msgstr ""
+msgstr "เพิ่มà¸à¸²à¸£à¹à¸—นที่"
#: editor/project_settings.cpp
msgid "Change Resource Remap Language"
@@ -5801,8 +5819,8 @@ msgstr "ลบà¸à¸²à¸£à¹à¸—นที่"
#: editor/project_settings.cpp
#, fuzzy
-msgid "Project Settings "
-msgstr "ตัวเลือà¸à¹‚ปรเจà¸à¸•์"
+msgid "Project Settings (project.godot)"
+msgstr "ตัวเลือà¸à¹‚ปรเจà¸à¸•์ (godot.cfg)"
#: editor/project_settings.cpp editor/settings_config_dialog.cpp
msgid "General"
@@ -5869,9 +5887,8 @@ msgid "AutoLoad"
msgstr "ออโต้โหลด"
#: editor/property_editor.cpp
-#, fuzzy
msgid "Pick a Viewport"
-msgstr "1 มุมมอง"
+msgstr "เลือภViewport"
#: editor/property_editor.cpp
msgid "Ease In"
@@ -5910,20 +5927,14 @@ 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 "เลือà¸à¹‚หนด"
@@ -5945,7 +5956,7 @@ msgstr "คุณสมบัติ:"
#: editor/property_editor.cpp
msgid "Sections:"
-msgstr "ส่วน:"
+msgstr "หัวข้อ:"
#: editor/property_selector.cpp
msgid "Select Property"
@@ -6047,11 +6058,11 @@ msgstr "ทำà¸à¸±à¸šà¹‚หนดราà¸à¹„ม่ได้"
#: editor/scene_tree_dock.cpp
msgid "Move Node In Parent"
-msgstr ""
+msgstr "ย้ายโหนดในโหนดà¹à¸¡à¹ˆ"
#: editor/scene_tree_dock.cpp
msgid "Move Nodes In Parent"
-msgstr ""
+msgstr "ย้ายโหนดในโหนดà¹à¸¡à¹ˆ"
#: editor/scene_tree_dock.cpp
msgid "Duplicate Node(s)"
@@ -6067,7 +6078,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."
@@ -6108,6 +6119,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 "à¹à¸à¹‰à¹„ขà¸à¸¥à¸¸à¹ˆà¸¡"
@@ -6148,9 +6164,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)"
@@ -6183,10 +6198,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 "ชื่อโหนดไม่ถูà¸à¸•้อง ใช้ตัวอัà¸à¸©à¸£à¸•่อไปนี้ไม่ได้:"
@@ -6231,75 +6295,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"
+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"
+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
@@ -6328,7 +6410,7 @@ msgstr "ฟังà¸à¹Œà¸Šà¸±à¸™:"
#: editor/script_editor_debugger.cpp
msgid "Errors"
-msgstr "ผิดพลาด"
+msgstr "ข้อผิดพลาด"
#: editor/script_editor_debugger.cpp
msgid "Child Process Connected"
@@ -6352,7 +6434,7 @@ msgstr "ตัวà¹à¸›à¸£"
#: editor/script_editor_debugger.cpp
msgid "Errors:"
-msgstr "ผิดพลาด:"
+msgstr "ข้อผิดพลาด:"
#: editor/script_editor_debugger.cpp
msgid "Stack Trace (if applicable):"
@@ -6360,7 +6442,7 @@ msgstr "สà¹à¸•ค (ถ้ามี):"
#: editor/script_editor_debugger.cpp
msgid "Remote Inspector"
-msgstr "ตรวจสอบรีโมท"
+msgstr "คุณสมบัติ"
#: editor/script_editor_debugger.cpp
msgid "Live Scene Tree:"
@@ -6368,7 +6450,7 @@ msgstr "ผังฉาà¸à¸›à¸±à¸ˆà¸ˆà¸¸à¸šà¸±à¸™:"
#: editor/script_editor_debugger.cpp
msgid "Remote Object Properties: "
-msgstr "คุณสมบัติวัตถุรีโมท: "
+msgstr "คุณสมบัติ: "
#: editor/script_editor_debugger.cpp
msgid "Profiler"
@@ -6376,7 +6458,7 @@ msgstr "ประสิทธิภาพ"
#: editor/script_editor_debugger.cpp
msgid "Monitor"
-msgstr "สังเà¸à¸•à¸à¸²à¸£à¸“์"
+msgstr "ข้อมูล"
#: editor/script_editor_debugger.cpp
msgid "Value"
@@ -6424,10 +6506,9 @@ msgstr "ประเภทของคอนโทรลที่คลิà¸:"
#: editor/script_editor_debugger.cpp
msgid "Live Edit Root:"
-msgstr ""
+msgstr "ราà¸à¸œà¸±à¸‡à¸‰à¸²à¸:"
#: editor/script_editor_debugger.cpp
-#, fuzzy
msgid "Set From Tree"
msgstr "à¸à¸³à¸«à¸™à¸”จาà¸à¸œà¸±à¸‡"
@@ -6468,68 +6549,56 @@ msgid "Change Ray Shape Length"
msgstr "ปรับความยาวรังสี"
#: editor/spatial_editor_gizmos.cpp
-#, fuzzy
msgid "Change Notifier Extents"
-msgstr "ปรับขนาด Notifier"
+msgstr "à¹à¸à¹‰à¹„ขขนาด Notifier"
#: editor/spatial_editor_gizmos.cpp
msgid "Change Particles AABB"
msgstr ""
#: editor/spatial_editor_gizmos.cpp
-#, fuzzy
msgid "Change Probe Extents"
-msgstr "ปรับขนาด Probe"
+msgstr "à¹à¸à¹‰à¹„ขขนาด Probe"
#: modules/gdscript/gd_functions.cpp
#: modules/visual_script/visual_script_builtin_funcs.cpp
-#, fuzzy
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
-#, fuzzy
msgid "Not enough bytes for decoding bytes, or invalid format."
msgstr "ไบต์ไม่ครบหรือผิดรูปà¹à¸šà¸š ไม่สามารถà¹à¸›à¸¥à¸‡à¸„่าได้"
#: modules/gdscript/gd_functions.cpp
-#, fuzzy
msgid "step argument is zero!"
msgstr "ตัวà¹à¸›à¸£ step เป็นศูนย์!"
#: modules/gdscript/gd_functions.cpp
-#, fuzzy
msgid "Not a script with an instance"
msgstr "ไม่ใช่สคริปต์ที่มีอินสà¹à¸•นซ์"
#: modules/gdscript/gd_functions.cpp
-#, fuzzy
msgid "Not based on a script"
msgstr "ไม่ได้มีต้นà¸à¸³à¹€à¸™à¸´à¸”จาà¸à¸ªà¸„ริปต์"
#: modules/gdscript/gd_functions.cpp
-#, fuzzy
msgid "Not based on a resource file"
msgstr "ไม่ได้มีต้นà¸à¸³à¹€à¸™à¸´à¸”มาจาà¸à¹„ฟล์รีซอร์ส"
#: modules/gdscript/gd_functions.cpp
-#, fuzzy
msgid "Invalid instance dictionary format (missing @path)"
msgstr "รูปà¹à¸šà¸šà¸”ิà¸à¸Šà¸±à¸™à¸™à¸²à¸£à¸µà¸—ี่เà¸à¹‡à¸šà¸­à¸´à¸™à¸ªà¹à¸•นซ์ไม่ถูà¸à¸•้อง (ไม่มี @path)"
#: modules/gdscript/gd_functions.cpp
-#, fuzzy
msgid "Invalid instance dictionary format (can't load script at @path)"
msgstr "รูปà¹à¸šà¸šà¸”ิà¸à¸Šà¸±à¸™à¸™à¸²à¸£à¸µà¸—ี่เà¸à¹‡à¸šà¸­à¸´à¸™à¸ªà¹à¸•นซ์ไม่ถูà¸à¸•้อง (โหลดสคริปต์ที่ @path ไม่ได้)"
#: modules/gdscript/gd_functions.cpp
-#, fuzzy
msgid "Invalid instance dictionary format (invalid script at @path)"
msgstr "รูปà¹à¸šà¸šà¸”ิà¸à¸Šà¸±à¸™à¸™à¸²à¸£à¸µà¸—ี่เà¸à¹‡à¸šà¸­à¸´à¸™à¸ªà¹à¸•นซ์ไม่ถูà¸à¸•้อง (สคริปต์ที่ @path ผิดพลาด)"
#: modules/gdscript/gd_functions.cpp
-#, fuzzy
msgid "Invalid instance dictionary (invalid subclasses)"
msgstr "ดิà¸à¸Šà¸±à¸™à¸™à¸²à¸£à¸µà¸—ี่เà¸à¹‡à¸šà¸­à¸´à¸™à¸ªà¹à¸•นซ์ผิดพลาด (คลาสย่อยผิดพลาด)"
@@ -6556,17 +6625,14 @@ msgid ""
msgstr "ค่าที่คืนจะต้องà¸à¸³à¸«à¸™à¸”ในหน่วยความจำทำงานà¹à¸£à¸! à¸à¸£à¸¸à¸“าà¹à¸à¹‰à¹„ขโหนด"
#: modules/visual_script/visual_script.cpp
-#, fuzzy
msgid "Node returned an invalid sequence output: "
msgstr "โหนดคืนค่าผิดลำดับ: "
#: modules/visual_script/visual_script.cpp
-#, fuzzy
msgid "Found sequence bit but not the node in the stack, report bug!"
msgstr "พบบิตลำดับà¹à¸•่ไม่พบโหนดในสà¹à¸•ค à¸à¸£à¸¸à¸“ารายงานข้อผิดพลาด!"
#: modules/visual_script/visual_script.cpp
-#, fuzzy
msgid "Stack overflow with stack depth: "
msgstr "สà¹à¸•คล้น ความสูงสà¹à¸•ค: "
@@ -6575,72 +6641,58 @@ msgid "Functions:"
msgstr "ฟังà¸à¹Œà¸Šà¸±à¸™:"
#: modules/visual_script/visual_script_editor.cpp
-#, fuzzy
msgid "Variables:"
msgstr "ตัวà¹à¸›à¸£:"
#: modules/visual_script/visual_script_editor.cpp
-#, fuzzy
msgid "Name is not a valid identifier:"
msgstr "ไม่สามารถใช้ชื่อนี้ได้:"
#: modules/visual_script/visual_script_editor.cpp
-#, fuzzy
msgid "Name already in use by another func/var/signal:"
msgstr "มีฟังà¸à¹Œà¸Šà¸±à¸™/ตัวà¹à¸›à¸£/สัà¸à¸à¸²à¸“อื่นใช้ชื่อนี้à¹à¸¥à¹‰à¸§:"
#: modules/visual_script/visual_script_editor.cpp
-#, fuzzy
msgid "Rename Function"
msgstr "เปลี่ยนชื่อฟังà¸à¹Œà¸Šà¸±à¸™"
#: modules/visual_script/visual_script_editor.cpp
-#, fuzzy
msgid "Rename Variable"
msgstr "เปลี่ยนชื่อตัวà¹à¸›à¸£"
#: modules/visual_script/visual_script_editor.cpp
-#, fuzzy
msgid "Rename Signal"
msgstr "เปลี่ยนชื่อสัà¸à¸à¸²à¸“"
#: modules/visual_script/visual_script_editor.cpp
-#, fuzzy
msgid "Add Function"
msgstr "เพิ่มฟังà¸à¹Œà¸Šà¸±à¸™"
#: modules/visual_script/visual_script_editor.cpp
-#, fuzzy
msgid "Add Variable"
msgstr "เพิ่มตัวà¹à¸›à¸£"
#: modules/visual_script/visual_script_editor.cpp
-#, fuzzy
msgid "Add Signal"
msgstr "เพิ่มสัà¸à¸à¸²à¸“"
#: modules/visual_script/visual_script_editor.cpp
-#, fuzzy
msgid "Remove Function"
msgstr "ลบฟังà¸à¹Œà¸Šà¸±à¸™"
#: modules/visual_script/visual_script_editor.cpp
-#, fuzzy
msgid "Remove Variable"
msgstr "ลบตัวà¹à¸›à¸£"
#: modules/visual_script/visual_script_editor.cpp
-#, fuzzy
msgid "Editing Variable:"
msgstr "à¹à¸à¹‰à¹„ขตัวà¹à¸›à¸£:"
#: modules/visual_script/visual_script_editor.cpp
-#, fuzzy
msgid "Remove Signal"
msgstr "ลบสัà¸à¸à¸²à¸“"
#: modules/visual_script/visual_script_editor.cpp
-#, fuzzy
msgid "Editing Signal:"
msgstr "à¹à¸à¹‰à¹„ขสัà¸à¸à¸²à¸“:"
@@ -6662,7 +6714,6 @@ 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
-#, fuzzy
msgid "Hold Meta to drop a simple reference to the node."
msgstr "à¸à¸”ปุ่ม Meta เพื่อวางà¸à¸²à¸£à¸­à¹‰à¸²à¸‡à¸­à¸´à¸‡à¹„ปยังโหนดอย่างง่าย"
@@ -6679,7 +6730,6 @@ msgid "Hold Ctrl to drop a Variable Setter."
msgstr "à¸à¸” Ctrl ค้างเพื่อวาง Setter ของตัวà¹à¸›à¸£"
#: modules/visual_script/visual_script_editor.cpp
-#, fuzzy
msgid "Add Preload Node"
msgstr "เพิ่มโหนด Preload"
@@ -6708,12 +6758,10 @@ msgid "Switch"
msgstr "ทางเลือà¸"
#: modules/visual_script/visual_script_editor.cpp
-#, fuzzy
msgid "Iterator"
msgstr "ตัววนซ้ำ"
#: modules/visual_script/visual_script_editor.cpp
-#, fuzzy
msgid "While"
msgstr "ทำซ้ำถ้าเงื่อนไขเป็นจริง"
@@ -6731,7 +6779,6 @@ msgid "Base Type:"
msgstr "ชนิด:"
#: modules/visual_script/visual_script_editor.cpp
-#, fuzzy
msgid "Available Nodes:"
msgstr "โหนดที่มีให้ใช้:"
@@ -6740,7 +6787,6 @@ msgid "Select or create a function to edit graph"
msgstr "เลือà¸à¸«à¸£à¸·à¸­à¸ªà¸£à¹‰à¸²à¸‡à¸Ÿà¸±à¸‡à¸à¹Œà¸Šà¸±à¸™à¹€à¸žà¸·à¹ˆà¸­à¹à¸à¹‰à¹„ขà¸à¸£à¸²à¸Ÿ"
#: modules/visual_script/visual_script_editor.cpp
-#, fuzzy
msgid "Edit Signal Arguments:"
msgstr "à¹à¸à¹‰à¹„ขตัวà¹à¸›à¸£à¸ªà¸±à¸à¸à¸²à¸“:"
@@ -6757,9 +6803,8 @@ msgid "Delete Selected"
msgstr "ลบสิ่งที่เลือà¸"
#: modules/visual_script/visual_script_editor.cpp
-#, fuzzy
msgid "Find Node Type"
-msgstr "หาชนิดของโหนด"
+msgstr "หาประเภทของโหนด"
#: modules/visual_script/visual_script_editor.cpp
msgid "Copy Nodes"
@@ -6774,9 +6819,8 @@ msgid "Paste Nodes"
msgstr "วางโหนด"
#: modules/visual_script/visual_script_flow_control.cpp
-#, fuzzy
msgid "Input type not iterable: "
-msgstr "ชนิดตัวà¹à¸›à¸£à¸™à¸µà¹‰à¹ƒà¸Šà¹‰à¸§à¸™à¸‹à¹‰à¸³à¹„ม่ได้: "
+msgstr "ตัวà¹à¸›à¸£à¸›à¸£à¸°à¹€à¸ à¸—นี้ใช้วนซ้ำไม่ได้: "
#: modules/visual_script/visual_script_flow_control.cpp
msgid "Iterator became invalid"
@@ -6805,12 +6849,10 @@ msgid "Invalid index property name '%s' in node %s."
msgstr "ไม่พบคุณสมบัติ '%s' ในโหนด %s"
#: modules/visual_script/visual_script_nodes.cpp
-#, fuzzy
msgid ": Invalid argument of type: "
-msgstr ": ชนิดตัวà¹à¸›à¸£à¹„ม่ถูà¸à¸•้อง: "
+msgstr ": ประเภทตัวà¹à¸›à¸£à¹„ม่ถูà¸à¸•้อง: "
#: modules/visual_script/visual_script_nodes.cpp
-#, fuzzy
msgid ": Invalid arguments: "
msgstr ": ตัวà¹à¸›à¸£à¹„ม่ถูà¸à¸•้อง: "
@@ -6827,48 +6869,40 @@ msgid "Custom node has no _step() method, can't process graph."
msgstr "โหนดà¸à¸³à¸«à¸™à¸”เองไม่มีเมท็อด _step() ไม่สามารถประมวลผลà¸à¸£à¸²à¸Ÿà¹„ด้"
#: modules/visual_script/visual_script_nodes.cpp
-#, fuzzy
msgid ""
"Invalid return value from _step(), must be integer (seq out), or string "
"(error)."
msgstr "ค่าคืนจาภ_step() ผิดพลาด ต้องเป็นจำนวนเต็ม (ลำดับ) หรือสตริง (ข้อผิดพลาด)"
#: modules/visual_script/visual_script_nodes.cpp
-#, fuzzy
msgid "just pressed"
msgstr "เพิ่งà¸à¸”"
#: modules/visual_script/visual_script_nodes.cpp
-#, fuzzy
msgid "just released"
msgstr "เพิ่งปล่อย"
#: platform/javascript/export/export.cpp
-#, fuzzy
msgid "Run in Browser"
-msgstr "เลือà¸"
+msgstr "รันในเบราเซอร์"
#: platform/javascript/export/export.cpp
msgid "Run exported HTML in the system's default browser."
-msgstr ""
+msgstr "รันไฟล์ HTML ที่ส่งออà¸à¹ƒà¸™à¹€à¸šà¸£à¸²à¹€à¸‹à¸­à¸£à¹Œ"
#: platform/javascript/export/export.cpp
-#, fuzzy
msgid "Could not write file:\n"
-msgstr "ไม่พบ tile:"
+msgstr "เขียนไฟล์ไม่ได้:\n"
#: platform/javascript/export/export.cpp
-#, fuzzy
msgid "Could not read file:\n"
-msgstr "ไม่พบ tile:"
+msgstr "อ่านไฟล์ไม่ได้:\n"
#: platform/javascript/export/export.cpp
-#, fuzzy
msgid "Could not open template for export:\n"
-msgstr "ไม่สามารถสร้างโฟลเดอร์"
+msgstr "เปิดà¹à¸¡à¹ˆà¹à¸šà¸šà¹€à¸žà¸·à¹ˆà¸­à¸ªà¹ˆà¸‡à¸­à¸­à¸à¹„ม่ได้:\n"
#: platform/uwp/export/export.cpp
-#, fuzzy
msgid ""
"Couldn't read the certificate file. Are the path and password both correct?"
msgstr "ไม่สามารถอ่านไฟล์ใบรับรองได้ ตำà¹à¸«à¸™à¹ˆà¸‡à¹„ฟล์à¹à¸¥à¸°à¸£à¸«à¸±à¸ªà¸œà¹ˆà¸²à¸™à¸–ูà¸à¸•้องหรือไม่?"
@@ -6882,7 +6916,6 @@ msgid "Error creating the package signature."
msgstr "ผิดพลาดขณะสร้าง signature ของà¹à¸žà¸„เà¸à¸ˆ"
#: platform/uwp/export/export.cpp
-#, fuzzy
msgid ""
"No export templates found.\n"
"Download and install export templates."
@@ -6911,54 +6944,44 @@ msgid "Invalid publisher GUID."
msgstr "GUID ของผู้จัดจำหน่ายไม่ถูà¸à¸•้อง"
#: platform/uwp/export/export.cpp
-#, fuzzy
msgid "Invalid background color."
msgstr "สีพื้นหลังผิดพลาด"
#: platform/uwp/export/export.cpp
-#, fuzzy
msgid "Invalid Store Logo image dimensions (should be 50x50)."
msgstr "ขนาดรูปโลโà¸à¹‰ Store ผิดพลาด (ต้องเป็น 50x50)"
#: platform/uwp/export/export.cpp
-#, fuzzy
msgid "Invalid square 44x44 logo image dimensions (should be 44x44)."
msgstr "ขนาดโลโà¸à¹‰à¸ˆà¸±à¸•ุรัส 44x44 ผิดพลาด (ต้องเป็น 44x44)"
#: platform/uwp/export/export.cpp
-#, fuzzy
msgid "Invalid square 71x71 logo image dimensions (should be 71x71)."
msgstr "ขนาดโลโà¸à¹‰à¸ˆà¸±à¸•ุรัส 71x71 ผิดพลาด (ต้องเป็น 71x71)"
#: platform/uwp/export/export.cpp
-#, fuzzy
msgid "Invalid square 150x150 logo image dimensions (should be 150x150)."
msgstr "ขนาดโลโà¸à¹‰à¸ˆà¸±à¸•ุรัส 150x150 ผิดพลาด (ต้องเป็น 150x150)"
#: platform/uwp/export/export.cpp
-#, fuzzy
msgid "Invalid square 310x310 logo image dimensions (should be 310x310)."
msgstr "ขนาดโลโà¸à¹‰à¸ˆà¸±à¸•ุรัส 310x310 ผิดพลาด (ต้องเป็น 310x310)"
#: platform/uwp/export/export.cpp
-#, fuzzy
msgid "Invalid wide 310x150 logo image dimensions (should be 310x150)."
msgstr "ขนาดโลโà¸à¹‰à¸à¸§à¹‰à¸²à¸‡ 310x150 ผิดพลาด (ต้องเป็น 310x150)"
#: platform/uwp/export/export.cpp
-#, fuzzy
msgid "Invalid splash screen image dimensions (should be 620x300)."
msgstr "ขนาดรูปหน้าจอเริ่มโปรà¹à¸à¸£à¸¡à¸œà¸´à¸”พลาด (ต้องเป็น 620x300)"
#: scene/2d/animated_sprite.cpp
-#, fuzzy
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
-#, fuzzy
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."
@@ -6967,59 +6990,51 @@ msgstr ""
"โหนดà¹à¸£à¸à¹€à¸—่านั้นที่จะทำงานได้ปà¸à¸•ิ ที่เหลือจะไม่ทำงาน"
#: scene/2d/collision_polygon_2d.cpp
-#, fuzzy
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 ฯลฯ "
+"CollisionPolygon2D ใช้เป็นรูปทรงสำหรับโหนดà¸à¸¥à¸¸à¹ˆà¸¡ CollisionObject2D "
+"จึงควรให้เป็นโหนดลูà¸à¸‚อง Area2D, StaticBody2D, RigidBody2D, KinematicBody2D ฯลฯ "
"เพื่อให้มีรูปทรง"
#: scene/2d/collision_polygon_2d.cpp
-#, fuzzy
msgid "An empty CollisionPolygon2D has no effect on collision."
msgstr "CollisionPolygon2D ที่ว่างเปล่าจะไม่มีผลทางà¸à¸²à¸¢à¸ à¸²à¸ž"
#: scene/2d/collision_shape_2d.cpp
-#, fuzzy
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 ฯลฯ "
+"CollisionShape2D ใช้เป็นรูปทรงสำหรับโหนดà¸à¸¥à¸¸à¹ˆà¸¡ CollisionObject2D "
+"จึงควรให้เป็นโหนดลูà¸à¸‚อง Area2D, StaticBody2D, RigidBody2D, KinematicBody2D ฯลฯ "
"เพื่อให้มีรูปทรง"
#: 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 "ต้องมีรูปทรงเพื่อให้ CollisionShape2D ทำงานได้ à¸à¸£à¸¸à¸“าสร้างรูปทรง"
+msgstr "ต้องมีรูปทรงเพื่อให้ CollisionShape2D ทำงานได้ à¸à¸£à¸¸à¸“าสร้างรูปทรง!"
#: scene/2d/light_2d.cpp
-#, fuzzy
msgid ""
"A texture with the shape of the light must be supplied to the 'texture' "
"property."
msgstr "ต้องมีรูปร่างของà¹à¸ªà¸‡à¸­à¸¢à¸¹à¹ˆà¹ƒà¸™ 'texture'"
#: scene/2d/light_occluder_2d.cpp
-#, fuzzy
msgid ""
"An occluder polygon must be set (or drawn) for this occluder to take effect."
msgstr "ต้องมีรูปหลายเหลี่ยมเพื่อให้ตัวบังà¹à¸ªà¸‡à¸™à¸µà¹‰à¸—ำงานได้"
#: scene/2d/light_occluder_2d.cpp
-#, fuzzy
msgid "The occluder polygon for this occluder is empty. Please draw a polygon!"
msgstr "รูปหลายเหลี่ยมของตัวบังà¹à¸ªà¸‡à¸™à¸µà¹‰à¸§à¹ˆà¸²à¸‡à¹€à¸›à¸¥à¹ˆà¸² à¸à¸£à¸¸à¸“าวาดรูปหลายเหลี่ยม!"
#: scene/2d/navigation_polygon.cpp
-#, fuzzy
msgid ""
"A NavigationPolygon resource must be set or created for this node to work. "
"Please set a property or draw a polygon."
@@ -7027,7 +7042,6 @@ msgstr ""
"ต้องมี NavigationPolygon เพื่อให้โหนดนี้ทำงานได้ à¸à¸£à¸¸à¸“าà¹à¸à¹‰à¹„ขคุณสมบัติหรือวาดรูปหลายเหลี่ยม"
#: scene/2d/navigation_polygon.cpp
-#, fuzzy
msgid ""
"NavigationPolygonInstance must be a child or grandchild to a Navigation2D "
"node. It only provides navigation data."
@@ -7036,28 +7050,25 @@ msgstr ""
"เนื่องจาà¸à¹‚หนดนี้ใช้เà¸à¹‡à¸šà¸‚้อมูลà¸à¸²à¸£à¸™à¸³à¸—างเท่านั้น"
#: scene/2d/parallax_layer.cpp
-#, fuzzy
msgid ""
"ParallaxLayer node only works when set as child of a ParallaxBackground node."
msgstr "ParallaxLayer จะทำงานได้ต้องเป็นโหนดลูà¸à¸‚องโหนด ParallaxBackground"
-#: scene/2d/particles_2d.cpp
-#, fuzzy
-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
-#, fuzzy
msgid "PathFollow2D only works when set as a child of a Path2D node."
msgstr "PathFollow2D จะทำงานได้ต้องเป็นโหนดลูà¸à¸‚องโหนด Path2D"
#: scene/2d/remote_transform_2d.cpp
-#, fuzzy
msgid "Path property must point to a valid Node2D node to work."
msgstr "ต้องà¹à¸à¹‰à¹„ข Path ให้ชี้ไปยังโหนด Node2D จึงจะทำงานได้"
#: scene/2d/sprite.cpp
-#, fuzzy
msgid ""
"Path property must point to a valid Viewport node to work. Such Viewport "
"must be set to 'render target' mode."
@@ -7066,60 +7077,50 @@ msgstr ""
"'render target'"
#: scene/2d/sprite.cpp
-#, fuzzy
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
-#, fuzzy
msgid ""
"VisibilityEnable2D works best when used with the edited scene root directly "
"as parent."
msgstr "VisibilityEnable2D ควรจะเป็นโหนดลูà¸à¸‚องโหนดหลัà¸à¹ƒà¸™à¸‰à¸²à¸à¸™à¸µà¹‰"
#: scene/3d/body_shape.cpp
-#, fuzzy
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 ฯลฯ "
-"เพื่อให้มีรูปทรง"
+"CollisionShape ใช้เป็นรูปทรงสำหรับโหนดà¸à¸¥à¸¸à¹ˆà¸¡ CollisionObject จึงควรให้เป็นโหนดลูà¸à¸‚อง "
+"Area, StaticBody, RigidBody, KinematicBody ฯลฯ เพื่อให้มีรูปทรง"
#: scene/3d/body_shape.cpp
-#, fuzzy
msgid ""
"A shape must be provided for CollisionShape to function. Please create a "
"shape resource for it!"
-msgstr "ต้องมีรูปทรงเพื่อให้ CollisionShape ทำงานได้ à¸à¸£à¸¸à¸“าสร้างรูปทรง"
+msgstr "ต้องมีรูปทรงเพื่อให้ CollisionShape ทำงานได้ à¸à¸£à¸¸à¸“าสร้างรูปทรง!"
#: scene/3d/collision_polygon.cpp
-#, fuzzy
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 ฯลฯ "
-"เพื่อให้มีรูปทรง"
+"CollisionPolygon ใช้เป็นรูปทรงสำหรับโหนดà¸à¸¥à¸¸à¹ˆà¸¡ CollisionObject จึงควรให้เป็นโหนดลูà¸à¸‚อง "
+"Area, StaticBody, RigidBody, KinematicBody ฯลฯ เพื่อให้มีรูปทรง"
#: scene/3d/collision_polygon.cpp
-#, fuzzy
msgid "An empty CollisionPolygon has no effect on collision."
msgstr "CollisionPolygon ที่ว่างเปล่าจะไม่มีผลทางà¸à¸²à¸¢à¸ à¸²à¸ž"
#: scene/3d/navigation_mesh.cpp
-#, fuzzy
msgid "A NavigationMesh resource must be set or created for this node to work."
msgstr "ต้องมี NavigationMesh เพื่อให้โหนดนี้ทำงานได้"
#: scene/3d/navigation_mesh.cpp
-#, fuzzy
msgid ""
"NavigationMeshInstance must be a child or grandchild to a Navigation node. "
"It only provides navigation data."
@@ -7132,37 +7133,35 @@ msgid ""
"Nothing is visible because meshes have not been assigned to draw passes."
msgstr ""
-#: scene/3d/particles.cpp
-msgid ""
-"A material to process the particles is not assigned, so no behavior is "
-"imprinted."
-msgstr ""
-
#: scene/3d/remote_transform.cpp
-#, fuzzy
msgid "Path property must point to a valid Spatial node to work."
msgstr "ต้องà¹à¸à¹‰à¹„ข Path ให้ชี้ไปยังโหนด Spatial จึงจะทำงานได้"
#: scene/3d/scenario_fx.cpp
-#, fuzzy
msgid ""
"Only one WorldEnvironment is allowed per scene (or set of instanced scenes)."
msgstr "จะมี WorldEnvironment ได้เพียงโหนดเดียวในฉาภ(หรือà¸à¸¥à¸¸à¹ˆà¸¡à¸‚องฉาà¸à¸—ี่เป็นอินสà¹à¸•นซ์)"
#: scene/3d/sprite_3d.cpp
-#, fuzzy
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/dialogs.cpp
+#: 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 "ประà¸à¸²à¸¨!"
+msgstr "à¹à¸ˆà¹‰à¸‡à¹€à¸•ือน!"
#: scene/gui/dialogs.cpp
-#, fuzzy
msgid "Please Confirm..."
msgstr "à¸à¸£à¸¸à¸“ายืนยัน..."
@@ -7175,22 +7174,18 @@ msgid "Open File(s)"
msgstr "เปิดไฟล์"
#: scene/gui/file_dialog.cpp
-#, fuzzy
msgid "Open a Directory"
msgstr "เปิดโฟลเดอร์"
#: scene/gui/file_dialog.cpp
-#, fuzzy
msgid "Open a File or Directory"
msgstr "เปิดไฟล์หรือโฟลเดอร์"
#: scene/gui/input_action.cpp
-#, fuzzy
msgid "Ctrl+"
msgstr "Ctrl+"
#: scene/gui/popup.cpp
-#, fuzzy
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 "
@@ -7205,9 +7200,17 @@ 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
-#, fuzzy
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 "
@@ -7224,9 +7227,53 @@ msgstr ""
#~ msgid "Import assets to the project."
#~ msgstr "นำเข้าไฟล์มายังโปรเจà¸à¸•์"
-#, fuzzy
-#~ msgid "Project Settings (godot.cfg)"
-#~ msgstr "ตัวเลือà¸à¹‚ปรเจà¸à¸•์ (engine.cfg)"
+#~ 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 "พื้นผิว"
@@ -7402,9 +7449,6 @@ msgstr ""
#~ msgid "Trailing Silence:"
#~ msgstr "ส่วนที่เงียบตรงปลาย:"
-#~ msgid "Script"
-#~ msgstr "สคริปต์"
-
#~ msgid "Script Export Mode:"
#~ msgstr "โหมดส่งออà¸à¸ªà¸„ริปต์:"
diff --git a/editor/translations/tr.po b/editor/translations/tr.po
index b4d8975649..b041ed0901 100644
--- a/editor/translations/tr.po
+++ b/editor/translations/tr.po
@@ -1,6 +1,5 @@
# Turkish translation of the Godot Engine editor
-# Copyright (C) 2007-2017 Juan Linietsky, Ariel Manzur
-# Copyright (C) 2014-2017 Godot Engine contributors (cf. AUTHORS.md)
+# 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-2017.
@@ -549,7 +548,8 @@ msgid "Search:"
msgstr "Ara:"
#: editor/asset_library_editor_plugin.cpp editor/code_editor.cpp
-#: editor/editor_help.cpp editor/plugins/script_editor_plugin.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"
@@ -595,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"
@@ -741,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"
@@ -850,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"
@@ -953,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"
@@ -964,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ü"
@@ -1032,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:"
@@ -1225,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"
@@ -1242,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:"
@@ -1410,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 "
@@ -1476,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?"
@@ -1534,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"
@@ -1575,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"
@@ -1628,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ç"
@@ -1656,84 +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 "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 "Export the project to many platforms."
-msgstr "Tasarıyı pek çok ortama aktarın."
+msgid "Project Settings"
+msgstr "Tasarı Ayarları"
+
+#: editor/editor_node.cpp
+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"
@@ -1822,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"
@@ -1844,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!"
@@ -1932,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"
@@ -1959,6 +1993,36 @@ 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:"
@@ -2218,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"
@@ -2246,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.."
@@ -2418,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."
@@ -2902,7 +2967,7 @@ msgstr "Sıkıştır"
#: editor/io_plugins/editor_translation_import_plugin.cpp
#, fuzzy
-msgid "Add to Project (godot.cfg)"
+msgid "Add to Project (project.godot)"
msgstr "Tasarıya Ekle (engine.cfg)"
#: editor/io_plugins/editor_translation_import_plugin.cpp
@@ -3567,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"
@@ -3618,17 +3683,6 @@ msgstr "Çoklu3B Oluştur"
msgid "Set Handle"
msgstr "Tutamacı Ayarla"
-#: editor/plugins/color_ramp_editor_plugin.cpp
-#: editor/plugins/gradient_texture_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/gradient_texture_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"
@@ -3661,9 +3715,33 @@ 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"
@@ -3937,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:"
@@ -3949,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"
@@ -3960,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."
@@ -3973,11 +4086,6 @@ msgid "A processor material of type 'ParticlesMaterial' is required."
msgstr ""
#: editor/plugins/particles_editor_plugin.cpp
-#, fuzzy
-msgid "Generating AABB"
-msgstr "AABB Üret"
-
-#: editor/plugins/particles_editor_plugin.cpp
msgid "Faces contain no area!"
msgstr "Yüzler alan içermez!"
@@ -4035,13 +4143,18 @@ msgstr "Yayma Dolumu:"
msgid "Generate Visibility AABB"
msgstr "AABB Üret"
-#: editor/plugins/particles_editor_plugin.cpp
+#: 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 "Generation Time (sec):"
-msgstr "Ortalama Zaman (sn)"
+msgid "Remove Out-Control from Curve"
+msgstr "Eğriye Denetimsiz Taşı"
#: editor/plugins/path_2d_editor_plugin.cpp
-msgid "Remove Point from Curve"
+#, fuzzy
+msgid "Remove In-Control from Curve"
msgstr "Noktayı Eğriden Kaldır"
#: editor/plugins/path_2d_editor_plugin.cpp
@@ -4099,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"
@@ -4252,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"
@@ -4339,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"
@@ -4376,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."
@@ -4444,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"
@@ -4523,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"
@@ -4545,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"
@@ -4762,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
+#, fuzzy
+msgid "View Environment"
+msgstr "Çevre"
+
+#: editor/plugins/spatial_editor_plugin.cpp
+#, fuzzy
+msgid "View Gizmos"
+msgstr "Zımbırtılar"
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "No scene selected to instance!"
-msgstr "Örnek vermek için hiçbir sahne seçilmedi!"
+msgid "View Information"
+msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Instance at Cursor"
-msgstr "Göstergede Örnekle"
+msgid "Audio Listener"
+msgstr "Ses Dinleyici"
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Could not instance scene!"
-msgstr "Sahne Örneklenemedi!"
+msgid "XForm Dialog"
+msgstr "XForm İletişim Kutusu"
#: editor/plugins/spatial_editor_plugin.cpp
msgid "Move Mode (W)"
@@ -4850,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"
@@ -4862,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"
@@ -4894,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ü"
@@ -4918,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ı"
@@ -4938,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):"
@@ -5376,12 +5586,12 @@ msgstr "Geçersiz tasarı yolu, yolun var olması gerekir!"
#: editor/project_manager.cpp
#, fuzzy
-msgid "Invalid project path, *.godot must not exist."
+msgid "Invalid project path, project.godot must not exist."
msgstr "Geçersiz tasarı yolu, engine.cfg var olmaması gerekir."
#: editor/project_manager.cpp
#, fuzzy
-msgid "Invalid project path, *.godot must exist."
+msgid "Invalid project path, project.godot must exist."
msgstr "Geçersiz tasarı yolu, engine.cfg var olması gerekir."
#: editor/project_manager.cpp
@@ -5394,7 +5604,7 @@ msgstr "Geçersiz tasarı yolu (bir şey değişti mi?)."
#: editor/project_manager.cpp
#, fuzzy
-msgid "Couldn't create *.godot project file in project path."
+msgid "Couldn't create project.godot in project path."
msgstr "engine.cfg tasarı yolunda oluşturulamadı."
#: editor/project_manager.cpp
@@ -5616,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"
@@ -5682,8 +5897,8 @@ msgstr "Kaynak Yeniden Eşle Seçeneğini Kaldır"
#: editor/project_settings.cpp
#, fuzzy
-msgid "Project Settings "
-msgstr "Tasarı Ayarları"
+msgid "Project Settings (project.godot)"
+msgstr "Tasarı Ayarları (engine.cfg)"
#: editor/project_settings.cpp editor/settings_config_dialog.cpp
msgid "General"
@@ -5800,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ç"
@@ -5992,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"
@@ -6069,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:"
@@ -6117,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
@@ -6882,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."
@@ -6974,12 +7257,6 @@ msgid ""
"Nothing is visible because meshes have not been assigned to draw passes."
msgstr ""
-#: scene/3d/particles.cpp
-msgid ""
-"A material to process the particles is not assigned, so no behavior is "
-"imprinted."
-msgstr ""
-
#: scene/3d/remote_transform.cpp
msgid "Path property must point to a valid Spatial node to work."
msgstr ""
@@ -7000,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ı!"
@@ -7045,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 "
@@ -7063,9 +7355,64 @@ msgstr ""
#~ msgid "Import assets to the project."
#~ msgstr "Varlıkları tasarının içine aktar."
-#, fuzzy
-#~ msgid "Project Settings (godot.cfg)"
-#~ msgstr "Tasarı Ayarları (engine.cfg)"
+#~ 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"
@@ -7286,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:"
@@ -7322,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 ef3e3b30ca..a154df0565 100644
--- a/editor/translations/ur_PK.po
+++ b/editor/translations/ur_PK.po
@@ -1,6 +1,5 @@
# Urdu (Pakistan) translation of the Godot Engine editor
-# Copyright (C) 2007-2017 Juan Linietsky, Ariel Manzur
-# Copyright (C) 2014-2017 Godot Engine contributors (cf. AUTHORS.md)
+# 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.
#
# Muhammad Ali <ali@codeonion.com>, 2016.
@@ -533,7 +532,8 @@ msgid "Search:"
msgstr ""
#: editor/asset_library_editor_plugin.cpp editor/code_editor.cpp
-#: editor/editor_help.cpp editor/plugins/script_editor_plugin.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"
@@ -579,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 "کمیونٹی"
@@ -722,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 ""
@@ -827,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 ""
@@ -927,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 ""
@@ -938,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 ""
@@ -1007,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 ""
@@ -1201,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 ""
@@ -1218,7 +1220,6 @@ msgid "Class:"
msgstr ""
#: editor/editor_help.cpp editor/scene_tree_editor.cpp
-#: editor/script_create_dialog.cpp
msgid "Inherits:"
msgstr ""
@@ -1389,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
@@ -1444,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 ""
@@ -1501,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 ""
@@ -1539,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 ""
@@ -1591,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 ""
@@ -1619,35 +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"
+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
@@ -1655,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
@@ -1766,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
@@ -1787,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
@@ -1875,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 ""
@@ -1902,6 +1931,30 @@ 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
+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 ""
@@ -2146,6 +2199,10 @@ msgid "Collapse all"
msgstr ""
#: editor/filesystem_dock.cpp
+msgid "Show In File Manager"
+msgstr ""
+
+#: editor/filesystem_dock.cpp
msgid "Instance"
msgstr ""
@@ -2174,10 +2231,6 @@ msgid "Info"
msgstr ""
#: editor/filesystem_dock.cpp
-msgid "Show In File Manager"
-msgstr ""
-
-#: editor/filesystem_dock.cpp
msgid "Re-Import.."
msgstr ""
@@ -2343,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
@@ -2818,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
@@ -3479,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 ""
@@ -3528,17 +3581,6 @@ msgstr ""
msgid "Set Handle"
msgstr ""
-#: editor/plugins/color_ramp_editor_plugin.cpp
-#: editor/plugins/gradient_texture_editor_plugin.cpp
-msgid "Add/Remove Color Ramp Point"
-msgstr ""
-
-#: editor/plugins/color_ramp_editor_plugin.cpp
-#: editor/plugins/gradient_texture_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 ""
@@ -3570,9 +3612,31 @@ 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 ""
@@ -3842,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 ""
@@ -3854,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
@@ -3865,20 +3942,33 @@ msgstr ""
msgid "Generated Point Count:"
msgstr ""
+#: editor/plugins/particles_2d_editor_plugin.cpp
#: editor/plugins/particles_editor_plugin.cpp
-msgid "Node does not contain geometry."
+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 (faces)."
+msgid "Node does not contain geometry."
msgstr ""
#: editor/plugins/particles_editor_plugin.cpp
-msgid "A processor material of type 'ParticlesMaterial' is required."
+msgid "Node does not contain geometry (faces)."
msgstr ""
#: editor/plugins/particles_editor_plugin.cpp
-msgid "Generating AABB"
+msgid "A processor material of type 'ParticlesMaterial' is required."
msgstr ""
#: editor/plugins/particles_editor_plugin.cpp
@@ -3933,12 +4023,16 @@ msgstr ""
msgid "Generate Visibility AABB"
msgstr ""
-#: editor/plugins/particles_editor_plugin.cpp
-msgid "Generation Time (sec):"
+#: editor/plugins/path_2d_editor_plugin.cpp
+msgid "Remove Point from Curve"
msgstr ""
#: editor/plugins/path_2d_editor_plugin.cpp
-msgid "Remove Point from Curve"
+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
@@ -3996,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 ""
@@ -4149,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 ""
@@ -4237,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 ""
@@ -4274,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
@@ -4337,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"
@@ -4416,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 ""
@@ -4438,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 ""
@@ -4655,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 "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
@@ -4745,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 "Local Coords"
msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
-msgid "Use Default sRGB"
+msgid "Transform Dialog.."
msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
@@ -4789,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
@@ -4833,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 ""
@@ -5253,11 +5425,11 @@ msgid "Invalid project path, the path must exist!"
msgstr ""
#: editor/project_manager.cpp
-msgid "Invalid project path, *.godot must not exist."
+msgid "Invalid project path, project.godot must not exist."
msgstr ""
#: editor/project_manager.cpp
-msgid "Invalid project path, *.godot must exist."
+msgid "Invalid project path, project.godot must exist."
msgstr ""
#: editor/project_manager.cpp
@@ -5269,7 +5441,7 @@ msgid "Invalid project path (changed anything?)."
msgstr ""
#: editor/project_manager.cpp
-msgid "Couldn't create *.godot project file in project path."
+msgid "Couldn't create project.godot in project path."
msgstr ""
#: editor/project_manager.cpp
@@ -5486,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 ""
@@ -5551,7 +5727,7 @@ msgid "Remove Resource Remap Option"
msgstr ""
#: editor/project_settings.cpp
-msgid "Project Settings "
+msgid "Project Settings (project.godot)"
msgstr ""
#: editor/project_settings.cpp editor/settings_config_dialog.cpp
@@ -5668,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 ""
@@ -5856,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 ""
@@ -5932,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 ""
@@ -5980,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 "Class Name"
msgstr ""
#: editor/script_create_dialog.cpp
-msgid "Built-In Script"
+#, fuzzy
+msgid "Template"
+msgstr ".تمام کا انتخاب"
+
+#: editor/script_create_dialog.cpp
+msgid "Built-in Script"
msgstr ""
#: editor/script_create_dialog.cpp
@@ -6708,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
@@ -6777,12 +7011,6 @@ msgid ""
"Nothing is visible because meshes have not been assigned to draw passes."
msgstr ""
-#: scene/3d/particles.cpp
-msgid ""
-"A material to process the particles is not assigned, so no behavior is "
-"imprinted."
-msgstr ""
-
#: scene/3d/remote_transform.cpp
msgid "Path property must point to a valid Spatial node to work."
msgstr ""
@@ -6798,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 ""
@@ -6840,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 f3afcab79d..bddb77c731 100644
--- a/editor/translations/zh_CN.po
+++ b/editor/translations/zh_CN.po
@@ -1,10 +1,10 @@
# Chinese (China) translation of the Godot Engine editor
-# Copyright (C) 2007-2017 Juan Linietsky, Ariel Manzur
-# Copyright (C) 2014-2017 Godot Engine contributors (cf. AUTHORS.md)
+# 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.
#
# 纯æ´çš„å蛋 <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.
@@ -17,16 +17,15 @@ msgid ""
msgstr ""
"Project-Id-Version: Godot Engine editor\n"
"POT-Creation-Date: \n"
-"PO-Revision-Date: 2017-03-07 06:32+0000\n"
-"Last-Translator: Youmu <konpaku.w@gmail.com>\n"
-"Language-Team: Chinese (China) <https://hosted.weblate.org/projects/godot-"
-"engine/godot/zh_CN/>\n"
+"PO-Revision-Date: 2017-06-22 20:49+0800\n"
+"Last-Translator: Geequlim <geequlim@gmail.com>\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.12\n"
+"X-Generator: Gtranslator 2.91.7\n"
#: editor/animation_editor.cpp
msgid "Disabled"
@@ -93,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"
@@ -519,7 +517,7 @@ msgstr ""
#: editor/asset_library_editor_plugin.cpp
#, fuzzy
msgid "Download Error"
-msgstr "å‘下"
+msgstr "下载"
#: editor/asset_library_editor_plugin.cpp
msgid "Download for this asset is already in progress!"
@@ -553,7 +551,8 @@ msgid "Search:"
msgstr "æœç´¢:"
#: editor/asset_library_editor_plugin.cpp editor/code_editor.cpp
-#: editor/editor_help.cpp editor/plugins/script_editor_plugin.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"
@@ -599,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 "社区"
@@ -644,7 +643,6 @@ msgid "No Matches"
msgstr "无匹é…项"
#: editor/code_editor.cpp
-#, fuzzy
msgid "Replaced %d occurrence(s)."
msgstr "替æ¢äº†%d项。"
@@ -743,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 "移除"
@@ -848,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 "路径"
@@ -934,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 "添加(Add) %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 "加载"
@@ -960,6 +958,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 "默认"
@@ -1028,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 "路径:"
@@ -1097,7 +1095,7 @@ msgstr "打包中"
#: editor/editor_export.cpp platform/javascript/export/export.cpp
msgid "Template file not found:\n"
-msgstr ""
+msgstr "找ä¸åˆ°æ¨¡æ¿æ–‡ä»¶:"
#: editor/editor_export.cpp
msgid "Added:"
@@ -1217,11 +1215,11 @@ 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 "æœç´¢å¸®åŠ©"
@@ -1238,7 +1236,6 @@ msgid "Class:"
msgstr "ç±»:"
#: editor/editor_help.cpp editor/scene_tree_editor.cpp
-#: editor/script_create_dialog.cpp
msgid "Inherits:"
msgstr "基类:"
@@ -1406,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分类下设置选择主场景。"
@@ -1469,6 +1467,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 "此场景尚未ä¿å­˜ï¼Œè¦åœ¨è¿è¡Œä¹‹å‰ä¿å­˜å®ƒå—?"
@@ -1525,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 "é¢"
@@ -1566,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 "场景"
@@ -1583,9 +1592,8 @@ msgid "Previous tab"
msgstr "上一个目录"
#: editor/editor_node.cpp
-#, fuzzy
msgid "Filter Files.."
-msgstr "快速筛选文件.."
+msgstr "筛选文件.."
#: editor/editor_node.cpp
msgid "Operations with scene files."
@@ -1619,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 "最近打开"
@@ -1647,84 +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 "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 "è¿è¡Œæ­¤é¡¹ç›®ï¼ˆ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"
@@ -1803,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"
@@ -1820,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!"
@@ -1913,6 +1935,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文件中导入模æ¿"
@@ -1940,6 +1970,36 @@ 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 "已安装æ’ä»¶:"
@@ -2057,37 +2117,32 @@ 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."
@@ -2095,27 +2150,25 @@ 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:"
@@ -2126,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!"
@@ -2161,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."
@@ -2188,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"
@@ -2225,10 +2275,6 @@ msgid "Info"
msgstr "ä¿¡æ¯"
#: editor/filesystem_dock.cpp
-msgid "Show In File Manager"
-msgstr "在资æºç®¡ç†å™¨ä¸­æ‰“å¼€"
-
-#: editor/filesystem_dock.cpp
msgid "Re-Import.."
msgstr "釿–°å¯¼å…¥.."
@@ -2306,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 "釿–°å¯¼å…¥"
@@ -2395,9 +2438,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文件。"
@@ -2878,8 +2922,8 @@ msgstr "压缩"
#: editor/io_plugins/editor_translation_import_plugin.cpp
#, fuzzy
-msgid "Add to Project (godot.cfg)"
-msgstr "添加到项目(engine.cfg)"
+msgid "Add to Project (project.godot)"
+msgstr "添加到项目 (godot.cfg)"
#: editor/io_plugins/editor_translation_import_plugin.cpp
msgid "Import Languages:"
@@ -2918,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
@@ -3539,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 "好的"
@@ -3590,17 +3633,6 @@ msgstr "创建 Poly3D (多边型3D)"
msgid "Set Handle"
msgstr "设置处ç†ç¨‹åº"
-#: editor/plugins/color_ramp_editor_plugin.cpp
-#: editor/plugins/gradient_texture_editor_plugin.cpp
-msgid "Add/Remove Color Ramp Point"
-msgstr "添加/删除色彩æ¸å˜ç‚¹"
-
-#: editor/plugins/color_ramp_editor_plugin.cpp
-#: editor/plugins/gradient_texture_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 "创建 Mesh(网格) 库"
@@ -3633,8 +3665,31 @@ 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 "修改曲线图"
+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"
@@ -3673,19 +3728,16 @@ msgid "RMB: Erase Point."
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
@@ -3718,9 +3770,8 @@ msgid "Add Point (in empty space)"
msgstr "添加点(在空白处)"
#: editor/plugins/line_2d_editor_plugin.cpp
-#, fuzzy
msgid "Split Segment (in line)"
-msgstr "拆分(曲线)"
+msgstr "拆分片段(使用线段)"
#: editor/plugins/line_2d_editor_plugin.cpp
#: editor/plugins/path_2d_editor_plugin.cpp
@@ -3909,6 +3960,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 "加载图片出错:"
@@ -3921,8 +3986,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"
@@ -3932,6 +3997,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 "å‘å°„ä½ç½®:"
+
#: editor/plugins/particles_editor_plugin.cpp
msgid "Node does not contain geometry."
msgstr "节点ä¸åŒ…å«å‡ ä½•。"
@@ -3942,12 +4028,7 @@ msgstr "节点ä¸åŒ…å«å‡ ä½•(é¢ï¼‰ã€‚"
#: editor/plugins/particles_editor_plugin.cpp
msgid "A processor material of type 'ParticlesMaterial' is required."
-msgstr ""
-
-#: editor/plugins/particles_editor_plugin.cpp
-#, fuzzy
-msgid "Generating AABB"
-msgstr "生æˆAABB"
+msgstr "需è¦ä½¿ç”¨â€œParticlesMaterialâ€ç±»åž‹çš„å¤„ç†æè´¨ã€‚"
#: editor/plugins/particles_editor_plugin.cpp
msgid "Faces contain no area!"
@@ -3962,14 +4043,12 @@ msgid "Generate AABB"
msgstr "生æˆAABB"
#: editor/plugins/particles_editor_plugin.cpp
-#, fuzzy
msgid "Create Emission Points From Mesh"
-msgstr "从网格( Mesh)创建å‘射器(Emitter)"
+msgstr "从网格( Mesh)创建å‘射器(Emission)"
#: editor/plugins/particles_editor_plugin.cpp
-#, fuzzy
msgid "Create Emission Points From Node"
-msgstr "从节点创建å‘射器(Emitter)"
+msgstr "从节点创建å‘射器(Emission)"
#: editor/plugins/particles_editor_plugin.cpp
msgid "Clear Emitter"
@@ -3980,40 +4059,42 @@ msgid "Create Emitter"
msgstr "创建å‘射器(Emitter)"
#: editor/plugins/particles_editor_plugin.cpp
-#, fuzzy
msgid "Emission Points:"
-msgstr "å‘å°„ä½ç½®ï¼š"
+msgstr "å‘å°„ä½ç½®:"
#: editor/plugins/particles_editor_plugin.cpp
-#, fuzzy
msgid "Surface Points"
-msgstr "è¡¨é¢ %d"
+msgstr "表é¢é¡¶ç‚¹"
#: editor/plugins/particles_editor_plugin.cpp
msgid "Surface Points+Normal (Directed)"
-msgstr ""
+msgstr "表é¢å®šç‚¹+法线(方å‘å‘é‡ï¼‰"
#: editor/plugins/particles_editor_plugin.cpp
msgid "Volume"
msgstr "体积"
#: editor/plugins/particles_editor_plugin.cpp
-#, fuzzy
msgid "Emission Source: "
-msgstr "å‘射填充:"
+msgstr "å‘å°„æºï¼š"
#: editor/plugins/particles_editor_plugin.cpp
#, fuzzy
msgid "Generate Visibility AABB"
msgstr "生æˆAABB"
-#: editor/plugins/particles_editor_plugin.cpp
+#: editor/plugins/path_2d_editor_plugin.cpp
+msgid "Remove Point from Curve"
+msgstr "从曲线中移除顶点"
+
+#: editor/plugins/path_2d_editor_plugin.cpp
#, fuzzy
-msgid "Generation Time (sec):"
-msgstr "å¹³å‡å¸§æ—¶é—´ï¼ˆç§’)"
+msgid "Remove Out-Control from Curve"
+msgstr "移动曲线外控制点"
#: editor/plugins/path_2d_editor_plugin.cpp
-msgid "Remove Point from Curve"
+#, fuzzy
+msgid "Remove In-Control from Curve"
msgstr "从曲线中移除顶点"
#: editor/plugins/path_2d_editor_plugin.cpp
@@ -4071,6 +4152,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贴图"
@@ -4224,6 +4315,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 "ä¿å­˜ä¸»é¢˜å‡ºé”™"
@@ -4311,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 "啿­¥è·³è¿‡"
@@ -4348,16 +4440,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."
@@ -4376,9 +4461,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"
@@ -4414,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"
@@ -4493,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 "查找上一项"
@@ -4515,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常é‡ç³»æ•°"
@@ -4732,36 +4847,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 "有更改时更新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 "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 "Gizmos(å¯è§†åŒ–调试工具)"
+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
-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 "Gizmos(å¯è§†åŒ–调试工具)"
#: 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)"
@@ -4820,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 "å˜æ¢"
@@ -4832,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个视å£"
@@ -4864,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 "显示原点"
@@ -4888,6 +5069,10 @@ msgid "View Grid"
msgstr "显示网格"
#: editor/plugins/spatial_editor_plugin.cpp
+msgid "Settings"
+msgstr "设置"
+
+#: editor/plugins/spatial_editor_plugin.cpp
msgid "Snap Settings"
msgstr "æ•æ‰(snap)设置"
@@ -4908,14 +5093,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 "é€è§†è§†è§’(角度):"
@@ -5254,24 +5431,20 @@ 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.."
@@ -5282,17 +5455,14 @@ msgid "Resources"
msgstr "资æº"
#: editor/project_export.cpp
-#, fuzzy
msgid "Export all resources in the project"
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 "导出选中的资æºï¼ˆåŒ…括其ä¾èµ–资æºï¼‰ã€‚"
@@ -5301,40 +5471,34 @@ 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!"
@@ -5342,13 +5506,13 @@ msgstr "项目目录ä¸å­˜åœ¨ï¼"
#: editor/project_manager.cpp
#, fuzzy
-msgid "Invalid project path, *.godot must not exist."
-msgstr "项目目录下必须包å«engin.cfg文件。"
+msgid "Invalid project path, project.godot must not exist."
+msgstr "项目目录下ä¸èƒ½åŒ…å«godot.cfg文件。"
#: editor/project_manager.cpp
#, fuzzy
-msgid "Invalid project path, *.godot must exist."
-msgstr "项目目录下必须包å«engin.cfg文件。"
+msgid "Invalid project path, project.godot must exist."
+msgstr "项目目录下必须包å«godot.cfg文件。"
#: editor/project_manager.cpp
msgid "Imported Project"
@@ -5360,8 +5524,8 @@ msgstr "é¡¹ç›®è·¯å¾„éžæ³•(被外部修改?)。"
#: editor/project_manager.cpp
#, fuzzy
-msgid "Couldn't create *.godot project file in project path."
-msgstr "无法在项目目录下创建engine.cfg文件。"
+msgid "Couldn't create project.godot in project path."
+msgstr "无法在项目目录下创建godot.cfg文件。"
#: editor/project_manager.cpp
msgid "The following files failed extraction from package:"
@@ -5456,7 +5620,7 @@ msgstr "新建"
#: editor/project_manager.cpp
#, fuzzy
msgid "Templates"
-msgstr "移除项目"
+msgstr "移除模æ¿"
#: editor/project_manager.cpp
msgid "Exit"
@@ -5558,16 +5722,14 @@ 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 "手柄按钮:"
@@ -5579,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 "设备"
@@ -5645,8 +5812,8 @@ msgstr "移除资æºé‡å®šå‘选项"
#: editor/project_settings.cpp
#, fuzzy
-msgid "Project Settings "
-msgstr "项目设置"
+msgid "Project Settings (project.godot)"
+msgstr "项目设置(godot.cfg)"
#: editor/project_settings.cpp editor/settings_config_dialog.cpp
msgid "General"
@@ -5713,9 +5880,8 @@ msgid "AutoLoad"
msgstr "自动加载(AutoLoad)"
#: editor/property_editor.cpp
-#, fuzzy
msgid "Pick a Viewport"
-msgstr "1个视å£"
+msgstr "选择1个视å£"
#: editor/property_editor.cpp
msgid "Ease In"
@@ -5754,20 +5920,14 @@ 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 "选择一个节点"
@@ -5911,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."
@@ -5952,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 "编辑分组"
@@ -5992,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)"
@@ -6027,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 "节点åç§°éžæ³•,ä¸å…许包å«ä»¥ä¸‹å­—符:"
@@ -6075,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
@@ -6638,31 +6869,26 @@ msgid "just released"
msgstr "刚好释放"
#: platform/javascript/export/export.cpp
-#, fuzzy
msgid "Run in Browser"
-msgstr "æµè§ˆ"
+msgstr "在æµè§ˆå™¨ä¸­è¿è¡Œ"
#: platform/javascript/export/export.cpp
msgid "Run exported HTML in the system's default browser."
-msgstr ""
+msgstr "使用默认æµè§ˆå™¨æ‰“开导出的HTML文件."
#: platform/javascript/export/export.cpp
-#, fuzzy
msgid "Could not write file:\n"
-msgstr "找ä¸åˆ°ç –å—:"
+msgstr "无法写入文件:\n"
#: platform/javascript/export/export.cpp
-#, fuzzy
msgid "Could not read file:\n"
-msgstr "找ä¸åˆ°ç –å—:"
+msgstr "æ— æ³•è¯»å–æ–‡ä»¶:\n"
#: platform/javascript/export/export.cpp
-#, fuzzy
msgid "Could not open template for export:\n"
-msgstr "无法创建目录。"
+msgstr "无法打开导出模æ¿ï¼š\n"
#: platform/uwp/export/export.cpp
-#, fuzzy
msgid ""
"Couldn't read the certificate file. Are the path and password both correct?"
msgstr "无法读å–è¯ä¹¦æ–‡ä»¶ã€‚è·¯å¾„å’Œå¯†ç æ˜¯å¦éƒ½æ­£ç¡®ï¼Ÿ"
@@ -6815,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."
@@ -6894,12 +7122,6 @@ msgid ""
"Nothing is visible because meshes have not been assigned to draw passes."
msgstr ""
-#: scene/3d/particles.cpp
-msgid ""
-"A material to process the particles is not assigned, so no behavior is "
-"imprinted."
-msgstr ""
-
#: scene/3d/remote_transform.cpp
msgid "Path property must point to a valid Spatial node to work."
msgstr "path属性必须指å‘ä¸€ä¸ªåˆæ³•çš„Spatial节点æ‰èƒ½æ­£å¸¸å·¥ä½œã€‚"
@@ -6917,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 "æç¤ºï¼"
@@ -6960,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 ""
@@ -6978,9 +7218,62 @@ msgstr ""
#~ msgid "Import assets to the project."
#~ msgstr "导入资æºã€‚"
-#, fuzzy
-#~ msgid "Project Settings (godot.cfg)"
-#~ msgstr "项目设置(engine.cfg)"
+#~ 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 "表é¢"
@@ -7201,9 +7494,6 @@ msgstr ""
#~ msgid "Trailing Silence:"
#~ msgstr "å°¾éšæ²‰é»˜(Trailing Silence):"
-#~ msgid "Script"
-#~ msgstr "脚本"
-
#~ msgid "Script Export Mode:"
#~ msgstr "脚本导出方å¼:"
@@ -7237,9 +7527,6 @@ msgstr ""
#~ msgid "BakedLightInstance does not contain a BakedLight resource."
#~ msgstr "BakedLightInstance未包å«BakedLight资æºã€‚"
-#~ msgid "Vertex"
-#~ msgstr "顶点"
-
#~ msgid "Fragment"
#~ msgstr "片段"
@@ -7269,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 e49582e901..110f5b6fab 100644
--- a/editor/translations/zh_HK.po
+++ b/editor/translations/zh_HK.po
@@ -1,6 +1,5 @@
-# Chinese (Honk Kong) translation of the Godot Engine editor
-# Copyright (C) 2007-2017 Juan Linietsky, Ariel Manzur
-# Copyright (C) 2014-2017 Godot Engine contributors (cf. AUTHORS.md)
+# 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.
#
# Wesley (zx-wt) <ZX_WT@ymail.com>, 2016.
@@ -542,7 +541,8 @@ msgid "Search:"
msgstr ""
#: editor/asset_library_editor_plugin.cpp editor/code_editor.cpp
-#: editor/editor_help.cpp editor/plugins/script_editor_plugin.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"
@@ -588,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 "社群"
@@ -733,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 "移除"
@@ -839,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 "路徑"
@@ -939,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 ""
@@ -950,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 "é è¨­"
@@ -1020,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 "路徑:"
@@ -1215,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 ""
@@ -1232,7 +1234,6 @@ msgid "Class:"
msgstr ""
#: editor/editor_help.cpp editor/scene_tree_editor.cpp
-#: editor/script_create_dialog.cpp
msgid "Inherits:"
msgstr ""
@@ -1405,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
@@ -1460,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 ""
@@ -1516,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 ""
@@ -1554,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 "場景"
@@ -1607,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 "開啓最近的"
@@ -1635,83 +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"
+msgid "Miscellaneous project or scene-wide tools."
msgstr ""
#: editor/editor_node.cpp
-msgid "Distraction Free Mode"
+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."
-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
@@ -1782,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"
@@ -1803,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 ""
@@ -1891,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 ""
@@ -1918,6 +1949,33 @@ 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
+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 "Installed Plugins:"
msgstr ""
@@ -2164,6 +2222,10 @@ msgid "Collapse all"
msgstr ""
#: editor/filesystem_dock.cpp
+msgid "Show In File Manager"
+msgstr ""
+
+#: editor/filesystem_dock.cpp
msgid "Instance"
msgstr ""
@@ -2192,10 +2254,6 @@ msgid "Info"
msgstr ""
#: editor/filesystem_dock.cpp
-msgid "Show In File Manager"
-msgstr ""
-
-#: editor/filesystem_dock.cpp
msgid "Re-Import.."
msgstr ""
@@ -2364,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
@@ -2839,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
@@ -3499,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"
@@ -3548,17 +3606,6 @@ msgstr ""
msgid "Set Handle"
msgstr ""
-#: editor/plugins/color_ramp_editor_plugin.cpp
-#: editor/plugins/gradient_texture_editor_plugin.cpp
-msgid "Add/Remove Color Ramp Point"
-msgstr ""
-
-#: editor/plugins/color_ramp_editor_plugin.cpp
-#: editor/plugins/gradient_texture_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 ""
@@ -3590,9 +3637,32 @@ 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 ""
@@ -3862,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 ""
@@ -3874,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
@@ -3885,20 +3968,33 @@ msgstr ""
msgid "Generated Point Count:"
msgstr ""
+#: editor/plugins/particles_2d_editor_plugin.cpp
#: editor/plugins/particles_editor_plugin.cpp
-msgid "Node does not contain geometry."
+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 (faces)."
+msgid "Node does not contain geometry."
msgstr ""
#: editor/plugins/particles_editor_plugin.cpp
-msgid "A processor material of type 'ParticlesMaterial' is required."
+msgid "Node does not contain geometry (faces)."
msgstr ""
#: editor/plugins/particles_editor_plugin.cpp
-msgid "Generating AABB"
+msgid "A processor material of type 'ParticlesMaterial' is required."
msgstr ""
#: editor/plugins/particles_editor_plugin.cpp
@@ -3953,12 +4049,16 @@ msgstr ""
msgid "Generate Visibility AABB"
msgstr ""
-#: editor/plugins/particles_editor_plugin.cpp
-msgid "Generation Time (sec):"
+#: editor/plugins/path_2d_editor_plugin.cpp
+msgid "Remove Point from Curve"
msgstr ""
#: editor/plugins/path_2d_editor_plugin.cpp
-msgid "Remove Point from Curve"
+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
@@ -4016,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 ""
@@ -4169,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 ""
@@ -4258,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 ""
@@ -4295,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
@@ -4359,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"
@@ -4438,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 ""
@@ -4460,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 ""
@@ -4677,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 "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
@@ -4766,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
@@ -4810,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 ""
@@ -4834,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 ""
@@ -4854,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 ""
@@ -5279,11 +5464,11 @@ msgid "Invalid project path, the path must exist!"
msgstr ""
#: editor/project_manager.cpp
-msgid "Invalid project path, *.godot must not exist."
+msgid "Invalid project path, project.godot must not exist."
msgstr ""
#: editor/project_manager.cpp
-msgid "Invalid project path, *.godot must exist."
+msgid "Invalid project path, project.godot must exist."
msgstr ""
#: editor/project_manager.cpp
@@ -5295,7 +5480,7 @@ msgid "Invalid project path (changed anything?)."
msgstr ""
#: editor/project_manager.cpp
-msgid "Couldn't create *.godot project file in project path."
+msgid "Couldn't create project.godot in project path."
msgstr ""
#: editor/project_manager.cpp
@@ -5513,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 "設備"
@@ -5578,9 +5767,8 @@ msgid "Remove Resource Remap Option"
msgstr ""
#: editor/project_settings.cpp
-#, fuzzy
-msgid "Project Settings "
-msgstr "設定"
+msgid "Project Settings (project.godot)"
+msgstr ""
#: editor/project_settings.cpp editor/settings_config_dialog.cpp
msgid "General"
@@ -5696,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 "貼上"
@@ -5887,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 ""
@@ -5964,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 ""
@@ -6012,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 "下一個腳本"
@@ -6752,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
@@ -6821,12 +7072,6 @@ msgid ""
"Nothing is visible because meshes have not been assigned to draw passes."
msgstr ""
-#: scene/3d/particles.cpp
-msgid ""
-"A material to process the particles is not assigned, so no behavior is "
-"imprinted."
-msgstr ""
-
#: scene/3d/remote_transform.cpp
msgid "Path property must point to a valid Spatial node to work."
msgstr ""
@@ -6842,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 "警告!"
@@ -6884,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 "
@@ -6892,6 +7151,9 @@ msgid ""
"texture to some node for display."
msgstr ""
+#~ msgid "Valid name"
+#~ msgstr "有效å稱"
+
#~ msgid "Please save the scene first."
#~ msgstr "請先儲存場景"
@@ -6946,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 7836cd2f76..c5a1f6994c 100644
--- a/editor/translations/zh_TW.po
+++ b/editor/translations/zh_TW.po
@@ -1,31 +1,31 @@
# Chinese (Taiwan) translation of the Godot Engine editor
-# Copyright (C) 2007-2017 Juan Linietsky, Ariel Manzur
-# Copyright (C) 2014-2017 Godot Engine contributors (cf. AUTHORS.md)
+# 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"
@@ -89,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"
@@ -101,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"
@@ -109,7 +109,7 @@ msgstr ""
#: editor/animation_editor.cpp
msgid "Remove Selection"
-msgstr ""
+msgstr "移除所é¸"
#: editor/animation_editor.cpp
msgid "Continuous"
@@ -121,7 +121,7 @@ msgstr ""
#: editor/animation_editor.cpp
msgid "Trigger"
-msgstr ""
+msgstr "觸發器"
#: editor/animation_editor.cpp
msgid "Anim Add Key"
@@ -141,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"
@@ -177,7 +177,7 @@ msgstr ""
#: editor/animation_editor.cpp
msgid "Optimize Animation"
-msgstr ""
+msgstr "最佳化動畫"
#: editor/animation_editor.cpp
msgid "Clean-Up Animation"
@@ -199,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"
@@ -247,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)."
@@ -370,14 +370,15 @@ msgid "Contents:"
msgstr ""
#: editor/asset_library_editor_plugin.cpp
+#, fuzzy
msgid "View Files"
-msgstr ""
+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 ""
+msgstr "æè¿°:"
#: editor/asset_library_editor_plugin.cpp editor/project_manager.cpp
msgid "Install"
@@ -410,8 +411,9 @@ msgid "Connection error, please try again."
msgstr ""
#: editor/asset_library_editor_plugin.cpp
+#, fuzzy
msgid "Can't connect."
-msgstr ""
+msgstr "連接..."
#: editor/asset_library_editor_plugin.cpp
msgid "Can't connect to host:"
@@ -478,16 +480,18 @@ msgid "Resolving.."
msgstr ""
#: editor/asset_library_editor_plugin.cpp
+#, fuzzy
msgid "Connecting.."
-msgstr ""
+msgstr "連接..."
#: editor/asset_library_editor_plugin.cpp
msgid "Requesting.."
msgstr ""
#: editor/asset_library_editor_plugin.cpp
+#, fuzzy
msgid "Error making request"
-msgstr ""
+msgstr "載入場景時發生錯誤"
#: editor/asset_library_editor_plugin.cpp
msgid "Idle"
@@ -523,21 +527,22 @@ msgstr ""
#: editor/asset_library_editor_plugin.cpp
msgid "All"
-msgstr ""
+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 ""
+msgstr "æœå°‹:"
#: editor/asset_library_editor_plugin.cpp editor/code_editor.cpp
-#: editor/editor_help.cpp editor/plugins/script_editor_plugin.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 ""
+msgstr "æœå°‹"
#: editor/asset_library_editor_plugin.cpp editor/editor_node.cpp
#: editor/io_plugins/editor_bitmask_import_plugin.cpp
@@ -557,15 +562,15 @@ 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 ""
+msgstr "類別:"
#: editor/asset_library_editor_plugin.cpp
msgid "Site:"
@@ -577,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 ""
@@ -601,43 +606,43 @@ 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"
@@ -645,27 +650,27 @@ msgstr ""
#: editor/code_editor.cpp
msgid "Selection Only"
-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"
@@ -673,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!"
@@ -717,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:"
@@ -739,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"
@@ -767,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"
@@ -780,22 +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 ""
+msgstr "ç¬¦åˆæ¢ä»¶:"
#: editor/dependency_editor.cpp
msgid "Search Replacement For:"
@@ -810,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 ""
@@ -827,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:"
@@ -856,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"
@@ -887,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:"
@@ -903,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.."
@@ -927,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."
@@ -955,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"
@@ -999,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"
@@ -1027,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:"
@@ -1079,11 +1092,11 @@ 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:"
@@ -1103,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"
@@ -1111,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"
@@ -1131,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"
@@ -1171,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."
@@ -1196,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 ""
@@ -1215,7 +1229,6 @@ msgid "Class:"
msgstr ""
#: editor/editor_help.cpp editor/scene_tree_editor.cpp
-#: editor/script_create_dialog.cpp
msgid "Inherits:"
msgstr ""
@@ -1257,18 +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 ""
+msgstr "清除"
#: editor/editor_node.cpp editor/plugins/animation_player_editor_plugin.cpp
#: editor/resources_dock.cpp
@@ -1283,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:"
@@ -1303,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 ""
@@ -1352,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"
@@ -1376,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."
@@ -1385,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
@@ -1405,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"
@@ -1421,7 +1434,7 @@ msgstr ""
#: editor/editor_node.cpp
msgid "Quick Open Scene.."
-msgstr ""
+msgstr "快速開啟場景"
#: editor/editor_node.cpp
msgid "Quick Open Script.."
@@ -1429,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"
@@ -1453,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 ""
@@ -1496,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 ""
@@ -1508,7 +1525,7 @@ msgstr ""
#: editor/editor_node.cpp
msgid "Error loading scene."
-msgstr ""
+msgstr "載入場景時發生錯誤"
#: editor/editor_node.cpp
msgid "Scene '%s' has broken dependencies:"
@@ -1524,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."
@@ -1544,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."
@@ -1568,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.."
@@ -1606,91 +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"
+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 ""
-
-#: 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 ""
+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
@@ -1761,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
@@ -1782,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
@@ -1870,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 ""
@@ -1897,6 +1940,31 @@ 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
+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 ""
@@ -2140,6 +2208,10 @@ msgid "Collapse all"
msgstr ""
#: editor/filesystem_dock.cpp
+msgid "Show In File Manager"
+msgstr ""
+
+#: editor/filesystem_dock.cpp
msgid "Instance"
msgstr ""
@@ -2168,10 +2240,6 @@ msgid "Info"
msgstr ""
#: editor/filesystem_dock.cpp
-msgid "Show In File Manager"
-msgstr ""
-
-#: editor/filesystem_dock.cpp
msgid "Re-Import.."
msgstr ""
@@ -2337,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
@@ -2812,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
@@ -3472,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 ""
@@ -3521,17 +3589,6 @@ msgstr ""
msgid "Set Handle"
msgstr ""
-#: editor/plugins/color_ramp_editor_plugin.cpp
-#: editor/plugins/gradient_texture_editor_plugin.cpp
-msgid "Add/Remove Color Ramp Point"
-msgstr ""
-
-#: editor/plugins/color_ramp_editor_plugin.cpp
-#: editor/plugins/gradient_texture_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 ""
@@ -3563,9 +3620,31 @@ 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 ""
@@ -3835,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 ""
@@ -3847,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
@@ -3858,20 +3950,33 @@ msgstr ""
msgid "Generated Point Count:"
msgstr ""
+#: editor/plugins/particles_2d_editor_plugin.cpp
#: editor/plugins/particles_editor_plugin.cpp
-msgid "Node does not contain geometry."
+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 (faces)."
+msgid "Node does not contain geometry."
msgstr ""
#: editor/plugins/particles_editor_plugin.cpp
-msgid "A processor material of type 'ParticlesMaterial' is required."
+msgid "Node does not contain geometry (faces)."
msgstr ""
#: editor/plugins/particles_editor_plugin.cpp
-msgid "Generating AABB"
+msgid "A processor material of type 'ParticlesMaterial' is required."
msgstr ""
#: editor/plugins/particles_editor_plugin.cpp
@@ -3926,12 +4031,16 @@ msgstr ""
msgid "Generate Visibility AABB"
msgstr ""
-#: editor/plugins/particles_editor_plugin.cpp
-msgid "Generation Time (sec):"
+#: editor/plugins/path_2d_editor_plugin.cpp
+msgid "Remove Point from Curve"
msgstr ""
#: editor/plugins/path_2d_editor_plugin.cpp
-msgid "Remove Point from Curve"
+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
@@ -3989,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 ""
@@ -4142,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 ""
@@ -4229,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 ""
@@ -4266,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
@@ -4329,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"
@@ -4408,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 ""
@@ -4430,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 ""
@@ -4647,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 "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
@@ -4735,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
@@ -4779,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
@@ -4823,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 ""
@@ -5209,9 +5400,8 @@ msgid "Export Mode:"
msgstr ""
#: editor/project_export.cpp
-#, fuzzy
msgid "Resources to export:"
-msgstr "資æºè·¯å¾‘"
+msgstr "è¦è¼¸å‡ºçš„資æº:"
#: editor/project_export.cpp
msgid ""
@@ -5244,11 +5434,11 @@ msgid "Invalid project path, the path must exist!"
msgstr ""
#: editor/project_manager.cpp
-msgid "Invalid project path, *.godot must not exist."
+msgid "Invalid project path, project.godot must not exist."
msgstr ""
#: editor/project_manager.cpp
-msgid "Invalid project path, *.godot must exist."
+msgid "Invalid project path, project.godot must exist."
msgstr ""
#: editor/project_manager.cpp
@@ -5260,7 +5450,7 @@ msgid "Invalid project path (changed anything?)."
msgstr ""
#: editor/project_manager.cpp
-msgid "Couldn't create *.godot project file in project path."
+msgid "Couldn't create project.godot in project path."
msgstr ""
#: editor/project_manager.cpp
@@ -5476,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 ""
@@ -5541,8 +5735,9 @@ msgid "Remove Resource Remap Option"
msgstr ""
#: editor/project_settings.cpp
-msgid "Project Settings "
-msgstr ""
+#, fuzzy
+msgid "Project Settings (project.godot)"
+msgstr "專案設定"
#: editor/project_settings.cpp editor/settings_config_dialog.cpp
msgid "General"
@@ -5657,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 ""
@@ -5845,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 ""
@@ -5919,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 ""
@@ -5967,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
@@ -6705,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
@@ -6774,12 +7029,6 @@ msgid ""
"Nothing is visible because meshes have not been assigned to draw passes."
msgstr ""
-#: scene/3d/particles.cpp
-msgid ""
-"A material to process the particles is not assigned, so no behavior is "
-"imprinted."
-msgstr ""
-
#: scene/3d/remote_transform.cpp
msgid "Path property must point to a valid Spatial node to work."
msgstr ""
@@ -6795,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 ""
@@ -6837,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/main/SCsub b/main/SCsub
index 56dfbaa0f1..1675a6e6ab 100644
--- a/main/SCsub
+++ b/main/SCsub
@@ -47,11 +47,11 @@ env.add_source_files(env.main_sources, "*.cpp")
Export('env')
-env.Depends("#main/splash.h", "#main/splash.png")
-env.Command("#main/splash.h", "#main/splash.png", make_splash)
+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.h", "#main/app_icon.png")
-env.Command("#main/app_icon.h", "#main/app_icon.png", make_app_icon)
+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')
diff --git a/main/input_default.cpp b/main/input_default.cpp
index 0de30e5e9e..bde1e84926 100644
--- a/main/input_default.cpp
+++ b/main/input_default.cpp
@@ -325,11 +325,11 @@ void InputDefault::parse_input_event(const Ref<InputEvent> &p_event) {
Ref<InputEventScreenTouch> touch_event;
touch_event.instance();
touch_event->set_pressed(mb->is_pressed());
- touch_event->set_pos(mb->get_pos());
+ touch_event->set_position(mb->get_position());
main_loop->input_event(touch_event);
}
- Point2 pos = mb->get_global_pos();
+ Point2 pos = mb->get_global_position();
if (mouse_pos != pos) {
set_mouse_position(pos);
}
@@ -343,7 +343,7 @@ void InputDefault::parse_input_event(const Ref<InputEvent> &p_event) {
Ref<InputEventScreenDrag> drag_event;
drag_event.instance();
- drag_event->set_pos(mm->get_pos());
+ drag_event->set_position(mm->get_position());
drag_event->set_relative(mm->get_relative());
drag_event->set_speed(mm->get_speed());
@@ -493,10 +493,10 @@ Point2i InputDefault::warp_mouse_motion(const Ref<InputEventMouseMotion> &p_moti
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_pos() - p_rect.pos;
+ 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;
@@ -874,6 +874,8 @@ 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) {
diff --git a/main/main.cpp b/main/main.cpp
index e13fb8d3db..218321ef25 100644
--- a/main/main.cpp
+++ b/main/main.cpp
@@ -28,7 +28,7 @@
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
#include "main.h"
-#include "app_icon.h"
+#include "app_icon.gen.h"
#include "core/register_core_types.h"
#include "drivers/register_driver_types.h"
#include "global_config.h"
@@ -39,11 +39,11 @@
#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"
@@ -581,12 +581,11 @@ Error Main::setup(const char *execpath, int argc, char *argv[], bool p_second_ph
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);
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) {
int sep_pos = debug_host.find_last(":");
debug_port = debug_host.substr(sep_pos + 1, debug_host.length()).to_int();
@@ -1014,6 +1013,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();
diff --git a/main/performance.cpp b/main/performance.cpp
index 5788f64239..c819e15f71 100644
--- a/main/performance.cpp
+++ b/main/performance.cpp
@@ -30,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"
diff --git a/main/tests/test_gui.cpp b/main/tests/test_gui.cpp
index 3d0b96ae5b..3c6a708cd8 100644
--- a/main/tests/test_gui.cpp
+++ b/main/tests/test_gui.cpp
@@ -50,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 {
@@ -87,10 +86,6 @@ 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") );
@@ -375,6 +370,6 @@ MainLoop *test() {
return memnew(TestMainLoop);
}
-}
+} // namespace TestGUI
#endif
diff --git a/main/tests/test_physics_2d.cpp b/main/tests/test_physics_2d.cpp
index 5f57275503..2c9b51aadb 100644
--- a/main/tests/test_physics_2d.cpp
+++ b/main/tests/test_physics_2d.cpp
@@ -216,7 +216,7 @@ protected:
if (mb->is_pressed()) {
- Point2 p(mb->get_pos().x, mb->get_pos().y);
+ Point2 p(mb->get_position().x, mb->get_position().y);
if (mb->get_button_index() == 1) {
ray_to = p;
@@ -232,7 +232,7 @@ protected:
if (mm.is_valid()) {
- Point2 p = mm->get_pos();
+ Point2 p = mm->get_position();
if (mm->get_button_mask() & BUTTON_MASK_LEFT) {
ray_to = p;
diff --git a/methods.py b/methods.py
index 5af6c6aed0..4d3d5ae343 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")
@@ -486,7 +486,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 +843,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 +858,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 +1165,7 @@ def update_version():
print("Using custom revision: " + rev)
import version
- f = open("core/version_generated.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")
@@ -1224,7 +1224,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 +1299,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
@@ -1513,23 +1513,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))
- b = pngf.read(1)
- if (len(b) == 1):
- str += ","
-
- str += "};\n"
+ names = ['logo']
+ if os.path.isfile(x + "/run_icon.png"):
+ names.append('run_icon')
- wf = x + "/logo.h"
- logow = open(wf, "wb")
- logow.write(str)
+ for name in names:
+ pngf = open(x + "/" + name + ".png", "rb")
+ b = pngf.read(1)
+ 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"
+
+ wf = x + "/" + name + ".gen.h"
+ pngw = open(wf, "wb")
+ pngw.write(str)
def no_verbose(sys, env):
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/enet/networked_multiplayer_enet.cpp b/modules/enet/networked_multiplayer_enet.cpp
index c05c86d9ae..738bd27ed3 100644
--- a/modules/enet/networked_multiplayer_enet.cpp
+++ b/modules/enet/networked_multiplayer_enet.cpp
@@ -575,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); }
}
@@ -608,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) {
@@ -629,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;
@@ -654,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 c20c1af68e..8b971adf55 100644
--- a/modules/enet/networked_multiplayer_enet.h
+++ b/modules/enet/networked_multiplayer_enet.h
@@ -43,7 +43,8 @@ public:
COMPRESS_NONE,
COMPRESS_RANGE_CODER,
COMPRESS_FASTLZ,
- COMPRESS_ZLIB
+ COMPRESS_ZLIB,
+ COMPRESS_ZSTD
};
private:
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 69e082bb87..3cbadef6fa 100644
--- a/modules/etc1/image_etc.h
+++ b/modules/etc/image_etc.h
@@ -30,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 859486222f..e777859a8f 100644
--- a/modules/etc1/register_types.cpp
+++ b/modules/etc/register_types.cpp
@@ -34,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 0552b87d65..44399376f3 100644
--- a/modules/etc1/register_types.h
+++ b/modules/etc/register_types.h
@@ -27,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 c04528d2a0..c04528d2a0 100644
--- a/modules/etc1/texture_loader_pkm.cpp
+++ b/modules/etc/texture_loader_pkm.cpp
diff --git a/modules/etc1/texture_loader_pkm.h b/modules/etc/texture_loader_pkm.h
index 8a0f06a51a..8a0f06a51a 100644
--- a/modules/etc1/texture_loader_pkm.h
+++ b/modules/etc/texture_loader_pkm.h
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 121f50684d..0000000000
--- a/modules/etc1/image_etc.cpp
+++ /dev/null
@@ -1,183 +0,0 @@
-/*************************************************************************/
-/* 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 "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()));
- bool needs_mipmaps = p_img->has_mipmaps();
- p_img->create(p_img->get_width(), p_img->get_height(), p_img->has_mipmaps(), Image::FORMAT_RGB8, dst);
- if (needs_mipmaps)
- p_img->generate_mipmaps();
-}
-
-static void _compress_etc(Image *p_img) {
-
- Ref<Image> img = p_img->duplicate();
-
- 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->create(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 8401c36b54..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",
@@ -77,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/gdnative/gdnative.cpp b/modules/gdnative/gdnative.cpp
index 9c8625c1e0..dad9a54df6 100644
--- a/modules/gdnative/gdnative.cpp
+++ b/modules/gdnative/gdnative.cpp
@@ -35,7 +35,7 @@
#include "os/file_access.h"
#include "os/os.h"
-#include "scene/main/scene_main_loop.h"
+#include "scene/main/scene_tree.h"
#include "scene/resources/scene_format_text.h"
#if defined(TOOLS_ENABLED) && defined(DEBUG_METHODS_ENABLED)
@@ -516,9 +516,9 @@ static const char *_dl_platforms_info[] = {
"unix|server|so|Server",
"unix|android|so|Android",
"unix|haiku|so|Haiku", // Right?
- "|mac|dynlib|Mac",
- "mac|ios|dynlib|iOS",
- "mac|osx|dynlib|OSX",
+ "|mac|dylib|Mac",
+ "mac|ios|dylib|iOS",
+ "mac|osx|dylib|OSX",
"|html5|js|HTML5",
"|windows|dll|Windows",
"windows|uwp|dll|UWP",
diff --git a/modules/gdnative/gdnative.h b/modules/gdnative/gdnative.h
index 6716b684a0..650f999192 100644
--- a/modules/gdnative/gdnative.h
+++ b/modules/gdnative/gdnative.h
@@ -335,7 +335,7 @@ public:
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 Error complete_code(const String &p_code, const String &p_base_path, Object *p_owner, List<String> *r_options, String &r_call_hint) { return ERR_UNAVAILABLE; }
virtual Error lookup_code(const String &p_code, const String &p_symbol, const String &p_base_path, Object *p_owner, LookupResult &r_result) { return ERR_UNAVAILABLE; }
diff --git a/modules/gdnative/godot.h b/modules/gdnative/godot.h
index 726bde0b65..1d86998291 100644
--- a/modules/gdnative/godot.h
+++ b/modules/gdnative/godot.h
@@ -60,6 +60,13 @@ extern "C" {
#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>
diff --git a/modules/gdnative/godot/godot_array.cpp b/modules/gdnative/godot/godot_array.cpp
index 8cf6d1b8ef..5497dde520 100644
--- a/modules/gdnative/godot/godot_array.cpp
+++ b/modules/gdnative/godot/godot_array.cpp
@@ -44,256 +44,264 @@ extern "C" {
void _array_api_anchor() {
}
-void GDAPI godot_array_new(godot_array *p_arr) {
- Array *a = (Array *)p_arr;
- memnew_placement(a, Array);
+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 *p_dest, const godot_array *p_src) {
- Array *dest = (Array *)p_dest;
+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 *p_arr, const godot_pool_color_array *p_pca) {
- Array *a = (Array *)p_arr;
+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(a, Array);
- a->resize(pca->size());
+ memnew_placement(dest, Array);
+ dest->resize(pca->size());
- for (size_t i = 0; i < a->size(); i++) {
+ for (size_t i = 0; i < dest->size(); i++) {
Variant v = pca->operator[](i);
- a->operator[](i) = v;
+ dest->operator[](i) = v;
}
}
-void GDAPI godot_array_new_pool_vector3_array(godot_array *p_arr, const godot_pool_vector3_array *p_pv3a) {
- Array *a = (Array *)p_arr;
+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(a, Array);
- a->resize(pca->size());
+ memnew_placement(dest, Array);
+ dest->resize(pca->size());
- for (size_t i = 0; i < a->size(); i++) {
+ for (size_t i = 0; i < dest->size(); i++) {
Variant v = pca->operator[](i);
- a->operator[](i) = v;
+ dest->operator[](i) = v;
}
}
-void GDAPI godot_array_new_pool_vector2_array(godot_array *p_arr, const godot_pool_vector2_array *p_pv2a) {
- Array *a = (Array *)p_arr;
+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(a, Array);
- a->resize(pca->size());
+ memnew_placement(dest, Array);
+ dest->resize(pca->size());
- for (size_t i = 0; i < a->size(); i++) {
+ for (size_t i = 0; i < dest->size(); i++) {
Variant v = pca->operator[](i);
- a->operator[](i) = v;
+ dest->operator[](i) = v;
}
}
-void GDAPI godot_array_new_pool_string_array(godot_array *p_arr, const godot_pool_string_array *p_psa) {
- Array *a = (Array *)p_arr;
+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(a, Array);
- a->resize(pca->size());
+ memnew_placement(dest, Array);
+ dest->resize(pca->size());
- for (size_t i = 0; i < a->size(); i++) {
+ for (size_t i = 0; i < dest->size(); i++) {
Variant v = pca->operator[](i);
- a->operator[](i) = v;
+ dest->operator[](i) = v;
}
}
-void GDAPI godot_array_new_pool_real_array(godot_array *p_arr, const godot_pool_real_array *p_pra) {
- Array *a = (Array *)p_arr;
+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(a, Array);
- a->resize(pca->size());
+ memnew_placement(dest, Array);
+ dest->resize(pca->size());
- for (size_t i = 0; i < a->size(); i++) {
+ for (size_t i = 0; i < dest->size(); i++) {
Variant v = pca->operator[](i);
- a->operator[](i) = v;
+ dest->operator[](i) = v;
}
}
-void GDAPI godot_array_new_pool_int_array(godot_array *p_arr, const godot_pool_int_array *p_pia) {
- Array *a = (Array *)p_arr;
+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(a, Array);
- a->resize(pca->size());
+ memnew_placement(dest, Array);
+ dest->resize(pca->size());
- for (size_t i = 0; i < a->size(); i++) {
+ for (size_t i = 0; i < dest->size(); i++) {
Variant v = pca->operator[](i);
- a->operator[](i) = v;
+ dest->operator[](i) = v;
}
}
-void GDAPI godot_array_new_pool_byte_array(godot_array *p_arr, const godot_pool_byte_array *p_pba) {
- Array *a = (Array *)p_arr;
+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(a, Array);
- a->resize(pca->size());
+ memnew_placement(dest, Array);
+ dest->resize(pca->size());
- for (size_t i = 0; i < a->size(); i++) {
+ for (size_t i = 0; i < dest->size(); i++) {
Variant v = pca->operator[](i);
- a->operator[](i) = v;
+ dest->operator[](i) = v;
}
}
-void GDAPI godot_array_set(godot_array *p_arr, const godot_int p_idx, const godot_variant *p_value) {
- Array *a = (Array *)p_arr;
+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;
- a->operator[](p_idx) = *val;
+ self->operator[](p_idx) = *val;
}
-godot_variant GDAPI *godot_array_get(const godot_array *p_arr, const godot_int p_idx) {
- Array *a = (Array *)p_arr;
- return (godot_variant *)&a->operator[](p_idx);
+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;
}
-void GDAPI godot_array_append(godot_array *p_arr, const godot_variant *p_value) {
- Array *a = (Array *)p_arr;
+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;
- a->append(*val);
+ self->append(*val);
}
-void GDAPI godot_array_clear(godot_array *p_arr) {
- Array *a = (Array *)p_arr;
- a->clear();
+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_arr, const godot_variant *p_value) {
- const Array *a = (const Array *)p_arr;
+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 a->count(*val);
+ return self->count(*val);
}
-godot_bool GDAPI godot_array_empty(const godot_array *p_arr) {
- const Array *a = (const Array *)p_arr;
- return a->empty();
+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_arr, const godot_variant *p_value) {
- Array *a = (Array *)p_arr;
+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;
- a->erase(*val);
+ self->erase(*val);
}
-godot_variant GDAPI godot_array_front(const godot_array *p_arr) {
- const Array *a = (const Array *)p_arr;
+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 = a->front();
+ *val = self->front();
return v;
}
-godot_variant GDAPI godot_array_back(const godot_array *p_arr) {
- const Array *a = (const Array *)p_arr;
+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 = a->back();
+ *val = self->back();
return v;
}
-godot_int GDAPI godot_array_find(const godot_array *p_arr, const godot_variant *p_what, const godot_int p_from) {
- const Array *a = (const Array *)p_arr;
+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 a->find(*val, p_from);
+ return self->find(*val, p_from);
}
-godot_int GDAPI godot_array_find_last(const godot_array *p_arr, const godot_variant *p_what) {
- const Array *a = (const Array *)p_arr;
+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 a->find_last(*val);
+ return self->find_last(*val);
}
-godot_bool GDAPI godot_array_has(const godot_array *p_arr, const godot_variant *p_value) {
- const Array *a = (const Array *)p_arr;
+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 a->has(*val);
+ return self->has(*val);
}
-uint32_t GDAPI godot_array_hash(const godot_array *p_arr) {
- const Array *a = (const Array *)p_arr;
- return a->hash();
+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_arr, const godot_int p_pos, const godot_variant *p_value) {
- Array *a = (Array *)p_arr;
+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;
- a->insert(p_pos, *val);
+ self->insert(p_pos, *val);
}
-void GDAPI godot_array_invert(godot_array *p_arr) {
- Array *a = (Array *)p_arr;
- a->invert();
+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_arr) {
- Array *a = (Array *)p_arr;
+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 = a->pop_back();
+ *val = self->pop_back();
return v;
}
-godot_variant GDAPI godot_array_pop_front(godot_array *p_arr) {
- Array *a = (Array *)p_arr;
+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 = a->pop_front();
+ *val = self->pop_front();
return v;
}
-void GDAPI godot_array_push_back(godot_array *p_arr, const godot_variant *p_value) {
- Array *a = (Array *)p_arr;
+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;
- a->push_back(*val);
+ self->push_back(*val);
}
-void GDAPI godot_array_push_front(godot_array *p_arr, const godot_variant *p_value) {
- Array *a = (Array *)p_arr;
+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;
- a->push_front(*val);
+ self->push_front(*val);
}
-void GDAPI godot_array_remove(godot_array *p_arr, const godot_int p_idx) {
- Array *a = (Array *)p_arr;
- a->remove(p_idx);
+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_arr, const godot_int p_size) {
- Array *a = (Array *)p_arr;
- a->resize(p_size);
+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_arr, const godot_variant *p_what, const godot_int p_from) {
- const Array *a = (const Array *)p_arr;
+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 a->rfind(*val, p_from);
+ return self->rfind(*val, p_from);
}
-godot_int GDAPI godot_array_size(const godot_array *p_arr) {
- const Array *a = (const Array *)p_arr;
- return a->size();
+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_arr) {
- Array *a = (Array *)p_arr;
- a->sort();
+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_arr, godot_object *p_obj, const godot_string *p_func) {
- Array *a = (Array *)p_arr;
+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;
- a->sort_custom((Object *)p_obj, *func);
+ self->sort_custom((Object *)p_obj, *func);
}
-void GDAPI godot_array_destroy(godot_array *p_arr) {
- ((Array *)p_arr)->~Array();
+void GDAPI godot_array_destroy(godot_array *p_self) {
+ ((Array *)p_self)->~Array();
}
#ifdef __cplusplus
diff --git a/modules/gdnative/godot/godot_array.h b/modules/gdnative/godot/godot_array.h
index 5db0031b8c..bf8bc61977 100644
--- a/modules/gdnative/godot/godot_array.h
+++ b/modules/gdnative/godot/godot_array.h
@@ -48,67 +48,69 @@ typedef struct godot_array {
#include "../godot.h"
-void GDAPI godot_array_new(godot_array *p_arr);
-void GDAPI godot_array_new_copy(godot_array *p_dest, const godot_array *p_src);
-void GDAPI godot_array_new_pool_color_array(godot_array *p_arr, const godot_pool_color_array *p_pca);
-void GDAPI godot_array_new_pool_vector3_array(godot_array *p_arr, const godot_pool_vector3_array *p_pv3a);
-void GDAPI godot_array_new_pool_vector2_array(godot_array *p_arr, const godot_pool_vector2_array *p_pv2a);
-void GDAPI godot_array_new_pool_string_array(godot_array *p_arr, const godot_pool_string_array *p_psa);
-void GDAPI godot_array_new_pool_real_array(godot_array *p_arr, const godot_pool_real_array *p_pra);
-void GDAPI godot_array_new_pool_int_array(godot_array *p_arr, const godot_pool_int_array *p_pia);
-void GDAPI godot_array_new_pool_byte_array(godot_array *p_arr, const godot_pool_byte_array *p_pba);
+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_arr, const godot_int p_idx, const godot_variant *p_value);
+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_arr, const godot_int p_idx);
+godot_variant GDAPI godot_array_get(const godot_array *p_self, const godot_int p_idx);
-void GDAPI godot_array_append(godot_array *p_arr, const godot_variant *p_value);
+godot_variant GDAPI *godot_array_operator_index(godot_array *p_self, const godot_int p_idx);
-void GDAPI godot_array_clear(godot_array *p_arr);
+void GDAPI godot_array_append(godot_array *p_self, const godot_variant *p_value);
-godot_int GDAPI godot_array_count(const godot_array *p_arr, const godot_variant *p_value);
+void GDAPI godot_array_clear(godot_array *p_self);
-godot_bool GDAPI godot_array_empty(const godot_array *p_arr);
+godot_int GDAPI godot_array_count(const godot_array *p_self, const godot_variant *p_value);
-void GDAPI godot_array_erase(godot_array *p_arr, const godot_variant *p_value);
+godot_bool GDAPI godot_array_empty(const godot_array *p_self);
-godot_variant GDAPI godot_array_front(const godot_array *p_arr);
+void GDAPI godot_array_erase(godot_array *p_self, const godot_variant *p_value);
-godot_variant GDAPI godot_array_back(const godot_array *p_arr);
+godot_variant GDAPI godot_array_front(const godot_array *p_self);
-godot_int GDAPI godot_array_find(const godot_array *p_arr, const godot_variant *p_what, const godot_int p_from);
+godot_variant GDAPI godot_array_back(const godot_array *p_self);
-godot_int GDAPI godot_array_find_last(const godot_array *p_arr, const godot_variant *p_what);
+godot_int GDAPI godot_array_find(const godot_array *p_self, const godot_variant *p_what, const godot_int p_from);
-godot_bool GDAPI godot_array_has(const godot_array *p_arr, const godot_variant *p_value);
+godot_int GDAPI godot_array_find_last(const godot_array *p_self, const godot_variant *p_what);
-uint32_t GDAPI godot_array_hash(const godot_array *p_arr);
+godot_bool GDAPI godot_array_has(const godot_array *p_self, const godot_variant *p_value);
-void GDAPI godot_array_insert(godot_array *p_arr, const godot_int p_pos, const godot_variant *p_value);
+godot_int GDAPI godot_array_hash(const godot_array *p_self);
-void GDAPI godot_array_invert(godot_array *p_arr);
+void GDAPI godot_array_insert(godot_array *p_self, const godot_int p_pos, const godot_variant *p_value);
-godot_variant GDAPI godot_array_pop_back(godot_array *p_arr);
+void GDAPI godot_array_invert(godot_array *p_self);
-godot_variant GDAPI godot_array_pop_front(godot_array *p_arr);
+godot_variant GDAPI godot_array_pop_back(godot_array *p_self);
-void GDAPI godot_array_push_back(godot_array *p_arr, const godot_variant *p_value);
+godot_variant GDAPI godot_array_pop_front(godot_array *p_self);
-void GDAPI godot_array_push_front(godot_array *p_arr, const godot_variant *p_value);
+void GDAPI godot_array_push_back(godot_array *p_self, const godot_variant *p_value);
-void GDAPI godot_array_remove(godot_array *p_arr, const godot_int p_idx);
+void GDAPI godot_array_push_front(godot_array *p_self, const godot_variant *p_value);
-void GDAPI godot_array_resize(godot_array *p_arr, const godot_int p_size);
+void GDAPI godot_array_remove(godot_array *p_self, const godot_int p_idx);
-godot_int GDAPI godot_array_rfind(const godot_array *p_arr, const godot_variant *p_what, const godot_int p_from);
+void GDAPI godot_array_resize(godot_array *p_self, const godot_int p_size);
-godot_int GDAPI godot_array_size(const godot_array *p_arr);
+godot_int GDAPI godot_array_rfind(const godot_array *p_self, const godot_variant *p_what, const godot_int p_from);
-void GDAPI godot_array_sort(godot_array *p_arr);
+godot_int GDAPI godot_array_size(const godot_array *p_self);
-void GDAPI godot_array_sort_custom(godot_array *p_arr, godot_object *p_obj, const godot_string *p_func);
+void GDAPI godot_array_sort(godot_array *p_self);
-void GDAPI godot_array_destroy(godot_array *p_arr);
+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
}
diff --git a/modules/gdnative/godot/godot_color.cpp b/modules/gdnative/godot/godot_color.cpp
index 0417a828ab..6dedf2ab10 100644
--- a/modules/gdnative/godot/godot_color.cpp
+++ b/modules/gdnative/godot/godot_color.cpp
@@ -50,6 +50,61 @@ void GDAPI godot_color_new_rgb(godot_color *r_dest, const godot_real p_r, const
*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;
@@ -106,7 +161,7 @@ godot_string GDAPI godot_color_to_html(const godot_color *p_self, const godot_bo
godot_string dest;
const Color *self = (const Color *)p_self;
- *((String *)&dest) = self->to_html(p_with_alpha);
+ memnew_placement(&dest, String(self->to_html(p_with_alpha)));
return dest;
}
diff --git a/modules/gdnative/godot/godot_color.h b/modules/gdnative/godot/godot_color.h
index 8588c997ea..10dc228b1c 100644
--- a/modules/gdnative/godot/godot_color.h
+++ b/modules/gdnative/godot/godot_color.h
@@ -49,6 +49,22 @@ typedef struct godot_color {
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);
diff --git a/modules/gdnative/godot/godot_dictionary.cpp b/modules/gdnative/godot/godot_dictionary.cpp
index deec5f8ffb..12c40f0564 100644
--- a/modules/gdnative/godot/godot_dictionary.cpp
+++ b/modules/gdnative/godot/godot_dictionary.cpp
@@ -44,9 +44,9 @@ void GDAPI godot_dictionary_new(godot_dictionary *r_dest) {
memnew_placement(dest, Dictionary);
}
-void GDAPI godot_dictionary_new_copy(godot_dictionary *r_dest, const godot_dictionary *r_src) {
+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 *)r_src;
+ const Dictionary *src = (const Dictionary *)p_src;
memnew_placement(dest, Dictionary(*src));
}
@@ -107,10 +107,26 @@ godot_array GDAPI godot_dictionary_values(const godot_dictionary *p_self) {
return dest;
}
-godot_variant GDAPI *godot_dictionary_operator_index(godot_dictionary *p_dict, const godot_variant *p_key) {
- Dictionary *dict = (Dictionary *)p_dict;
+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;
- return (godot_variant *)&dict->operator[](*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) {
+ Array *self = (Array *)p_self;
+ const Variant *key = (const Variant *)p_key;
+ return (godot_variant *)&self->operator[](*key);
}
godot_bool GDAPI godot_dictionary_operator_equal(const godot_dictionary *p_self, const godot_dictionary *p_b) {
@@ -119,11 +135,11 @@ godot_bool GDAPI godot_dictionary_operator_equal(const godot_dictionary *p_self,
return *self == *b;
}
-godot_string GDAPI godot_dictionary_to_json(const godot_dictionary *p_dict) {
+godot_string GDAPI godot_dictionary_to_json(const godot_dictionary *p_self) {
godot_string raw_dest;
String *dest = (String *)&raw_dest;
- const Dictionary *dict = (const Dictionary *)p_dict;
- memnew_placement(dest, String(JSON::print(Variant(*dict))));
+ const Dictionary *self = (const Dictionary *)p_self;
+ memnew_placement(dest, String(JSON::print(Variant(*self))));
return raw_dest;
}
diff --git a/modules/gdnative/godot/godot_dictionary.h b/modules/gdnative/godot/godot_dictionary.h
index a89bd4bba1..0325670b15 100644
--- a/modules/gdnative/godot/godot_dictionary.h
+++ b/modules/gdnative/godot/godot_dictionary.h
@@ -48,7 +48,7 @@ typedef struct godot_dictionary {
#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 *r_src);
+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);
@@ -69,11 +69,14 @@ 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_operator_index(godot_dictionary *p_dict, const godot_variant *p_key);
+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_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_dict);
+godot_string GDAPI godot_dictionary_to_json(const godot_dictionary *p_self);
#ifdef __cplusplus
}
diff --git a/modules/gdnative/godot/godot_node_path.cpp b/modules/gdnative/godot/godot_node_path.cpp
index 165688a340..c8eacd05af 100644
--- a/modules/gdnative/godot/godot_node_path.cpp
+++ b/modules/gdnative/godot/godot_node_path.cpp
@@ -44,6 +44,12 @@ void GDAPI godot_node_path_new(godot_node_path *r_dest, const godot_string *p_fr
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();
diff --git a/modules/gdnative/godot/godot_node_path.h b/modules/gdnative/godot/godot_node_path.h
index fb94bd3822..b0c9d44859 100644
--- a/modules/gdnative/godot/godot_node_path.h
+++ b/modules/gdnative/godot/godot_node_path.h
@@ -47,6 +47,7 @@ typedef struct godot_node_path {
#include "godot_string.h"
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);
godot_string GDAPI godot_node_path_as_string(const godot_node_path *p_self);
diff --git a/modules/gdnative/godot/godot_pool_arrays.cpp b/modules/gdnative/godot/godot_pool_arrays.cpp
index ff4586ebe7..ea9aceea81 100644
--- a/modules/gdnative/godot/godot_pool_arrays.cpp
+++ b/modules/gdnative/godot/godot_pool_arrays.cpp
@@ -44,584 +44,584 @@ void _pool_arrays_api_anchor() {
// byte
-void GDAPI godot_pool_byte_array_new(godot_pool_byte_array *p_pba) {
- PoolVector<uint8_t> *pba = (PoolVector<uint8_t> *)p_pba;
- memnew_placement(pba, PoolVector<uint8_t>);
+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 *p_dest, const godot_pool_byte_array *p_src) {
- PoolVector<uint8_t> *dest = (PoolVector<uint8_t> *)p_dest;
+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 *p_pba, const godot_array *p_a) {
- PoolVector<uint8_t> *pba = (PoolVector<uint8_t> *)p_pba;
+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(pba, PoolVector<uint8_t>);
+ memnew_placement(dest, PoolVector<uint8_t>);
- pba->resize(a->size());
+ dest->resize(a->size());
for (size_t i = 0; i < a->size(); i++) {
- pba->set(i, (*a)[i]);
+ dest->set(i, (*a)[i]);
}
}
-void GDAPI godot_pool_byte_array_append(godot_pool_byte_array *p_pba, const uint8_t p_data) {
- PoolVector<uint8_t> *pba = (PoolVector<uint8_t> *)p_pba;
- pba->append(p_data);
+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_pba, const godot_pool_byte_array *p_array) {
- PoolVector<uint8_t> *pba = (PoolVector<uint8_t> *)p_pba;
+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;
- pba->append_array(*array);
+ self->append_array(*array);
}
-int GDAPI godot_pool_byte_array_insert(godot_pool_byte_array *p_pba, const godot_int p_idx, const uint8_t p_data) {
- PoolVector<uint8_t> *pba = (PoolVector<uint8_t> *)p_pba;
- return pba->insert(p_idx, p_data);
+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_pba) {
- PoolVector<uint8_t> *pba = (PoolVector<uint8_t> *)p_pba;
- pba->invert();
+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_pba, const uint8_t p_data) {
- PoolVector<uint8_t> *pba = (PoolVector<uint8_t> *)p_pba;
- pba->push_back(p_data);
+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_pba, const godot_int p_idx) {
- PoolVector<uint8_t> *pba = (PoolVector<uint8_t> *)p_pba;
- pba->remove(p_idx);
+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_pba, const godot_int p_size) {
- PoolVector<uint8_t> *pba = (PoolVector<uint8_t> *)p_pba;
- pba->resize(p_size);
+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_pba, const godot_int p_idx, const uint8_t p_data) {
- PoolVector<uint8_t> *pba = (PoolVector<uint8_t> *)p_pba;
- pba->set(p_idx, p_data);
+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_pba, const godot_int p_idx) {
- const PoolVector<uint8_t> *pba = (const PoolVector<uint8_t> *)p_pba;
- return pba->get(p_idx);
+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_pba) {
- const PoolVector<uint8_t> *pba = (const PoolVector<uint8_t> *)p_pba;
- return pba->size();
+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_pba) {
- ((PoolVector<uint8_t> *)p_pba)->~PoolVector();
+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 *p_pba) {
- PoolVector<godot_int> *pba = (PoolVector<godot_int> *)p_pba;
- memnew_placement(pba, PoolVector<godot_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 *p_dest, const godot_pool_int_array *p_src) {
- PoolVector<godot_int> *dest = (PoolVector<godot_int> *)p_dest;
+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 *p_pba, const godot_array *p_a) {
- PoolVector<godot_int> *pba = (PoolVector<godot_int> *)p_pba;
+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(pba, PoolVector<godot_int>);
+ memnew_placement(dest, PoolVector<godot_int>);
- pba->resize(a->size());
+ dest->resize(a->size());
for (size_t i = 0; i < a->size(); i++) {
- pba->set(i, (*a)[i]);
+ dest->set(i, (*a)[i]);
}
}
-void GDAPI godot_pool_int_array_append(godot_pool_int_array *p_pba, const godot_int p_data) {
- PoolVector<godot_int> *pba = (PoolVector<godot_int> *)p_pba;
- pba->append(p_data);
+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_pba, const godot_pool_int_array *p_array) {
- PoolVector<godot_int> *pba = (PoolVector<godot_int> *)p_pba;
+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;
- pba->append_array(*array);
+ self->append_array(*array);
}
-int GDAPI godot_pool_int_array_insert(godot_pool_int_array *p_pba, const godot_int p_idx, const godot_int p_data) {
- PoolVector<godot_int> *pba = (PoolVector<godot_int> *)p_pba;
- return pba->insert(p_idx, p_data);
+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_pba) {
- PoolVector<godot_int> *pba = (PoolVector<godot_int> *)p_pba;
- pba->invert();
+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_pba, const godot_int p_data) {
- PoolVector<godot_int> *pba = (PoolVector<godot_int> *)p_pba;
- pba->push_back(p_data);
+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_pba, const godot_int p_idx) {
- PoolVector<godot_int> *pba = (PoolVector<godot_int> *)p_pba;
- pba->remove(p_idx);
+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_pba, const godot_int p_size) {
- PoolVector<godot_int> *pba = (PoolVector<godot_int> *)p_pba;
- pba->resize(p_size);
+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_pba, const godot_int p_idx, const godot_int p_data) {
- PoolVector<godot_int> *pba = (PoolVector<godot_int> *)p_pba;
- pba->set(p_idx, p_data);
+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_pba, const godot_int p_idx) {
- const PoolVector<godot_int> *pba = (const PoolVector<godot_int> *)p_pba;
- return pba->get(p_idx);
+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_pba) {
- const PoolVector<godot_int> *pba = (const PoolVector<godot_int> *)p_pba;
- return pba->size();
+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_pba) {
- ((PoolVector<godot_int> *)p_pba)->~PoolVector();
+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 *p_pba) {
- PoolVector<godot_real> *pba = (PoolVector<godot_real> *)p_pba;
- memnew_placement(pba, PoolVector<godot_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 *p_dest, const godot_pool_real_array *p_src) {
- PoolVector<godot_real> *dest = (PoolVector<godot_real> *)p_dest;
+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 *p_pba, const godot_array *p_a) {
- PoolVector<godot_real> *pba = (PoolVector<godot_real> *)p_pba;
+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(pba, PoolVector<godot_real>);
+ memnew_placement(dest, PoolVector<godot_real>);
- pba->resize(a->size());
+ dest->resize(a->size());
for (size_t i = 0; i < a->size(); i++) {
- pba->set(i, (*a)[i]);
+ dest->set(i, (*a)[i]);
}
}
-void GDAPI godot_pool_real_array_append(godot_pool_real_array *p_pba, const godot_real p_data) {
- PoolVector<godot_real> *pba = (PoolVector<godot_real> *)p_pba;
- pba->append(p_data);
+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_pba, const godot_pool_real_array *p_array) {
- PoolVector<godot_real> *pba = (PoolVector<godot_real> *)p_pba;
+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;
- pba->append_array(*array);
+ self->append_array(*array);
}
-int GDAPI godot_pool_real_array_insert(godot_pool_real_array *p_pba, const godot_int p_idx, const godot_real p_data) {
- PoolVector<godot_real> *pba = (PoolVector<godot_real> *)p_pba;
- return pba->insert(p_idx, p_data);
+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_pba) {
- PoolVector<godot_real> *pba = (PoolVector<godot_real> *)p_pba;
- pba->invert();
+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_pba, const godot_real p_data) {
- PoolVector<godot_real> *pba = (PoolVector<godot_real> *)p_pba;
- pba->push_back(p_data);
+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_pba, const godot_int p_idx) {
- PoolVector<godot_real> *pba = (PoolVector<godot_real> *)p_pba;
- pba->remove(p_idx);
+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_pba, const godot_int p_size) {
- PoolVector<godot_int> *pba = (PoolVector<godot_int> *)p_pba;
- pba->resize(p_size);
+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_pba, const godot_int p_idx, const godot_real p_data) {
- PoolVector<godot_real> *pba = (PoolVector<godot_real> *)p_pba;
- pba->set(p_idx, p_data);
+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_pba, const godot_int p_idx) {
- const PoolVector<godot_real> *pba = (const PoolVector<godot_real> *)p_pba;
- return pba->get(p_idx);
+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_pba) {
- const PoolVector<godot_real> *pba = (const PoolVector<godot_real> *)p_pba;
- return pba->size();
+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_pba) {
- ((PoolVector<godot_real> *)p_pba)->~PoolVector();
+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 *p_pba) {
- PoolVector<String> *pba = (PoolVector<String> *)p_pba;
- memnew_placement(pba, 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 *p_dest, const godot_pool_string_array *p_src) {
- PoolVector<String> *dest = (PoolVector<String> *)p_dest;
+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 *p_pba, const godot_array *p_a) {
- PoolVector<String> *pba = (PoolVector<String> *)p_pba;
+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(pba, PoolVector<String>);
+ memnew_placement(dest, PoolVector<String>);
- pba->resize(a->size());
+ dest->resize(a->size());
for (size_t i = 0; i < a->size(); i++) {
- pba->set(i, (*a)[i]);
+ dest->set(i, (*a)[i]);
}
}
-void GDAPI godot_pool_string_array_append(godot_pool_string_array *p_pba, const godot_string *p_data) {
- PoolVector<String> *pba = (PoolVector<String> *)p_pba;
+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;
- pba->append(s);
+ self->append(s);
}
-void GDAPI godot_pool_string_array_append_array(godot_pool_string_array *p_pba, const godot_pool_string_array *p_array) {
- PoolVector<String> *pba = (PoolVector<String> *)p_pba;
+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;
- pba->append_array(*array);
+ self->append_array(*array);
}
-int GDAPI godot_pool_string_array_insert(godot_pool_string_array *p_pba, const godot_int p_idx, const godot_string *p_data) {
- PoolVector<String> *pba = (PoolVector<String> *)p_pba;
+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 pba->insert(p_idx, s);
+ return (godot_error)self->insert(p_idx, s);
}
-void GDAPI godot_pool_string_array_invert(godot_pool_string_array *p_pba) {
- PoolVector<String> *pba = (PoolVector<String> *)p_pba;
- pba->invert();
+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_pba, const godot_string *p_data) {
- PoolVector<String> *pba = (PoolVector<String> *)p_pba;
+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;
- pba->push_back(s);
+ self->push_back(s);
}
-void GDAPI godot_pool_string_array_remove(godot_pool_string_array *p_pba, const godot_int p_idx) {
- PoolVector<String> *pba = (PoolVector<String> *)p_pba;
- pba->remove(p_idx);
+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_pba, const godot_int p_size) {
- PoolVector<String> *pba = (PoolVector<String> *)p_pba;
- pba->resize(p_size);
+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_pba, const godot_int p_idx, const godot_string *p_data) {
- PoolVector<String> *pba = (PoolVector<String> *)p_pba;
+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;
- pba->set(p_idx, s);
+ self->set(p_idx, s);
}
-godot_string GDAPI godot_pool_string_array_get(const godot_pool_string_array *p_pba, const godot_int p_idx) {
- const PoolVector<String> *pba = (const PoolVector<String> *)p_pba;
+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 = pba->get(p_idx);
+ *s = self->get(p_idx);
return str;
}
-godot_int GDAPI godot_pool_string_array_size(const godot_pool_string_array *p_pba) {
- const PoolVector<String> *pba = (const PoolVector<String> *)p_pba;
- return pba->size();
+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_pba) {
- ((PoolVector<String> *)p_pba)->~PoolVector();
+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 *p_pba) {
- PoolVector<Vector2> *pba = (PoolVector<Vector2> *)p_pba;
- memnew_placement(pba, 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 *p_dest, const godot_pool_vector2_array *p_src) {
- PoolVector<Vector2> *dest = (PoolVector<Vector2> *)p_dest;
+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 *p_pba, const godot_array *p_a) {
- PoolVector<Vector2> *pba = (PoolVector<Vector2> *)p_pba;
+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(pba, PoolVector<Vector2>);
+ memnew_placement(dest, PoolVector<Vector2>);
- pba->resize(a->size());
+ dest->resize(a->size());
for (size_t i = 0; i < a->size(); i++) {
- pba->set(i, (*a)[i]);
+ dest->set(i, (*a)[i]);
}
}
-void GDAPI godot_pool_vector2_array_append(godot_pool_vector2_array *p_pba, const godot_vector2 *p_data) {
- PoolVector<Vector2> *pba = (PoolVector<Vector2> *)p_pba;
+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;
- pba->append(s);
+ self->append(s);
}
-void GDAPI godot_pool_vector2_array_append_array(godot_pool_vector2_array *p_pba, const godot_pool_vector2_array *p_array) {
- PoolVector<Vector2> *pba = (PoolVector<Vector2> *)p_pba;
+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;
- pba->append_array(*array);
+ self->append_array(*array);
}
-int GDAPI godot_pool_vector2_array_insert(godot_pool_vector2_array *p_pba, const godot_int p_idx, const godot_vector2 *p_data) {
- PoolVector<Vector2> *pba = (PoolVector<Vector2> *)p_pba;
+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 pba->insert(p_idx, s);
+ return (godot_error)self->insert(p_idx, s);
}
-void GDAPI godot_pool_vector2_array_invert(godot_pool_vector2_array *p_pba) {
- PoolVector<Vector2> *pba = (PoolVector<Vector2> *)p_pba;
- pba->invert();
+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_pba, const godot_vector2 *p_data) {
- PoolVector<Vector2> *pba = (PoolVector<Vector2> *)p_pba;
+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;
- pba->push_back(s);
+ self->push_back(s);
}
-void GDAPI godot_pool_vector2_array_remove(godot_pool_vector2_array *p_pba, const godot_int p_idx) {
- PoolVector<Vector2> *pba = (PoolVector<Vector2> *)p_pba;
- pba->remove(p_idx);
+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_pba, const godot_int p_size) {
- PoolVector<Vector2> *pba = (PoolVector<Vector2> *)p_pba;
- pba->resize(p_size);
+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_pba, const godot_int p_idx, const godot_vector2 *p_data) {
- PoolVector<Vector2> *pba = (PoolVector<Vector2> *)p_pba;
+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;
- pba->set(p_idx, s);
+ self->set(p_idx, s);
}
-godot_vector2 GDAPI godot_pool_vector2_array_get(const godot_pool_vector2_array *p_pba, const godot_int p_idx) {
- const PoolVector<Vector2> *pba = (const PoolVector<Vector2> *)p_pba;
+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 = pba->get(p_idx);
+ *s = self->get(p_idx);
return v;
}
-godot_int GDAPI godot_pool_vector2_array_size(const godot_pool_vector2_array *p_pba) {
- const PoolVector<Vector2> *pba = (const PoolVector<Vector2> *)p_pba;
- return pba->size();
+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_pba) {
- ((PoolVector<Vector2> *)p_pba)->~PoolVector();
+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 *p_pba) {
- PoolVector<Vector3> *pba = (PoolVector<Vector3> *)p_pba;
- memnew_placement(pba, 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 *p_dest, const godot_pool_vector3_array *p_src) {
- PoolVector<Vector3> *dest = (PoolVector<Vector3> *)p_dest;
+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 *p_pba, const godot_array *p_a) {
- PoolVector<Vector3> *pba = (PoolVector<Vector3> *)p_pba;
+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(pba, PoolVector<Vector3>);
+ memnew_placement(dest, PoolVector<Vector3>);
- pba->resize(a->size());
+ dest->resize(a->size());
for (size_t i = 0; i < a->size(); i++) {
- pba->set(i, (*a)[i]);
+ dest->set(i, (*a)[i]);
}
}
-void GDAPI godot_pool_vector3_array_append(godot_pool_vector3_array *p_pba, const godot_vector3 *p_data) {
- PoolVector<Vector3> *pba = (PoolVector<Vector3> *)p_pba;
+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;
- pba->append(s);
+ self->append(s);
}
-void GDAPI godot_pool_vector3_array_append_array(godot_pool_vector3_array *p_pba, const godot_pool_vector3_array *p_array) {
- PoolVector<Vector3> *pba = (PoolVector<Vector3> *)p_pba;
+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;
- pba->append_array(*array);
+ self->append_array(*array);
}
-int GDAPI godot_pool_vector3_array_insert(godot_pool_vector3_array *p_pba, const godot_int p_idx, const godot_vector3 *p_data) {
- PoolVector<Vector3> *pba = (PoolVector<Vector3> *)p_pba;
+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 pba->insert(p_idx, s);
+ return (godot_error)self->insert(p_idx, s);
}
-void GDAPI godot_pool_vector3_array_invert(godot_pool_vector3_array *p_pba) {
- PoolVector<Vector3> *pba = (PoolVector<Vector3> *)p_pba;
- pba->invert();
+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_pba, const godot_vector3 *p_data) {
- PoolVector<Vector3> *pba = (PoolVector<Vector3> *)p_pba;
+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;
- pba->push_back(s);
+ self->push_back(s);
}
-void GDAPI godot_pool_vector3_array_remove(godot_pool_vector3_array *p_pba, const godot_int p_idx) {
- PoolVector<Vector3> *pba = (PoolVector<Vector3> *)p_pba;
- pba->remove(p_idx);
+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_pba, const godot_int p_size) {
- PoolVector<Vector3> *pba = (PoolVector<Vector3> *)p_pba;
- pba->resize(p_size);
+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_pba, const godot_int p_idx, const godot_vector3 *p_data) {
- PoolVector<Vector3> *pba = (PoolVector<Vector3> *)p_pba;
+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;
- pba->set(p_idx, s);
+ self->set(p_idx, s);
}
-godot_vector3 GDAPI godot_pool_vector3_array_get(const godot_pool_vector3_array *p_pba, const godot_int p_idx) {
- const PoolVector<Vector3> *pba = (const PoolVector<Vector3> *)p_pba;
+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 = pba->get(p_idx);
+ *s = self->get(p_idx);
return v;
}
-godot_int GDAPI godot_pool_vector3_array_size(const godot_pool_vector3_array *p_pba) {
- const PoolVector<Vector3> *pba = (const PoolVector<Vector3> *)p_pba;
- return pba->size();
+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_pba) {
- ((PoolVector<Vector3> *)p_pba)->~PoolVector();
+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 *p_pba) {
- PoolVector<Color> *pba = (PoolVector<Color> *)p_pba;
- memnew_placement(pba, 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 *p_dest, const godot_pool_color_array *p_src) {
- PoolVector<Color> *dest = (PoolVector<Color> *)p_dest;
+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 *p_pba, const godot_array *p_a) {
- PoolVector<Color> *pba = (PoolVector<Color> *)p_pba;
+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(pba, PoolVector<Color>);
+ memnew_placement(dest, PoolVector<Color>);
- pba->resize(a->size());
+ dest->resize(a->size());
for (size_t i = 0; i < a->size(); i++) {
- pba->set(i, (*a)[i]);
+ dest->set(i, (*a)[i]);
}
}
-void GDAPI godot_pool_color_array_append(godot_pool_color_array *p_pba, const godot_color *p_data) {
- PoolVector<Color> *pba = (PoolVector<Color> *)p_pba;
+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;
- pba->append(s);
+ self->append(s);
}
-void GDAPI godot_pool_color_array_append_array(godot_pool_color_array *p_pba, const godot_pool_color_array *p_array) {
- PoolVector<Color> *pba = (PoolVector<Color> *)p_pba;
+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;
- pba->append_array(*array);
+ self->append_array(*array);
}
-int GDAPI godot_pool_color_array_insert(godot_pool_color_array *p_pba, const godot_int p_idx, const godot_color *p_data) {
- PoolVector<Color> *pba = (PoolVector<Color> *)p_pba;
+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 pba->insert(p_idx, s);
+ return (godot_error)self->insert(p_idx, s);
}
-void GDAPI godot_pool_color_array_invert(godot_pool_color_array *p_pba) {
- PoolVector<Color> *pba = (PoolVector<Color> *)p_pba;
- pba->invert();
+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_pba, const godot_color *p_data) {
- PoolVector<Color> *pba = (PoolVector<Color> *)p_pba;
+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;
- pba->push_back(s);
+ self->push_back(s);
}
-void GDAPI godot_pool_color_array_remove(godot_pool_color_array *p_pba, const godot_int p_idx) {
- PoolVector<Color> *pba = (PoolVector<Color> *)p_pba;
- pba->remove(p_idx);
+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_pba, const godot_int p_size) {
- PoolVector<Color> *pba = (PoolVector<Color> *)p_pba;
- pba->resize(p_size);
+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_pba, const godot_int p_idx, const godot_color *p_data) {
- PoolVector<Color> *pba = (PoolVector<Color> *)p_pba;
+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;
- pba->set(p_idx, s);
+ self->set(p_idx, s);
}
-godot_color GDAPI godot_pool_color_array_get(const godot_pool_color_array *p_pba, const godot_int p_idx) {
- const PoolVector<Color> *pba = (const PoolVector<Color> *)p_pba;
+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 = pba->get(p_idx);
+ *s = self->get(p_idx);
return v;
}
-godot_int GDAPI godot_pool_color_array_size(const godot_pool_color_array *p_pba) {
- const PoolVector<Color> *pba = (const PoolVector<Color> *)p_pba;
- return pba->size();
+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_pba) {
- ((PoolVector<Color> *)p_pba)->~PoolVector();
+void GDAPI godot_pool_color_array_destroy(godot_pool_color_array *p_self) {
+ ((PoolVector<Color> *)p_self)->~PoolVector();
}
#ifdef __cplusplus
diff --git a/modules/gdnative/godot/godot_pool_arrays.h b/modules/gdnative/godot/godot_pool_arrays.h
index 8b0d0137fd..a794d03f01 100644
--- a/modules/gdnative/godot/godot_pool_arrays.h
+++ b/modules/gdnative/godot/godot_pool_arrays.h
@@ -101,192 +101,192 @@ typedef struct godot_pool_color_array {
// byte
-void GDAPI godot_pool_byte_array_new(godot_pool_byte_array *p_pba);
-void GDAPI godot_pool_byte_array_new_copy(godot_pool_byte_array *p_dest, const godot_pool_byte_array *p_src);
-void GDAPI godot_pool_byte_array_new_with_array(godot_pool_byte_array *p_pba, const godot_array *p_a);
+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_pba, const uint8_t p_data);
+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_pba, const godot_pool_byte_array *p_array);
+void GDAPI godot_pool_byte_array_append_array(godot_pool_byte_array *p_self, const godot_pool_byte_array *p_array);
-int GDAPI godot_pool_byte_array_insert(godot_pool_byte_array *p_pba, const godot_int p_idx, const uint8_t p_data);
+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_pba);
+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_pba, const uint8_t p_data);
+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_pba, const godot_int p_idx);
+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_pba, const godot_int p_size);
+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_pba, const godot_int p_idx, const uint8_t p_data);
-uint8_t GDAPI godot_pool_byte_array_get(const godot_pool_byte_array *p_pba, const godot_int p_idx);
+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_pba);
+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_pba);
+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 *p_pia);
-void GDAPI godot_pool_int_array_new_copy(godot_pool_int_array *p_dest, const godot_pool_int_array *p_src);
-void GDAPI godot_pool_int_array_new_with_array(godot_pool_int_array *p_pia, const godot_array *p_a);
+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_pia, const godot_int p_data);
+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_pia, const godot_pool_int_array *p_array);
+void GDAPI godot_pool_int_array_append_array(godot_pool_int_array *p_self, const godot_pool_int_array *p_array);
-int GDAPI godot_pool_int_array_insert(godot_pool_int_array *p_pia, const godot_int p_idx, const godot_int p_data);
+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_pia);
+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_pia, const godot_int p_data);
+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_pia, const godot_int p_idx);
+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_pia, const godot_int p_size);
+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_pia, const godot_int p_idx, const godot_int p_data);
-godot_int GDAPI godot_pool_int_array_get(const godot_pool_int_array *p_pia, const godot_int p_idx);
+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_pia);
+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_pia);
+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 *p_pra);
-void GDAPI godot_pool_real_array_new_copy(godot_pool_real_array *p_dest, const godot_pool_real_array *p_src);
-void GDAPI godot_pool_real_array_new_with_array(godot_pool_real_array *p_pra, const godot_array *p_a);
+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_pra, const godot_real p_data);
+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_pra, const godot_pool_real_array *p_array);
+void GDAPI godot_pool_real_array_append_array(godot_pool_real_array *p_self, const godot_pool_real_array *p_array);
-int GDAPI godot_pool_real_array_insert(godot_pool_real_array *p_pra, const godot_int p_idx, const godot_real p_data);
+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_pra);
+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_pra, const godot_real p_data);
+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_pra, const godot_int p_idx);
+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_pra, const godot_int p_size);
+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_pra, const godot_int p_idx, const godot_real p_data);
-godot_real GDAPI godot_pool_real_array_get(const godot_pool_real_array *p_pra, const godot_int p_idx);
+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_pra);
+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_pra);
+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 *p_psa);
-void GDAPI godot_pool_string_array_new_copy(godot_pool_string_array *p_dest, const godot_pool_string_array *p_src);
-void GDAPI godot_pool_string_array_new_with_array(godot_pool_string_array *p_psa, const godot_array *p_a);
+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_psa, const godot_string *p_data);
+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_psa, const godot_pool_string_array *p_array);
+void GDAPI godot_pool_string_array_append_array(godot_pool_string_array *p_self, const godot_pool_string_array *p_array);
-int GDAPI godot_pool_string_array_insert(godot_pool_string_array *p_psa, const godot_int p_idx, const godot_string *p_data);
+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_psa);
+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_psa, const godot_string *p_data);
+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_psa, const godot_int p_idx);
+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_psa, const godot_int p_size);
+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_psa, const godot_int p_idx, const godot_string *p_data);
-godot_string GDAPI godot_pool_string_array_get(const godot_pool_string_array *p_psa, const godot_int p_idx);
+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_psa);
+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_psa);
+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 *p_pv2a);
-void GDAPI godot_pool_vector2_array_new_copy(godot_pool_vector2_array *p_dest, const godot_pool_vector2_array *p_src);
-void GDAPI godot_pool_vector2_array_new_with_array(godot_pool_vector2_array *p_pv2a, const godot_array *p_a);
+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_pv2a, const godot_vector2 *p_data);
+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_pv2a, const godot_pool_vector2_array *p_array);
+void GDAPI godot_pool_vector2_array_append_array(godot_pool_vector2_array *p_self, const godot_pool_vector2_array *p_array);
-int GDAPI godot_pool_vector2_array_insert(godot_pool_vector2_array *p_pv2a, const godot_int p_idx, const godot_vector2 *p_data);
+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_pv2a);
+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_pv2a, const godot_vector2 *p_data);
+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_pv2a, const godot_int p_idx);
+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_pv2a, const godot_int p_size);
+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_pv2a, const godot_int p_idx, const godot_vector2 *p_data);
-godot_vector2 GDAPI godot_pool_vector2_array_get(const godot_pool_vector2_array *p_pv2a, const godot_int p_idx);
+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_pv2a);
+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_pv2a);
+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 *p_pv3a);
-void GDAPI godot_pool_vector3_array_new_copy(godot_pool_vector3_array *p_dest, const godot_pool_vector3_array *p_src);
-void GDAPI godot_pool_vector3_array_new_with_array(godot_pool_vector3_array *p_pv3a, const godot_array *p_a);
+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_pv3a, const godot_vector3 *p_data);
+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_pv3a, const godot_pool_vector3_array *p_array);
+void GDAPI godot_pool_vector3_array_append_array(godot_pool_vector3_array *p_self, const godot_pool_vector3_array *p_array);
-int GDAPI godot_pool_vector3_array_insert(godot_pool_vector3_array *p_pv3a, const godot_int p_idx, const godot_vector3 *p_data);
+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_pv3a);
+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_pv3a, const godot_vector3 *p_data);
+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_pv3a, const godot_int p_idx);
+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_pv3a, const godot_int p_size);
+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_pv3a, const godot_int p_idx, const godot_vector3 *p_data);
-godot_vector3 GDAPI godot_pool_vector3_array_get(const godot_pool_vector3_array *p_pv3a, const godot_int p_idx);
+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_pv3a);
+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_pv3a);
+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 *p_pca);
-void GDAPI godot_pool_color_array_new_copy(godot_pool_color_array *p_dest, const godot_pool_color_array *p_src);
-void GDAPI godot_pool_color_array_new_with_array(godot_pool_color_array *p_pca, const godot_array *p_a);
+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_pca, const godot_color *p_data);
+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_pca, const godot_pool_color_array *p_array);
+void GDAPI godot_pool_color_array_append_array(godot_pool_color_array *p_self, const godot_pool_color_array *p_array);
-int GDAPI godot_pool_color_array_insert(godot_pool_color_array *p_pca, const godot_int p_idx, const godot_color *p_data);
+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_pca);
+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_pca, const godot_color *p_data);
+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_pca, const godot_int p_idx);
+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_pca, const godot_int p_size);
+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_pca, const godot_int p_idx, const godot_color *p_data);
-godot_color GDAPI godot_pool_color_array_get(const godot_pool_color_array *p_pca, const godot_int p_idx);
+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_pca);
+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_pca);
+void GDAPI godot_pool_color_array_destroy(godot_pool_color_array *p_self);
#ifdef __cplusplus
}
diff --git a/modules/gdnative/godot/godot_quat.cpp b/modules/gdnative/godot/godot_quat.cpp
index 4d38c4987c..7235e4fcec 100644
--- a/modules/gdnative/godot/godot_quat.cpp
+++ b/modules/gdnative/godot/godot_quat.cpp
@@ -50,6 +50,46 @@ void GDAPI godot_quat_new_with_axis_angle(godot_quat *r_dest, const godot_vector
*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;
diff --git a/modules/gdnative/godot/godot_quat.h b/modules/gdnative/godot/godot_quat.h
index 6bdc33accf..2289b6cbab 100644
--- a/modules/gdnative/godot/godot_quat.h
+++ b/modules/gdnative/godot/godot_quat.h
@@ -49,6 +49,18 @@ typedef struct godot_quat {
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);
diff --git a/modules/gdnative/godot/godot_rect2.cpp b/modules/gdnative/godot/godot_rect2.cpp
index eea95ca6fe..0e456ea3ba 100644
--- a/modules/gdnative/godot/godot_rect2.cpp
+++ b/modules/gdnative/godot/godot_rect2.cpp
@@ -38,11 +38,11 @@ extern "C" {
void _rect2_api_anchor() {}
-void GDAPI godot_rect2_new_with_pos_and_size(godot_rect2 *r_dest, const godot_vector2 *p_pos, const godot_vector2 *p_size) {
- const Vector2 *pos = (const Vector2 *)p_pos;
+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(*pos, *size);
+ *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) {
@@ -124,11 +124,11 @@ godot_bool GDAPI godot_rect2_operator_equal(const godot_rect2 *p_self, const god
return *self == *b;
}
-godot_vector2 GDAPI godot_rect2_get_pos(const godot_rect2 *p_self) {
+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_pos();
+ *d = self->get_position();
return dest;
}
@@ -140,10 +140,10 @@ godot_vector2 GDAPI godot_rect2_get_size(const godot_rect2 *p_self) {
return dest;
}
-void GDAPI godot_rect2_set_pos(godot_rect2 *p_self, const godot_vector2 *p_pos) {
+void GDAPI godot_rect2_set_position(godot_rect2 *p_self, const godot_vector2 *p_pos) {
Rect2 *self = (Rect2 *)p_self;
- const Vector2 *pos = (const Vector2 *)p_pos;
- self->set_pos(*pos);
+ 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) {
diff --git a/modules/gdnative/godot/godot_rect2.h b/modules/gdnative/godot/godot_rect2.h
index 9743321a3b..488a1204f7 100644
--- a/modules/gdnative/godot/godot_rect2.h
+++ b/modules/gdnative/godot/godot_rect2.h
@@ -46,7 +46,7 @@ typedef struct godot_rect2 {
#include "../godot.h"
#include "godot_vector2.h"
-void GDAPI godot_rect2_new_with_pos_and_size(godot_rect2 *r_dest, const godot_vector2 *p_pos, const godot_vector2 *p_size);
+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);
@@ -71,11 +71,11 @@ godot_rect2 GDAPI godot_rect2_expand(const godot_rect2 *p_self, const godot_vect
godot_bool GDAPI godot_rect2_operator_equal(const godot_rect2 *p_self, const godot_rect2 *p_b);
-godot_vector2 GDAPI godot_rect2_get_pos(const godot_rect2 *p_self);
+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_pos(godot_rect2 *p_self, const godot_vector2 *p_pos);
+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);
diff --git a/modules/gdnative/godot/godot_rect3.cpp b/modules/gdnative/godot/godot_rect3.cpp
index c4f8a853c2..e524fa8463 100644
--- a/modules/gdnative/godot/godot_rect3.cpp
+++ b/modules/gdnative/godot/godot_rect3.cpp
@@ -45,6 +45,34 @@ void GDAPI godot_rect3_new(godot_rect3 *r_dest, const godot_vector3 *p_pos, cons
*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;
diff --git a/modules/gdnative/godot/godot_rect3.h b/modules/gdnative/godot/godot_rect3.h
index 95969ab20e..9e9a49ac27 100644
--- a/modules/gdnative/godot/godot_rect3.h
+++ b/modules/gdnative/godot/godot_rect3.h
@@ -49,6 +49,12 @@ typedef struct godot_rect3 {
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);
diff --git a/modules/gdnative/godot/godot_string.cpp b/modules/gdnative/godot/godot_string.cpp
index 59d20c6d23..679011e715 100644
--- a/modules/gdnative/godot/godot_string.cpp
+++ b/modules/gdnative/godot/godot_string.cpp
@@ -41,81 +41,75 @@ extern "C" {
void _string_api_anchor() {
}
-void GDAPI godot_string_new(godot_string *p_str) {
- String *p = (String *)p_str;
- memnew_placement(p, String);
- // *p = String(); // useless here
+void GDAPI godot_string_new(godot_string *r_dest) {
+ String *dest = (String *)r_dest;
+ memnew_placement(dest, String);
}
-void GDAPI godot_string_new_data(godot_string *p_str, const char *p_contents, const int p_size) {
- String *p = (String *)p_str;
- memnew_placement(p, String);
- *p = String::utf8(p_contents, p_size);
+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_unicode_data(godot_string *p_str, const wchar_t *p_contents, const int p_size) {
- String *p = (String *)p_str;
- memnew_placement(p, String);
- *p = String(p_contents, p_size);
+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_get_data(const godot_string *p_str, char *p_dest, int *p_size) {
- String *p = (String *)p_str;
+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 *r_dest, int *p_size) {
+ String *self = (String *)p_self;
if (p_size != NULL) {
- *p_size = p->utf8().length();
+ *p_size = self->utf8().length();
}
- if (p_dest != NULL) {
- memcpy(p_dest, p->utf8().get_data(), *p_size);
+ if (r_dest != NULL) {
+ memcpy(r_dest, self->utf8().get_data(), *p_size);
}
}
-void GDAPI godot_string_copy_string(const godot_string *p_dest, const godot_string *p_src) {
- String *dest = (String *)p_dest;
- String *src = (String *)p_src;
-
- *dest = *src;
-}
-
-wchar_t GDAPI *godot_string_operator_index(godot_string *p_str, const godot_int p_idx) {
- String *s = (String *)p_str;
- return &(s->operator[](p_idx));
+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_str) {
- const String *s = (const String *)p_str;
- return s->utf8().get_data();
+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_str) {
- const String *s = (const String *)p_str;
- return s->c_str();
+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_a, const godot_string *p_b) {
- String *a = (String *)p_a;
- String *b = (String *)p_b;
- return *a == *b;
+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_a, const godot_string *p_b) {
- String *a = (String *)p_a;
- String *b = (String *)p_b;
- return *a < *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;
}
-void GDAPI godot_string_operator_plus(godot_string *p_dest, const godot_string *p_a, const godot_string *p_b) {
- String *dest = (String *)p_dest;
- const String *a = (String *)p_a;
- const String *b = (String *)p_b;
-
- String tmp = *a + *b;
- godot_string_new(p_dest);
- *dest = tmp;
+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_str) {
- String *p = (String *)p_str;
- p->~String();
+void GDAPI godot_string_destroy(godot_string *p_self) {
+ String *self = (String *)p_self;
+ self->~String();
}
#ifdef __cplusplus
diff --git a/modules/gdnative/godot/godot_string.h b/modules/gdnative/godot/godot_string.h
index e0ba298a9c..df848abb76 100644
--- a/modules/gdnative/godot/godot_string.h
+++ b/modules/gdnative/godot/godot_string.h
@@ -45,27 +45,26 @@ typedef struct godot_string {
#include "../godot.h"
-void GDAPI godot_string_new(godot_string *p_str);
-void GDAPI godot_string_new_data(godot_string *p_str, const char *p_contents, const int p_size);
-void GDAPI godot_string_new_unicode_data(godot_string *p_str, const wchar_t *p_contents, const int p_size);
+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_str, char *p_dest, int *p_size);
+void GDAPI godot_string_get_data(const godot_string *p_self, char *p_dest, int *p_size);
-void GDAPI godot_string_copy_string(const godot_string *p_dest, const godot_string *p_src);
+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);
-wchar_t GDAPI *godot_string_operator_index(godot_string *p_str, const godot_int p_idx);
-const char GDAPI *godot_string_c_str(const godot_string *p_str);
-const wchar_t GDAPI *godot_string_unicode_str(const godot_string *p_str);
-
-godot_bool GDAPI godot_string_operator_equal(const godot_string *p_a, const godot_string *p_b);
-godot_bool GDAPI godot_string_operator_less(const godot_string *p_a, const godot_string *p_b);
-void GDAPI godot_string_operator_plus(godot_string *p_dest, const godot_string *p_a, const godot_string *p_b);
+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);
// @Incomplete
// hmm, I guess exposing the whole API doesn't make much sense
// since the language used in the library has its own string funcs
-void GDAPI godot_string_destroy(godot_string *p_str);
+void GDAPI godot_string_destroy(godot_string *p_self);
#ifdef __cplusplus
}
diff --git a/modules/gdnative/godot/godot_transform.cpp b/modules/gdnative/godot/godot_transform.cpp
index f5a012f59c..eb9e1e207b 100644
--- a/modules/gdnative/godot/godot_transform.cpp
+++ b/modules/gdnative/godot/godot_transform.cpp
@@ -57,6 +57,32 @@ void GDAPI godot_transform_new(godot_transform *r_dest, const godot_basis *p_bas
*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;
diff --git a/modules/gdnative/godot/godot_transform.h b/modules/gdnative/godot/godot_transform.h
index b15efc23b8..ee87e1d33f 100644
--- a/modules/gdnative/godot/godot_transform.h
+++ b/modules/gdnative/godot/godot_transform.h
@@ -51,6 +51,12 @@ typedef struct godot_transform {
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);
diff --git a/modules/gdnative/godot/godot_variant.cpp b/modules/gdnative/godot/godot_variant.cpp
index 9381fb86d3..c9607fb21a 100644
--- a/modules/gdnative/godot/godot_variant.cpp
+++ b/modules/gdnative/godot/godot_variant.cpp
@@ -45,10 +45,10 @@ godot_variant_type GDAPI godot_variant_get_type(const godot_variant *p_self) {
return (godot_variant_type)self->get_type();
}
-void GDAPI godot_variant_copy(godot_variant *p_dest, const godot_variant *p_src) {
+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;
- *dest = *src;
+ memnew_placement(dest, Variant(*src));
}
void GDAPI godot_variant_new_nil(godot_variant *r_dest) {
diff --git a/modules/gdnative/godot/godot_variant.h b/modules/gdnative/godot/godot_variant.h
index d46b87c41b..9b6d287249 100644
--- a/modules/gdnative/godot/godot_variant.h
+++ b/modules/gdnative/godot/godot_variant.h
@@ -68,7 +68,6 @@ typedef enum godot_variant_type {
GODOT_VARIANT_TYPE_NODE_PATH, // 15
GODOT_VARIANT_TYPE_RID,
GODOT_VARIANT_TYPE_OBJECT,
- GODOT_VARIANT_TYPE_INPUT_EVENT, // TODO: remove me once input_event is removed from main Godot codebase
GODOT_VARIANT_TYPE_DICTIONARY,
GODOT_VARIANT_TYPE_ARRAY, // 20
@@ -119,7 +118,7 @@ typedef struct godot_variant_call_error {
godot_variant_type GDAPI godot_variant_get_type(const godot_variant *p_v);
-void GDAPI godot_variant_copy(godot_variant *r_dest, const godot_variant *p_src);
+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);
diff --git a/modules/gdnative/godot/godot_vector3.cpp b/modules/gdnative/godot/godot_vector3.cpp
index f9942af6e5..adca0d1e2a 100644
--- a/modules/gdnative/godot/godot_vector3.cpp
+++ b/modules/gdnative/godot/godot_vector3.cpp
@@ -90,11 +90,12 @@ godot_vector3 GDAPI godot_vector3_inverse(const godot_vector3 *p_self) {
return dest;
}
-godot_vector3 GDAPI godot_vector3_snapped(const godot_vector3 *p_self, const godot_real p_by) {
+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(p_by);
+ *((Vector3 *)&dest) = self->snapped(*snap_axis);
return dest;
}
diff --git a/modules/gdnative/godot/godot_vector3.h b/modules/gdnative/godot/godot_vector3.h
index 8e2aed8173..98d9ddf6ac 100644
--- a/modules/gdnative/godot/godot_vector3.h
+++ b/modules/gdnative/godot/godot_vector3.h
@@ -70,7 +70,7 @@ 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_real p_by);
+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);
diff --git a/modules/gdscript/gd_editor.cpp b/modules/gdscript/gd_editor.cpp
index eea5b15236..adf3c8edc4 100644
--- a/modules/gdscript/gd_editor.cpp
+++ b/modules/gdscript/gd_editor.cpp
@@ -69,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;
@@ -1263,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;
@@ -1630,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;
@@ -2238,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("_"))
diff --git a/modules/gdscript/gd_function.cpp b/modules/gdscript/gd_function.cpp
index e8a8e20927..795371af60 100644
--- a/modules/gdscript/gd_function.cpp
+++ b/modules/gdscript/gd_function.cpp
@@ -1428,8 +1428,24 @@ 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;
}
@@ -1468,8 +1484,24 @@ 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;
}
@@ -1478,6 +1510,8 @@ void GDFunctionState::_bind_methods() {
ClassDB::bind_method(D_METHOD("resume:Variant", "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_parser.cpp b/modules/gdscript/gd_parser.cpp
index d64cd86de6..75029a020b 100644
--- a/modules/gdscript/gd_parser.cpp
+++ b/modules/gdscript/gd_parser.cpp
@@ -2626,7 +2626,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;
}
@@ -2639,7 +2639,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;
}
diff --git a/modules/gdscript/gd_script.cpp b/modules/gdscript/gd_script.cpp
index dcc0e24098..1dcc442234 100644
--- a/modules/gdscript/gd_script.cpp
+++ b/modules/gdscript/gd_script.cpp
@@ -615,6 +615,11 @@ Error GDScript::reload(bool p_keep_state) {
if (basedir != "")
basedir = basedir.get_base_dir();
+ if (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);
diff --git a/modules/gdscript/gd_script.h b/modules/gdscript/gd_script.h
index 00ae136790..0add348ca9 100644
--- a/modules/gdscript/gd_script.h
+++ b/modules/gdscript/gd_script.h
@@ -381,12 +381,15 @@ 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);
diff --git a/modules/gridmap/grid_map.cpp b/modules/gridmap/grid_map.cpp
index d1f54e021f..9d3da8227c 100644
--- a/modules/gridmap/grid_map.cpp
+++ b/modules/gridmap/grid_map.cpp
@@ -1057,12 +1057,12 @@ Error GridMap::create_area(int p_id, const Rect3 &p_bounds) {
// 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_bounds.position.x;
+ from.y = p_bounds.position.y;
+ from.z = p_bounds.position.z;
+ to.x = p_bounds.position.x + p_bounds.size.x;
+ to.y = p_bounds.position.y + p_bounds.size.y;
+ to.z = p_bounds.position.z + p_bounds.size.z;
for (Map<int, Area *>::Element *E = area_map.front(); E; E = E->next()) {
//this should somehow be faster...
@@ -1101,8 +1101,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_editor_plugin.cpp b/modules/gridmap/grid_map_editor_plugin.cpp
index e567e08c79..954e865bcd 100644
--- a/modules/gridmap/grid_map_editor_plugin.cpp
+++ b/modules/gridmap/grid_map_editor_plugin.cpp
@@ -560,7 +560,7 @@ bool GridMapEditor::forward_spatial_input_event(Camera *p_camera, const Ref<Inpu
else
return false;
- return do_input_action(p_camera, Point2(mb->get_pos().x, mb->get_pos().y), true);
+ return do_input_action(p_camera, Point2(mb->get_position().x, mb->get_position().y), true);
} else {
if (
@@ -604,7 +604,7 @@ bool GridMapEditor::forward_spatial_input_event(Camera *p_camera, const Ref<Inpu
if (mm.is_valid()) {
- return do_input_action(p_camera, mm->get_pos(), false);
+ return do_input_action(p_camera, mm->get_position(), false);
}
} else if (edit_mode->get_selected() == 1) {
@@ -616,7 +616,7 @@ bool GridMapEditor::forward_spatial_input_event(Camera *p_camera, const Ref<Inpu
if (mb->get_button_index() == BUTTON_LEFT && mb->is_pressed()) {
- Point2 point = mb->get_pos();
+ Point2 point = mb->get_position();
Camera *camera = p_camera;
Vector3 from = camera->project_ray_origin(point);
@@ -635,7 +635,7 @@ bool GridMapEditor::forward_spatial_input_event(Camera *p_camera, const Ref<Inpu
int area = E->get();
Rect3 aabb = node->area_get_bounds(area);
- aabb.pos *= node->get_cell_size();
+ aabb.position *= node->get_cell_size();
aabb.size *= node->get_cell_size();
Vector3 rclip, rnormal;
diff --git a/modules/hdr/image_loader_hdr.cpp b/modules/hdr/image_loader_hdr.cpp
index 85819104cf..19df27b962 100644
--- a/modules/hdr/image_loader_hdr.cpp
+++ b/modules/hdr/image_loader_hdr.cpp
@@ -131,7 +131,7 @@ Error ImageLoaderHDR::load_image(Ref<Image> p_image, FileAccess *f, bool p_force
//convert
for (int i = 0; i < width * height; i++) {
- float exp = pow(2, ptr[3] - 128);
+ float exp = pow(2.0f, ptr[3] - 128.0f);
Color c(
ptr[0] * exp / 255.0,
diff --git a/modules/hdr/image_loader_hdr.h b/modules/hdr/image_loader_hdr.h
index 9bc1fadd13..127833ebd0 100644
--- a/modules/hdr/image_loader_hdr.h
+++ b/modules/hdr/image_loader_hdr.h
@@ -27,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 IMAGE_LOADER_TINYEXR_H
-#define IMAGE_LOADER_TINYEXR_H
+#ifndef IMAGE_LOADER_HDR_H
+#define IMAGE_LOADER_HDR_H
#include "io/image_loader.h"
diff --git a/modules/regex/regex.cpp b/modules/regex/regex.cpp
index eb9f1d2ab1..c3e97e357d 100644
--- a/modules/regex/regex.cpp
+++ b/modules/regex/regex.cpp
@@ -590,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) {
@@ -598,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
@@ -611,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;
}
}
@@ -668,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];
@@ -676,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;
}
@@ -1488,7 +1496,7 @@ void RegEx::_bind_methods() {
ClassDB::bind_method(D_METHOD("clear"), &RegEx::clear);
ClassDB::bind_method(D_METHOD("compile", "pattern"), &RegEx::compile);
- ClassDB::bind_method(D_METHOD("search", "text", "start", "end"), &RegEx::search, DEFVAL(0), DEFVAL(-1));
+ ClassDB::bind_method(D_METHOD("search:RegExMatch", "text", "start", "end"), &RegEx::search, DEFVAL(0), DEFVAL(-1));
ClassDB::bind_method(D_METHOD("sub", "text", "replacement", "all", "start", "end"), &RegEx::sub, DEFVAL(false), DEFVAL(0), DEFVAL(-1));
ClassDB::bind_method(D_METHOD("is_valid"), &RegEx::is_valid);
ClassDB::bind_method(D_METHOD("get_pattern"), &RegEx::get_pattern);
diff --git a/modules/squish/image_compress_squish.cpp b/modules/squish/image_compress_squish.cpp
index efed0b8665..efce76c805 100644
--- a/modules/squish/image_compress_squish.cpp
+++ b/modules/squish/image_compress_squish.cpp
@@ -64,6 +64,7 @@ void image_decompress_squish(Image *p_image) {
} else if (p_image->get_format() == Image::FORMAT_RGTC_RG) {
squish_flags = squish::kBc5;
} else {
+ print_line("wtf askd to decompress.. " + itos(p_image->get_format()));
ERR_FAIL_COND(true);
return;
}
@@ -79,7 +80,7 @@ void image_decompress_squish(Image *p_image) {
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, bool p_srgb) {
+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
@@ -96,11 +97,16 @@ void image_compress_squish(Image *p_image, bool p_srgb) {
p_image->convert(Image::FORMAT_RGBA8); //still uses RGBA to convert
- if (p_srgb && (dc == Image::DETECTED_R || dc == Image::DETECTED_RG)) {
+ 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;
}
+ if (p_source == Image::COMPRESS_SOURCE_NORMAL) {
+ //R and RG do not support SRGB
+ dc = Image::DETECTED_RG;
+ }
+
switch (dc) {
case Image::DETECTED_L: {
@@ -153,8 +159,8 @@ void image_compress_squish(Image *p_image, bool p_srgb) {
int bh = h % 4 != 0 ? h + (4 - h % 4) : h;
int src_ofs = p_image->get_mipmap_offset(i);
- squish::CompressImage(&rb[src_ofs], bw, bh, &wb[dst_ofs], squish_comp);
- dst_ofs += (MAX(4, w) * MAX(4, h)) >> shift;
+ 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;
}
diff --git a/modules/squish/image_compress_squish.h b/modules/squish/image_compress_squish.h
index 8d859b8e0b..68aaeefc30 100644
--- a/modules/squish/image_compress_squish.h
+++ b/modules/squish/image_compress_squish.h
@@ -32,7 +32,7 @@
#include "image.h"
-void image_compress_squish(Image *p_image, bool p_srgb);
+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/stb_vorbis/audio_stream_ogg_vorbis.h b/modules/stb_vorbis/audio_stream_ogg_vorbis.h
index 287aa4ca47..46cdfd3f2d 100644
--- a/modules/stb_vorbis/audio_stream_ogg_vorbis.h
+++ b/modules/stb_vorbis/audio_stream_ogg_vorbis.h
@@ -77,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/resource_importer_ogg_vorbis.cpp b/modules/stb_vorbis/resource_importer_ogg_vorbis.cpp
index 9a3d5c2651..f0a7ee1ec6 100644
--- a/modules/stb_vorbis/resource_importer_ogg_vorbis.cpp
+++ b/modules/stb_vorbis/resource_importer_ogg_vorbis.cpp
@@ -48,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 {
@@ -99,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/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/etc1/config.py b/modules/tga/config.py
index fb920482f5..fb920482f5 100644
--- a/modules/etc1/config.py
+++ b/modules/tga/config.py
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/scene/3d/test_cube.h b/modules/tga/image_loader_tga.h
index db2bef67fe..11329ec68a 100644
--- a/scene/3d/test_cube.h
+++ b/modules/tga/image_loader_tga.h
@@ -1,5 +1,5 @@
/*************************************************************************/
-/* test_cube.h */
+/* image_loader_jpegd.h */
/*************************************************************************/
/* This file is part of: */
/* GODOT ENGINE */
@@ -27,27 +27,57 @@
/* 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_TGA_H
+#define IMAGE_LOADER_TGA_H
-#include "rid.h"
-#include "scene/3d/visual_instance.h"
+#include "io/image_loader.h"
/**
- @author Juan Linietsky <reduzio@gmail.com>
+ @author SaracenOne
*/
-class TestCube : public GeometryInstance {
+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
+ };
- GDCLASS(TestCube, GeometryInstance);
+ 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
+ };
- RID instance;
+ struct tga_header_s {
+ uint8_t id_length;
+ uint8_t color_map_type;
+ tga_type_e image_type;
-public:
- virtual Rect3 get_aabb() const;
- virtual PoolVector<Face3> get_faces(uint32_t p_usage_flags) const;
+ 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);
- TestCube();
- ~TestCube();
+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/scene/3d/test_cube.cpp b/modules/tga/register_types.cpp
index af09bef7a7..6e120fa3bf 100644
--- a/scene/3d/test_cube.cpp
+++ b/modules/tga/register_types.cpp
@@ -1,5 +1,5 @@
/*************************************************************************/
-/* test_cube.cpp */
+/* register_types.cpp */
/*************************************************************************/
/* This file is part of: */
/* GODOT ENGINE */
@@ -27,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_tga.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 ImageLoaderTGA *image_loader_tga = NULL;
-TestCube::TestCube() {
+void register_tga_types() {
- set_base(VisualServer::get_singleton()->get_test_cube());
+ image_loader_tga = memnew(ImageLoaderTGA);
+ ImageLoader::add_image_format_loader(image_loader_tga);
}
-TestCube::~TestCube() {
+void unregister_tga_types() {
+
+ memdelete(image_loader_tga);
}
diff --git a/modules/tga/register_types.h b/modules/tga/register_types.h
new file mode 100644
index 0000000000..079b7bf291
--- /dev/null
+++ b/modules/tga/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_tga_types();
+void unregister_tga_types();
diff --git a/modules/tinyexr/config.py b/modules/tinyexr/config.py
index fb920482f5..2e4b96a6b0 100644
--- a/modules/tinyexr/config.py
+++ b/modules/tinyexr/config.py
@@ -4,4 +4,8 @@ def can_build(platform):
def configure(env):
- pass
+ # 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/visual_script/register_types.cpp b/modules/visual_script/register_types.cpp
index c0467a901b..a54d306aff 100644
--- a/modules/visual_script/register_types.cpp
+++ b/modules/visual_script/register_types.cpp
@@ -90,6 +90,7 @@ void register_visual_script_types() {
ClassDB::register_class<VisualScriptSequence>();
//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/visual_script.cpp b/modules/visual_script/visual_script.cpp
index aec60391d3..a922fdf354 100644
--- a/modules/visual_script/visual_script.cpp
+++ b/modules/visual_script/visual_script.cpp
@@ -140,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;
@@ -660,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 {
@@ -1067,9 +1070,11 @@ 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);
}
}
@@ -1358,6 +1363,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);
}
}
@@ -2369,6 +2375,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;
diff --git a/modules/visual_script/visual_script.h b/modules/visual_script/visual_script.h
index 72843099c7..cdd7eded18 100644
--- a/modules/visual_script/visual_script.h
+++ b/modules/visual_script/visual_script.h
@@ -89,7 +89,7 @@ public:
struct TypeGuess {
Variant::Type type;
- StringName GDCLASS;
+ StringName gdclass;
Ref<Script> script;
TypeGuess() {
@@ -564,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_editor.cpp b/modules/visual_script/visual_script_editor.cpp
index 5839bc9243..a6b53b67fa 100644
--- a/modules/visual_script/visual_script_editor.cpp
+++ b/modules/visual_script/visual_script_editor.cpp
@@ -52,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) {
@@ -191,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) {
@@ -261,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;
}
@@ -699,7 +705,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"));
@@ -757,8 +763,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);
@@ -777,8 +783,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);
@@ -1011,7 +1017,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_position(members->get_global_position() + 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) {
@@ -1068,105 +1074,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
- }
}
}
@@ -2240,6 +2147,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();
@@ -2265,6 +2176,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();
@@ -2552,7 +2468,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();
}
}
@@ -2592,8 +2508,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");
}
@@ -2623,8 +2539,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");
}
@@ -2653,8 +2569,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");
}
@@ -2830,12 +2746,17 @@ void VisualScriptEditor::_notification(int p_what) {
if (p_what == NOTIFICATION_READY) {
node_filter_icon->set_texture(Control::get_icon("Zoom", "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;
@@ -3049,6 +2970,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);
@@ -3097,6 +3154,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() {
@@ -3118,17 +3179,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);
@@ -3170,7 +3230,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");
@@ -3186,7 +3247,8 @@ 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);
@@ -3276,6 +3338,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() {
diff --git a/modules/visual_script/visual_script_editor.h b/modules/visual_script/visual_script_editor.h
index bb832431a0..fee4e27bd5 100644
--- a/modules/visual_script/visual_script_editor.h
+++ b/modules/visual_script/visual_script_editor.h
@@ -72,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;
@@ -154,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;
@@ -223,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();
@@ -248,9 +265,11 @@ public:
virtual void get_breakpoints(List<int> *p_breakpoints);
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 791b5d99ff..78b70934c0 100644
--- a/modules/visual_script/visual_script_expression.cpp
+++ b/modules/visual_script/visual_script_expression.cpp
@@ -68,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") {
@@ -115,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") {
@@ -151,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_flow_control.cpp b/modules/visual_script/visual_script_flow_control.cpp
index 07d69db207..28622bed47 100644
--- a/modules/visual_script/visual_script_flow_control.cpp
+++ b/modules/visual_script/visual_script_flow_control.cpp
@@ -30,6 +30,7 @@
#include "visual_script_flow_control.h"
#include "global_config.h"
+#include "io/resource_loader.h"
#include "os/keyboard.h"
//////////////////////////////////////////
@@ -119,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 {
@@ -1725,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;
@@ -1815,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() {
diff --git a/modules/visual_script/visual_script_flow_control.h b/modules/visual_script/visual_script_flow_control.h
index 314804602e..d27fd47f84 100644
--- a/modules/visual_script/visual_script_flow_control.h
+++ b/modules/visual_script/visual_script_flow_control.h
@@ -261,6 +261,7 @@ public:
VisualScriptInputFilter();
};
#endif
+
class VisualScriptTypeCast : public VisualScriptNode {
GDCLASS(VisualScriptTypeCast, VisualScriptNode)
@@ -293,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 b466e64aec..93b2aa2982 100644
--- a/modules/visual_script/visual_script_func_nodes.cpp
+++ b/modules/visual_script/visual_script_func_nodes.cpp
@@ -33,7 +33,7 @@
#include "io/resource_loader.h"
#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"
//////////////////////////////////////////
@@ -546,25 +546,25 @@ 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 {
@@ -581,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 {
@@ -594,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) {
@@ -648,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;
@@ -673,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;
}
@@ -735,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);
@@ -1020,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) {
@@ -1027,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--;
@@ -1035,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;
}
@@ -1051,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 {
@@ -1073,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;
}
@@ -1236,6 +1256,7 @@ void VisualScriptPropertySet::set_property(const StringName &p_type) {
return;
property = p_type;
+ index = StringName();
_update_cache();
_change_notify();
ports_changed_notify();
@@ -1285,27 +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/node_path") {
+ if (property.name == "node_path") {
if (call_mode != CALL_MODE_NODE_PATH) {
property.usage = 0;
} else {
@@ -1318,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) {
@@ -1360,6 +1412,24 @@ void VisualScriptPropertySet::_validate_property(PropertyInfo &property) const {
}
}
}
+
+ 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() {
@@ -1385,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)
@@ -1405,14 +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::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);
@@ -1426,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) {
@@ -1441,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;
@@ -1466,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;
@@ -1481,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;
@@ -1504,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;
}
@@ -1517,6 +1678,7 @@ 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;
@@ -1641,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");
}
@@ -1867,27 +2038,42 @@ Variant::Type VisualScriptPropertyGet::_get_type_cache() const {
return type_cache;
}
+void VisualScriptPropertyGet::set_index(const StringName &p_type) {
+
+ if (index == p_type)
+ return;
+ index = p_type;
+ _update_cache();
+ _change_notify();
+ ports_changed_notify();
+}
+
+StringName VisualScriptPropertyGet::get_index() const {
+
+ 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/node_path") {
+ if (property.name == "node_path") {
if (call_mode != CALL_MODE_NODE_PATH) {
property.usage = 0;
} else {
@@ -1900,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) {
@@ -1941,6 +2127,24 @@ void VisualScriptPropertyGet::_validate_property(PropertyInfo &property) const {
}
}
}
+
+ 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() {
@@ -1966,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)
@@ -1986,13 +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::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);
@@ -2004,6 +2212,7 @@ public:
VisualScriptPropertyGet::CallMode call_mode;
NodePath node_path;
StringName property;
+ StringName index;
VisualScriptPropertyGet *node;
VisualScriptInstance *instance;
@@ -2020,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.");
@@ -2046,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());
@@ -2059,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;
@@ -2079,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;
}
@@ -2182,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;
@@ -2210,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 3b284952c5..7839748661 100644
--- a/modules/visual_script/visual_script_func_nodes.h
+++ b/modules/visual_script/visual_script_func_nodes.h
@@ -146,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;
@@ -155,6 +170,8 @@ private:
String base_script;
NodePath base_path;
StringName property;
+ 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;
@@ -205,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;
@@ -212,6 +237,7 @@ public:
};
VARIANT_ENUM_CAST(VisualScriptPropertySet::CallMode);
+VARIANT_ENUM_CAST(VisualScriptPropertySet::AssignOp);
class VisualScriptPropertyGet : public VisualScriptNode {
@@ -234,6 +260,7 @@ private:
String base_script;
NodePath base_path;
StringName property;
+ StringName index;
void _update_base_type();
Node *_get_base_node() const;
@@ -283,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 8ea3b8098d..f707471405 100644
--- a/modules/visual_script/visual_script_nodes.cpp
+++ b/modules/visual_script/visual_script_nodes.cpp
@@ -34,7 +34,7 @@
#include "os/input.h"
#include "os/os.h"
#include "scene/main/node.h"
-#include "scene/main/scene_main_loop.h"
+#include "scene/main/scene_tree.h"
//////////////////////////////////////////
////////////////FUNCTION//////////////////
@@ -59,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));
@@ -104,10 +104,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;
@@ -144,8 +144,8 @@ 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"));
}
if (!stack_less) {
p_list->push_back(PropertyInfo(Variant::INT, "stack/size", PROPERTY_HINT_RANGE, "1,100000"));
@@ -559,8 +559,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 {
@@ -621,6 +621,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//////////////////
//////////////////////////////////////////
@@ -691,7 +798,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);
@@ -714,7 +821,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 {
@@ -816,7 +923,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);
@@ -839,7 +946,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 {
@@ -956,7 +1063,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
@@ -976,8 +1083,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 {
@@ -1842,7 +1949,7 @@ VisualScriptEngineSingleton::TypeGuess VisualScriptEngineSingleton::guess_output
TypeGuess tg;
tg.type = Variant::OBJECT;
if (obj) {
- tg.GDCLASS = obj->get_class();
+ tg.gdclass = obj->get_class();
tg.script = obj->get_script();
}
@@ -2002,7 +2109,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();
@@ -2031,7 +2138,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
@@ -2173,7 +2280,7 @@ VisualScriptSceneTree::TypeGuess VisualScriptSceneTree::guess_output_type(TypeGu
TypeGuess tg;
tg.type = Variant::OBJECT;
- tg.GDCLASS = "SceneTree";
+ tg.gdclass = "SceneTree";
return tg;
}
@@ -2353,13 +2460,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;
@@ -3088,8 +3195,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() {
@@ -3210,8 +3317,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() {
@@ -3253,32 +3360,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 {
@@ -3319,8 +3427,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) {
@@ -3628,6 +3734,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 402093fa80..5ae9a1b30b 100644
--- a/modules/visual_script/visual_script_nodes.h
+++ b/modules/visual_script/visual_script_nodes.h
@@ -127,6 +127,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)
diff --git a/modules/visual_script/visual_script_yield_nodes.cpp b/modules/visual_script/visual_script_yield_nodes.cpp
index 8f96eb6800..2e111511b7 100644
--- a/modules/visual_script/visual_script_yield_nodes.cpp
+++ b/modules/visual_script/visual_script_yield_nodes.cpp
@@ -31,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"
//////////////////////////////////////////
@@ -419,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 {
@@ -438,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;
@@ -488,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/platform/android/detect.py b/platform/android/detect.py
index 8d2ed59f17..7508c9ed0e 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/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,35 +87,43 @@ def configure(env):
env['SPAWN'] = mySpawn
- ndk_platform = env['ndk_platform']
+ ## Build type
- if env['android_arch'] not in ['armv7', 'armv6', 'x86']:
- env['android_arch'] = 'armv7'
+ 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'])
- if env['android_arch'] == 'x86':
- env["x86_libtheora_opt_gcc"] = True
+ ## Architecture
- if env['PLATFORM'] == 'win32':
- env.Tool('gcc')
- env['SHLIBSUFFIX'] = '.so'
+ if env['android_arch'] not in ['armv7', 'armv6', 'x86']:
+ env['android_arch'] = 'armv7'
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.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.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":
target_subpath = "arm-linux-androideabi-4.9"
abi_subpath = "arm-linux-androideabi"
@@ -130,6 +133,14 @@ def configure(env):
else:
env.extra_suffix = ".armv7" + env.extra_suffix
+ ## 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")):
host_subpath = "linux-x86_64"
@@ -142,10 +153,8 @@ def configure(env):
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
@@ -162,31 +171,28 @@ def configure(env):
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(
- '-fpic -ffunction-sections -funwind-tables -fstack-protector-strong -fvisibility=hidden -fno-strict-aliasing'))
+ env.Append(CPPFLAGS=string.split('-fpic -ffunction-sections -funwind-tables -fstack-protector-strong -fvisibility=hidden -fno-strict-aliasing'))
env.Append(CPPFLAGS=string.split('-DANDROID -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__'])
@@ -196,21 +202,20 @@ def configure(env):
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']
+ 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 +226,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/export/export.cpp b/platform/android/export/export.cpp
index 84fc4f10bf..a72e8aa90e 100644
--- a/platform/android/export/export.cpp
+++ b/platform/android/export/export.cpp
@@ -36,7 +36,8 @@
#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 "version.h"
#include <string.h>
#if 0
@@ -1714,7 +1715,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));
@@ -2042,6 +2043,7 @@ class EditorExportAndroid : public EditorExportPlatform {
GDCLASS(EditorExportAndroid, EditorExportPlatform)
Ref<ImageTexture> logo;
+ Ref<ImageTexture> run_icon;
struct Device {
@@ -2993,7 +2995,7 @@ public:
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));
@@ -3036,6 +3038,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();
@@ -3524,9 +3530,13 @@ public:
EditorExportAndroid() {
Ref<Image> img = memnew(Image(_android_logo));
- logo = Ref<ImageTexture>(memnew(ImageTexture));
+ 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;
diff --git a/platform/android/java_glue.cpp b/platform/android/java_glue.cpp
index 37f53a2478..d4bd443689 100644
--- a/platform/android/java_glue.cpp
+++ b/platform/android/java_glue.cpp
@@ -1367,7 +1367,7 @@ JNIEXPORT void JNICALL Java_org_godotengine_godot_GodotLib_joybutton(JNIEnv *env
jevent.device = p_device;
jevent.type = OS_Android::JOY_EVENT_BUTTON;
jevent.index = p_button;
- jevent->is_pressed() = p_pressed;
+ jevent.pressed = p_pressed;
input_mutex->lock();
joy_events.push_back(jevent);
diff --git a/platform/android/os_android.cpp b/platform/android/os_android.cpp
index 1c721c645c..9010b9e7da 100644
--- a/platform/android/os_android.cpp
+++ b/platform/android/os_android.cpp
@@ -344,7 +344,7 @@ void OS_Android::process_joy_event(OS_Android::JoypadEvent p_event) {
switch (p_event.type) {
case JOY_EVENT_BUTTON:
- input->joy_button(p_event.device, p_event.index, p_event->is_pressed());
+ input->joy_button(p_event.device, p_event.index, p_event.pressed);
break;
case JOY_EVENT_AXIS:
InputDefault::JoyAxis value;
@@ -380,8 +380,8 @@ void OS_Android::process_touch(int p_what, int p_pointer, const Vector<TouchPos>
ev->set_button_index(BUTTON_LEFT);
ev->set_button_mask(BUTTON_MASK_LEFT);
ev->set_pressed(false);
- ev->set_pos(touch[0].pos);
- ev->set_global_pos(touch[0].pos);
+ ev->set_position(touch[0].pos);
+ ev->set_global_position(touch[0].pos);
input->parse_input_event(ev);
}
@@ -391,7 +391,7 @@ void OS_Android::process_touch(int p_what, int p_pointer, const Vector<TouchPos>
ev.instance();
ev->set_index(touch[i].id);
ev->set_pressed(false);
- ev->set_pos(touch[i].pos);
+ ev->set_position(touch[i].pos);
input->parse_input_event(ev);
}
}
@@ -406,12 +406,12 @@ void OS_Android::process_touch(int p_what, int p_pointer, const Vector<TouchPos>
//send mouse
Ref<InputEventMouseButton> ev;
ev.instance();
- ev.type = Ref<InputEvent>::MOUSE_BUTTON;
+ // 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_pos(touch[0].pos);
- ev->set_global_pos(touch[0].pos);
+ 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);
@@ -424,7 +424,7 @@ void OS_Android::process_touch(int p_what, int p_pointer, const Vector<TouchPos>
ev.instance();
ev->set_index(touch[i].id);
ev->set_pressed(true);
- ev->set_pos(touch[i].pos.x);
+ ev->set_position(touch[i].pos);
input->parse_input_event(ev);
}
@@ -436,8 +436,8 @@ void OS_Android::process_touch(int p_what, int p_pointer, const Vector<TouchPos>
Ref<InputEventMouseMotion> ev;
ev.instance();
ev->set_button_mask(BUTTON_MASK_LEFT);
- ev->set_pos(p_points[0].pos.x);
- input->set_mouse_position(Point2(ev.mouse_motion.x, ev.mouse_motion.y));
+ 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;
@@ -465,7 +465,7 @@ void OS_Android::process_touch(int p_what, int p_pointer, const Vector<TouchPos>
Ref<InputEventScreenDrag> ev;
ev.instance();
ev->set_index(touch[i].id);
- ev->set_pos(p_points[idx].pos.x);
+ 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;
@@ -481,8 +481,8 @@ void OS_Android::process_touch(int p_what, int p_pointer, const Vector<TouchPos>
ev->set_button_index(BUTTON_LEFT);
ev->set_button_mask(BUTTON_MASK_LEFT);
ev->set_pressed(false);
- ev->set_pos(touch[0].pos.x);
- ev->set_global_pos(touch[0].pos.x);
+ 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);
@@ -492,7 +492,7 @@ void OS_Android::process_touch(int p_what, int p_pointer, const Vector<TouchPos>
ev.instance();
ev->set_index(touch[i].id);
ev->set_pressed(false);
- ev->set_pos(touch[i].pos);
+ ev->set_position(touch[i].pos);
input->parse_input_event(ev);
}
touch.clear();
@@ -511,7 +511,7 @@ void OS_Android::process_touch(int p_what, int p_pointer, const Vector<TouchPos>
ev->set_index(tp.id);
ev->set_pressed(true);
- ev->set_pos(tp.pos);
+ ev->set_position(tp.pos);
input->parse_input_event(ev);
} break;
@@ -524,7 +524,7 @@ void OS_Android::process_touch(int p_what, int p_pointer, const Vector<TouchPos>
ev.instance();
ev->set_index(touch[i].id);
ev->set_pressed(false);
- ev->set_pos(touch[i].pos);
+ ev->set_position(touch[i].pos);
input->parse_input_event(ev);
touch.remove(i);
i--;
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/haiku/detect.py b/platform/haiku/detect.py
index 54e227cd19..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', '-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/iphone/SCsub b/platform/iphone/SCsub
index 466b8241de..998d0a3f0d 100644
--- a/platform/iphone/SCsub
+++ b/platform/iphone/SCsub
@@ -17,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/detect.py b/platform/iphone/detect.py
index 2dcd6dd7e5..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,13 +22,12 @@ 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', 'Enable exceptions', 'no'),
('ios_triple', 'Triple for ios toolchain', ''),
('ios_sim', 'Build simulator binary', 'no'),
@@ -45,94 +43,94 @@ def get_flags():
def configure(env):
- env.Append(CPPPATH=['#platform/iphone'])
+ ## Build type
- env['ENV']['PATH'] = env['IPHONEPATH'] + "/Developer/usr/bin/:" + env['ENV']['PATH']
+ 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'])
- env['CC'] = '$IPHONEPATH/usr/bin/${ios_triple}clang'
- env['CXX'] = '$IPHONEPATH/usr/bin/${ios_triple}clang++'
- env['AR'] = '$IPHONEPATH/usr/bin/${ios_triple}ar'
- env['RANLIB'] = '$IPHONEPATH/usr/bin/${ios_triple}ranlib'
+ 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
- import string
if (env["ios_sim"] == "yes" or env["arch"] == "x86"): # i386, simulator
env["arch"] = "x86"
env["bits"] = "32"
- env.Append(CCFLAGS=string.split('-arch i386 -fobjc-abi-version=2 -fobjc-legacy-dispatch -fmessage-length=0 -fpascal-strings -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" or env["arch"] == "arm32" or env["arch"] == "armv7" or env["bits"] == "32"): # arm
env["arch"] = "arm"
env["bits"] = "32"
- 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 -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 -isysroot $IPHONESDK'))
else: # armv64
env["arch"] = "arm64"
env["bits"] = "64"
- 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 -fvisibility=hidden -MMD -MT dependencies -miphoneos-version-min=9.0 -isysroot $IPHONESDK'))
+
+ ## Compiler configuration
+
+ env['ENV']['PATH'] = env['IPHONEPATH'] + "/Developer/usr/bin/:" + env['ENV']['PATH']
+
+ env['CC'] = '$IPHONEPATH/usr/bin/${ios_triple}clang'
+ 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'
+
+ ## 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'])
+ 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=9.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=9.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':
@@ -142,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', '-gdwarf-2']) # removed -ffast-math
- env.Append(LINKFLAGS=['-O3'])
-
- elif env["target"] == "release_debug":
- env.Append(CCFLAGS=['-Os', '-DNS_BLOCK_ASSERTIONS=1', '-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', '-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..0960ec8791
--- /dev/null
+++ b/platform/iphone/export/export.cpp
@@ -0,0 +1,347 @@
+/*************************************************************************/
+/* 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 "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.gen.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 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;
+
+ EditorExportPlatformIOS();
+ ~EditorExportPlatformIOS();
+};
+
+void EditorExportPlatformIOS::get_preset_features(const Ref<EditorExportPreset> &p_preset, List<String> *r_features) {
+
+ // what does this need to do?
+}
+
+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));
+
+ /* 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(GlobalConfig::get_singleton()->get("application/name")) != "")
+ pkg_name = String(GlobalConfig::get_singleton()->get("application/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/iphone/export/export.h b/platform/iphone/export/export.h
new file mode 100644
index 0000000000..6e9324aed7
--- /dev/null
+++ b/platform/iphone/export/export.h
@@ -0,0 +1,30 @@
+/*************************************************************************/
+/* export.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_iphone_exporter();
diff --git a/platform/iphone/os_iphone.cpp b/platform/iphone/os_iphone.cpp
index 0d7913446e..b244edbff6 100644
--- a/platform/iphone/os_iphone.cpp
+++ b/platform/iphone/os_iphone.cpp
@@ -212,7 +212,7 @@ void OSIPhone::mouse_button(int p_idx, int p_x, int p_y, bool p_pressed, bool p_
ev->set_index(p_idx);
ev->set_pressed(p_pressed);
- ev->set_pos(Vector2(p_x, p_y));
+ ev->set_position(Vector2(p_x, p_y));
queue_event(ev);
};
@@ -225,12 +225,12 @@ void OSIPhone::mouse_button(int p_idx, int p_x, int p_y, bool p_pressed, bool p_
// swaped it for tilted screen
//ev->get_pos().x = ev.mouse_button.global_x = video_mode.height - p_y;
//ev->get_pos().y = ev.mouse_button.global_y = p_x;
- ev->set_pos(Vector2(video_mode.height - p_y, p_x));
- ev->set_global_pos(Vector2(video_mode.height - p_y, p_x));
+ ev->set_position(Vector2(video_mode.height - p_y, p_x));
+ ev->set_global_position(Vector2(video_mode.height - p_y, p_x));
//mouse_list.pressed[p_idx] = p_pressed;
- input->set_mouse_position(ev->get_pos());
+ input->set_mouse_position(ev->get_position());
ev->set_button_index(BUTTON_LEFT);
ev->set_doubleclick(p_doubleclick);
ev->set_pressed(p_pressed);
@@ -246,7 +246,7 @@ void OSIPhone::mouse_move(int p_idx, int p_prev_x, int p_prev_y, int p_x, int p_
Ref<InputEventScreenDrag> ev;
ev.instance();
ev->set_index(p_idx);
- ev->set_pos(Vector2(p_x, p_y));
+ 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);
};
@@ -255,11 +255,11 @@ void OSIPhone::mouse_move(int p_idx, int p_prev_x, int p_prev_y, int p_x, int p_
Ref<InputEventMouseMotion> ev;
ev.instance();
- ev->set_pos(Vector2(p_x, p_y));
- ev->set_global_pos(Vector2(p_x, p_y));
+ 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));
- input->set_mouse_position(ev->get_pos());
+ input->set_mouse_position(ev->get_position());
ev->set_speed(input->get_last_mouse_speed());
ev->set_button_mask(BUTTON_LEFT); // pressed
diff --git a/platform/javascript/detect.py b/platform/javascript/detect.py
index 41fe3fb027..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', '-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'])
+ ## 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/export/export.cpp b/platform/javascript/export/export.cpp
index ea388072c5..4bdfdae39e 100644
--- a/platform/javascript/export/export.cpp
+++ b/platform/javascript/export/export.cpp
@@ -30,7 +30,8 @@
#include "editor/editor_node.h"
#include "editor_export.h"
#include "io/zip_io.h"
-#include "platform/javascript/logo.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"
@@ -42,6 +43,8 @@ class EditorExportPlatformJavaScript : public EditorExportPlatform {
GDCLASS(EditorExportPlatformJavaScript, EditorExportPlatform)
Ref<ImageTexture> logo;
+ Ref<ImageTexture> run_icon;
+ bool runnable_when_last_polled;
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);
@@ -64,10 +67,12 @@ public:
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);
- virtual int get_device_count() const { return 1; }
+ 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;
EditorExportPlatformJavaScript();
};
@@ -303,6 +308,29 @@ Error EditorExportPlatformJavaScript::export_project(const Ref<EditorExportPrese
return OK;
}
+bool EditorExportPlatformJavaScript::poll_devices() {
+
+ Ref<EditorExportPreset> preset;
+
+ for (int i = 0; i < EditorExport::get_singleton()->get_export_preset_count(); i++) {
+
+ Ref<EditorExportPreset> ep = EditorExport::get_singleton()->get_export_preset(i);
+ if (ep->is_runnable() && ep->get_platform() == this) {
+ preset = ep;
+ break;
+ }
+ }
+
+ 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 {
+
+ return runnable_when_last_polled;
+}
+
Error EditorExportPlatformJavaScript::run(const Ref<EditorExportPreset> &p_preset, int p_device, int p_debug_flags) {
String path = EditorSettings::get_singleton()->get_settings_path() + "/tmp/tmp_export.html";
@@ -314,11 +342,22 @@ Error EditorExportPlatformJavaScript::run(const Ref<EditorExportPreset> &p_prese
return OK;
}
+Ref<Texture> EditorExportPlatformJavaScript::get_run_icon() const {
+
+ return run_icon;
+}
+
EditorExportPlatformJavaScript::EditorExportPlatformJavaScript() {
Ref<Image> img = memnew(Image(_javascript_logo));
logo.instance();
logo->create_from_image(img);
+
+ img = Ref<Image>(memnew(Image(_javascript_run_icon)));
+ run_icon.instance();
+ run_icon->create_from_image(img);
+
+ runnable_when_last_polled = false;
}
void register_javascript_exporter() {
diff --git a/platform/javascript/os_javascript.cpp b/platform/javascript/os_javascript.cpp
index ae00fb429e..9df26f1471 100644
--- a/platform/javascript/os_javascript.cpp
+++ b/platform/javascript/os_javascript.cpp
@@ -46,14 +46,12 @@
#define DOM_BUTTON_RIGHT 2
template <typename T>
-static InputModifierState dom2godot_mod(T emscripten_event_ptr) {
+static void dom2godot_mod(T emscripten_event_ptr, Ref<InputEventWithModifiers> godot_event) {
- InputModifierState mod;
- mod.shift = emscripten_event_ptr->shiftKey;
- mod.alt = emscripten_event_ptr->altKey;
- mod.control = emscripten_event_ptr->ctrlKey;
- mod.meta = emscripten_event_ptr->metaKey;
- return mod;
+ 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 {
@@ -151,26 +149,26 @@ static EM_BOOL _mousebutton_callback(int event_type, const EmscriptenMouseEvent
ERR_FAIL_COND_V(event_type != EMSCRIPTEN_EVENT_MOUSEDOWN && event_type != EMSCRIPTEN_EVENT_MOUSEUP, false);
- Ref<InputEvent> ev;
- ev.type = Ref<InputEvent>::MOUSE_BUTTON;
- ev->is_pressed() = event_type == EMSCRIPTEN_EVENT_MOUSEDOWN;
- ev.mouse_button.global_x = ev->get_pos().x = mouse_event->canvasX;
- ev.mouse_button.global_y = ev->get_pos().y = mouse_event->canvasY;
- ev.mouse_button.mod = dom2godot_mod(mouse_event);
+ 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->get_button_index() = BUTTON_LEFT; break;
- case DOM_BUTTON_MIDDLE: ev->get_button_index() = BUTTON_MIDDLE; break;
- case DOM_BUTTON_RIGHT: ev->get_button_index() = BUTTON_RIGHT; break;
+ 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;
}
- ev->get_button_mask() = _input->get_mouse_button_mask();
+ int mask = _input->get_mouse_button_mask();
if (ev->is_pressed())
- ev->get_button_mask() |= 1 << ev->get_button_index();
+ mask |= 1 << ev->get_button_index();
else
- ev->get_button_mask() &= ~(1 << ev->get_button_index());
- ev->get_button_mask() >>= 1;
+ mask &= ~(1 << ev->get_button_index());
+ ev->set_button_mask(mask >> 1);
_input->parse_input_event(ev);
return true;
@@ -180,20 +178,17 @@ static EM_BOOL _mousemove_callback(int event_type, const EmscriptenMouseEvent *m
ERR_FAIL_COND_V(event_type != EMSCRIPTEN_EVENT_MOUSEMOVE, false);
- Ref<InputEvent> ev;
- ev.type = Ref<InputEvent>::MOUSE_MOTION;
- ev.mouse_motion.mod = dom2godot_mod(mouse_event);
- ev->get_button_mask() = _input->get_mouse_button_mask() >> 1;
+ Ref<InputEventMouseMotion> ev;
+ ev.instance();
+ dom2godot_mod(mouse_event, ev);
+ ev->set_button_mask(_input->get_mouse_button_mask() >> 1);
- ev.mouse_motion.global_x = ev.mouse_motion.x = mouse_event->canvasX;
- ev.mouse_motion.global_y = ev.mouse_motion.y = mouse_event->canvasY;
+ ev->set_position(Point2(mouse_event->canvasX, mouse_event->canvasY));
+ ev->set_global_position(ev->get_position());
- ev->get_relative().x = _input->get_mouse_position().x - ev.mouse_motion.x;
- ev->get_relative().y = _input->get_mouse_position().y - ev.mouse_motion.y;
-
- _input->set_mouse_position(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->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);
return true;
@@ -203,31 +198,35 @@ static EM_BOOL _wheel_callback(int event_type, const EmscriptenWheelEvent *wheel
ERR_FAIL_COND_V(event_type != EMSCRIPTEN_EVENT_WHEEL, false);
- Ref<InputEvent> ev;
- ev.type = Ref<InputEvent>::MOUSE_BUTTON;
- ev->get_button_mask() = _input->get_mouse_button_mask() >> 1;
- ev.mouse_button.global_x = ev->get_pos().x = _input->get_mouse_position().x;
- ev.mouse_button.global_y = ev->get_pos().y = _input->get_mouse_position().y;
- ev.mouse_button->get_shift() = _input->is_key_pressed(KEY_SHIFT);
- ev.mouse_button->get_alt() = _input->is_key_pressed(KEY_ALT);
- ev.mouse_button->get_control() = _input->is_key_pressed(KEY_CONTROL);
- ev.mouse_button->get_metakey() = _input->is_key_pressed(KEY_META);
+ 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->get_button_index() = BUTTON_WHEEL_UP;
+ ev->set_button_index(BUTTON_WHEEL_UP);
else if (wheel_event->deltaY > 0)
- ev->get_button_index() = BUTTON_WHEEL_DOWN;
+ ev->set_button_index(BUTTON_WHEEL_DOWN);
else if (wheel_event->deltaX > 0)
- ev->get_button_index() = BUTTON_WHEEL_LEFT;
+ ev->set_button_index(BUTTON_WHEEL_LEFT);
else if (wheel_event->deltaX < 0)
- ev->get_button_index() = BUTTON_WHEEL_RIGHT;
+ ev->set_button_index(BUTTON_WHEEL_RIGHT);
else
return false;
- ev->is_pressed() = true;
+ // 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->is_pressed() = false;
+ ev->set_pressed(false);
_input->parse_input_event(ev);
return true;
@@ -243,8 +242,8 @@ static EM_BOOL _touchpress_callback(int event_type, const EmscriptenTouchEvent *
event_type != EMSCRIPTEN_EVENT_TOUCHCANCEL,
false);
- Ref<InputEvent> ev;
- ev.type = Ref<InputEvent>::SCREEN_TOUCH;
+ Ref<InputEventScreenTouch> ev;
+ ev.instance();
int lowest_id_index = -1;
for (int i = 0; i < touch_event->numTouches; ++i) {
@@ -253,25 +252,29 @@ static EM_BOOL _touchpress_callback(int event_type, const EmscriptenTouchEvent *
lowest_id_index = i;
if (!touch.isChanged)
continue;
- ev.screen_touch.index = touch.identifier;
- _prev_touches[i].x = ev.screen_touch.x = touch.canvasX;
- _prev_touches[i].y = ev.screen_touch.y = touch.canvasY;
- ev.screen_touch->is_pressed() = event_type == EMSCRIPTEN_EVENT_TOUCHSTART;
+ 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) {
- ev.type = Ref<InputEvent>::MOUSE_BUTTON;
- ev.mouse_button.mod = dom2godot_mod(touch_event);
- ev->get_button_mask() = _input->get_mouse_button_mask() >> 1;
- ev.mouse_button.global_x = ev->get_pos().x = touch_event->touches[lowest_id_index].canvasX;
- ev.mouse_button.global_y = ev->get_pos().y = touch_event->touches[lowest_id_index].canvasY;
- ev->get_button_index() = BUTTON_LEFT;
- ev->is_pressed() = event_type == EMSCRIPTEN_EVENT_TOUCHSTART;
+ Ref<InputEventMouseButton> ev_mouse;
+ ev_mouse.instance();
+ ev_mouse->set_button_mask(_input->get_mouse_button_mask() >> 1);
+ dom2godot_mod(touch_event, ev_mouse);
- _input->parse_input_event(ev);
+ 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;
}
@@ -280,8 +283,8 @@ static EM_BOOL _touchmove_callback(int event_type, const EmscriptenTouchEvent *t
ERR_FAIL_COND_V(event_type != EMSCRIPTEN_EVENT_TOUCHMOVE, false);
- Ref<InputEvent> ev;
- ev.type = Ref<InputEvent>::SCREEN_DRAG;
+ Ref<InputEventScreenDrag> ev;
+ ev.instance();
int lowest_id_index = -1;
for (int i = 0; i < touch_event->numTouches; ++i) {
@@ -290,44 +293,42 @@ static EM_BOOL _touchmove_callback(int event_type, const EmscriptenTouchEvent *t
lowest_id_index = i;
if (!touch.isChanged)
continue;
- ev.screen_drag.index = touch.identifier;
- ev.screen_drag.x = touch.canvasX;
- ev.screen_drag.y = touch.canvasY;
+ ev->set_index(touch.identifier);
+ ev->set_position(Point2(touch.canvasX, touch.canvasY));
Point2 &prev = _prev_touches[i];
- ev.screen_drag.relative_x = touch.canvasX - prev.x;
- ev.screen_drag.relative_y = touch.canvasY - prev.y;
- prev.x = ev.screen_drag.x;
- prev.y = ev.screen_drag.y;
+ ev->set_relative(ev->get_position() - prev);
+ prev = ev->get_position();
_input->parse_input_event(ev);
}
if (touch_event->touches[lowest_id_index].isChanged) {
- ev.type = Ref<InputEvent>::MOUSE_MOTION;
- ev.mouse_motion.mod = dom2godot_mod(touch_event);
- ev->get_button_mask() = _input->get_mouse_button_mask() >> 1;
- ev.mouse_motion.global_x = ev.mouse_motion.x = touch_event->touches[lowest_id_index].canvasX;
- ev.mouse_motion.global_y = ev.mouse_motion.y = touch_event->touches[lowest_id_index].canvasY;
- ev->get_relative().x = _input->get_mouse_position().x - ev.mouse_motion.x;
- ev->get_relative().y = _input->get_mouse_position().y - ev.mouse_motion.y;
+ Ref<InputEventMouseMotion> ev_mouse;
+ ev_mouse.instance();
+ dom2godot_mod(touch_event, ev_mouse);
+ ev_mouse->set_button_mask(_input->get_mouse_button_mask() >> 1);
- _input->set_mouse_position(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;
+ 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());
- _input->parse_input_event(ev);
+ 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<InputEvent> _setup_key_event(const EmscriptenKeyboardEvent *emscripten_event) {
+static Ref<InputEventKey> _setup_key_event(const EmscriptenKeyboardEvent *emscripten_event) {
- Ref<InputEvent> ev;
- ev.type = Ref<InputEvent>::KEY;
- ev->is_echo() = emscripten_event->repeat;
- ev.key.mod = dom2godot_mod(emscripten_event);
- ev->get_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`)
@@ -336,21 +337,21 @@ static Ref<InputEvent> _setup_key_event(const EmscriptenKeyboardEvent *emscripte
unicode = String::utf8(emscripten_event->charValue);
}
if (unicode.length() == 1) {
- ev.key.unicode = unicode[0];
+ ev->set_unicode(unicode[0]);
}
return ev;
}
-static Ref<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);
- Ref<InputEvent> ev = _setup_key_event(key_event);
- ev->is_pressed() = true;
- if (ev.key.unicode == 0 && keycode_has_unicode(ev->get_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
@@ -363,7 +364,7 @@ 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;
+ deferred_key_event->set_unicode(key_event->charCode);
_input->parse_input_event(deferred_key_event);
return true;
}
@@ -372,8 +373,8 @@ static EM_BOOL _keyup_callback(int event_type, const EmscriptenKeyboardEvent *ke
ERR_FAIL_COND_V(event_type != EMSCRIPTEN_EVENT_KEYUP, false);
- Ref<InputEvent> ev = _setup_key_event(key_event);
- ev->is_pressed() = false;
+ 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;
}
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/detect.py b/platform/osx/detect.py
index 39ee33ae82..dfefbbc1ba 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', '-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
+
+ ## Flags
- 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') } )
+ 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', '-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/export/export.cpp b/platform/osx/export/export.cpp
index 2033bc76a1..c81fb00b36 100644
--- a/platform/osx/export/export.cpp
+++ b/platform/osx/export/export.cpp
@@ -27,6 +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 "export.h"
#include "editor/editor_export.h"
#include "editor/editor_node.h"
@@ -37,511 +38,652 @@
#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 "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 Ref<Texture> get_logo() const { return logo; }
-
- 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 requires_password(bool p_debug) const { return false; }
+#ifdef OSX_ENABLED
+ virtual String get_binary_extension() const { return "dmg"; }
+#else
virtual String get_binary_extension() const { return "zip"; }
- virtual Error export_project(const String& p_path,bool p_debug,int p_flags=0);
+#endif
+ virtual Error export_project(const Ref<EditorExportPreset> &p_preset, bool p_debug, const String &p_path, int p_flags = 0);
- virtual bool can_export(String *r_error=NULL) const;
+ virtual bool can_export(const Ref<EditorExportPreset> &p_preset, String &r_error, bool &r_missing_templates) const;
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;
+}
+
+Error EditorExportPlatformOSX::export_project(const Ref<EditorExportPreset> &p_preset, bool p_debug, const String &p_path, int p_flags) {
- EditorProgress ep("export","Exporting for OSX",104);
+ 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(GlobalConfig::get_singleton()->get("application/name")) != "")
+ pkg_name = String(GlobalConfig::get_singleton()->get("application/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);
- 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);
+ 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 = GlobalConfig::get_singleton()->get("application/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);
+
+ 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(GlobalConfig::get_singleton()->get("application/name")) != "")
+ pkg_name = String(GlobalConfig::get_singleton()->get("application/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 = GlobalConfig::get_singleton()->get("application/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/os_osx.h b/platform/osx/os_osx.h
index 3a37d663ad..a3036b1a8a 100644
--- a/platform/osx/os_osx.h
+++ b/platform/osx/os_osx.h
@@ -30,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
@@ -96,6 +96,7 @@ public:
CursorShape cursor_shape;
MouseMode mouse_mode;
+ String title;
bool minimized;
bool maximized;
bool zoomed;
@@ -116,6 +117,8 @@ public:
return 1.0;
}
+ void _update_window();
+
float display_scale;
protected:
@@ -200,6 +203,9 @@ 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 PowerState get_power_state();
virtual int get_power_seconds_left();
virtual int get_power_percent_left();
diff --git a/platform/osx/os_osx.mm b/platform/osx/os_osx.mm
index 13bc2226f4..87c25a5356 100644
--- a/platform/osx/os_osx.mm
+++ b/platform/osx/os_osx.mm
@@ -53,6 +53,10 @@
#include <sys/types.h>
#include <unistd.h>
+#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
@@ -291,8 +295,8 @@ static int button_mask = 0;
get_key_modifier_state([event modifierFlags], mb);
mb->set_button_index(BUTTON_LEFT);
mb->set_pressed(true);
- mb->set_pos(Vector2(mouse_x, mouse_y));
- mb->set_global_pos(Vector2(mouse_x, mouse_y));
+ mb->set_position(Vector2(mouse_x, mouse_y));
+ mb->set_global_position(Vector2(mouse_x, mouse_y));
mb->set_button_mask(button_mask);
mb->set_doubleclick([event clickCount] == 2);
OS_OSX::singleton->push_input(mb);
@@ -311,8 +315,8 @@ static int button_mask = 0;
get_key_modifier_state([event modifierFlags], mb);
mb->set_button_index(BUTTON_LEFT);
mb->set_pressed(false);
- mb->set_pos(Vector2(mouse_x, mouse_y));
- mb->set_global_pos(Vector2(mouse_x, mouse_y));
+ mb->set_position(Vector2(mouse_x, mouse_y));
+ mb->set_global_position(Vector2(mouse_x, mouse_y));
mb->set_button_mask(button_mask);
mb->set_doubleclick([event clickCount] == 2);
OS_OSX::singleton->push_input(mb);
@@ -330,8 +334,8 @@ static int button_mask = 0;
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]);
- mm->set_pos(Vector2(mouse_x, mouse_y));
- mm->set_global_pos(Vector2(mouse_x, mouse_y));
+ 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]);
@@ -352,8 +356,8 @@ static int button_mask = 0;
get_key_modifier_state([event modifierFlags], mb);
mb->set_button_index(BUTTON_RIGHT);
mb->set_pressed(true);
- mb->set_pos(Vector2(mouse_x, mouse_y));
- mb->set_global_pos(Vector2(mouse_x, mouse_y));
+ mb->set_position(Vector2(mouse_x, mouse_y));
+ mb->set_global_position(Vector2(mouse_x, mouse_y));
mb->set_button_mask(button_mask);
mb->set_doubleclick([event clickCount] == 2);
OS_OSX::singleton->push_input(mb);
@@ -365,7 +369,7 @@ static int button_mask = 0;
- (void)rightMouseUp:(NSEvent *)event {
- button_mask |= BUTTON_MASK_RIGHT;
+ button_mask &= ~BUTTON_MASK_RIGHT;
Ref<InputEventMouseButton> mb;
mb.instance();
@@ -373,8 +377,8 @@ static int button_mask = 0;
get_key_modifier_state([event modifierFlags], mb);
mb->set_button_index(BUTTON_RIGHT);
mb->set_pressed(false);
- mb->set_pos(Vector2(mouse_x, mouse_y));
- mb->set_global_pos(Vector2(mouse_x, mouse_y));
+ mb->set_position(Vector2(mouse_x, mouse_y));
+ mb->set_global_position(Vector2(mouse_x, mouse_y));
mb->set_button_mask(button_mask);
mb->set_doubleclick([event clickCount] == 2);
OS_OSX::singleton->push_input(mb);
@@ -393,8 +397,8 @@ static int button_mask = 0;
get_key_modifier_state([event modifierFlags], mb);
mb->set_button_index(BUTTON_MIDDLE);
mb->set_pressed(true);
- mb->set_pos(Vector2(mouse_x, mouse_y));
- mb->set_global_pos(Vector2(mouse_x, mouse_y));
+ mb->set_position(Vector2(mouse_x, mouse_y));
+ mb->set_global_position(Vector2(mouse_x, mouse_y));
mb->set_button_mask(button_mask);
mb->set_doubleclick([event clickCount] == 2);
OS_OSX::singleton->push_input(mb);
@@ -409,16 +413,16 @@ static int button_mask = 0;
if ((int)[event buttonNumber] != 2)
return;
- button_mask |= BUTTON_MASK_MIDDLE;
+ button_mask &= ~BUTTON_MASK_MIDDLE;
Ref<InputEventMouseButton> mb;
mb.instance();
get_key_modifier_state([event modifierFlags], mb);
mb->set_button_index(BUTTON_MIDDLE);
- mb->set_pressed(true);
- mb->set_pos(Vector2(mouse_x, mouse_y));
- mb->set_global_pos(Vector2(mouse_x, mouse_y));
+ mb->set_pressed(false);
+ mb->set_position(Vector2(mouse_x, mouse_y));
+ mb->set_global_position(Vector2(mouse_x, mouse_y));
mb->set_button_mask(button_mask);
mb->set_doubleclick([event clickCount] == 2);
OS_OSX::singleton->push_input(mb);
@@ -701,8 +705,8 @@ inline void sendScrollEvent(int button, double factor, int modifierFlags) {
sc->set_factor(factor);
sc->set_pressed(true);
Vector2 mouse_pos = Vector2(mouse_x, mouse_y);
- sc->set_pos(mouse_pos);
- sc->set_global_pos(mouse_pos);
+ 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);
@@ -813,10 +817,16 @@ void OS_OSX::initialize(const VideoMode &p_desired, int p_video_driver, int p_au
// 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)
+ initWithContentRect:NSMakeRect(0, 0, p_desired.width, p_desired.height)
styleMask:styleMask
backing:NSBackingStoreBuffered
defer:NO];
@@ -825,8 +835,8 @@ void OS_OSX::initialize(const VideoMode &p_desired, int p_video_driver, int p_au
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];
@@ -911,6 +921,8 @@ void OS_OSX::initialize(const VideoMode &p_desired, int p_video_driver, int p_au
[NSApp activateIgnoringOtherApps:YES];
+ _update_window();
+
[window_object makeKeyAndOrderFront:nil];
if (p_desired.fullscreen)
@@ -932,12 +944,10 @@ void OS_OSX::initialize(const VideoMode &p_desired, int p_video_driver, int p_au
//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));
+ 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);
@@ -972,9 +982,10 @@ void OS_OSX::initialize(const VideoMode &p_desired, int p_video_driver, int p_au
displayScale = [[screenArray objectAtIndex:i] backingScaleFactor];
}
- NSRect nsrect = [[screenArray objectAtIndex:i] visibleFrame];
+ // Note: Use frame to get the whole screen size
+ NSRect nsrect = [[screenArray objectAtIndex:i] frame];
Rect2 rect = Rect2(nsrect.origin.x, nsrect.origin.y, nsrect.size.width, nsrect.size.height);
- rect.pos *= displayScale;
+ rect.position *= displayScale;
rect.size *= displayScale;
screens.push_back(rect);
@@ -1127,6 +1138,7 @@ int OS_OSX::get_mouse_button_state() const {
}
void OS_OSX::set_window_title(const String &p_title) {
+ title = p_title;
[window_object setTitle:[NSString stringWithUTF8String:p_title.utf8().get_data()]];
}
@@ -1275,7 +1287,7 @@ void OS_OSX::set_current_screen(int p_screen) {
Point2 OS_OSX::get_screen_position(int p_screen) const {
ERR_FAIL_INDEX_V(p_screen, screens.size(), Point2());
- return screens[p_screen].pos;
+ return screens[p_screen].position;
};
int OS_OSX::get_screen_dpi(int p_screen) const {
@@ -1290,6 +1302,31 @@ Size2 OS_OSX::get_screen_size(int p_screen) const {
return screens[p_screen].size;
};
+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);
@@ -1302,6 +1339,8 @@ void OS_OSX::set_window_position(const Point2 &p_position) {
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 {
@@ -1313,17 +1352,22 @@ void OS_OSX::set_window_size(const Size2 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) {
@@ -1384,7 +1428,7 @@ void OS_OSX::set_window_maximized(bool p_enabled) {
[window_object setFrame:[[[NSScreen screens] objectAtIndex: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;
};
@@ -1405,6 +1449,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;
diff --git a/platform/server/detect.py b/platform/server/detect.py
index 32f3c55135..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
+
+ 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/uwp/app.cpp b/platform/uwp/app.cpp
index 51aba9b7fd..c773c0b746 100644
--- a/platform/uwp/app.cpp
+++ b/platform/uwp/app.cpp
@@ -263,7 +263,7 @@ void App::pointer_event(Windows::UI::Core::CoreWindow ^ sender, Windows::UI::Cor
screen_touch.instance();
screen_touch->set_device(0);
screen_touch->set_pressed(p_pressed);
- screen_touch->set_pos(Vector2(pos.X, pos.Y));
+ screen_touch->set_position(Vector2(pos.X, pos.Y));
screen_touch->set_index(_get_finger(point->PointerId));
last_touch_x[screen_touch->get_index()] = pos.X;
@@ -280,8 +280,8 @@ void App::pointer_event(Windows::UI::Core::CoreWindow ^ sender, Windows::UI::Cor
mouse_button->set_device(0);
mouse_button->set_pressed(p_pressed);
mouse_button->set_button_index(but);
- mouse_button->set_pos(Vector2(pos.X, pos.Y));
- mouse_button->set_global_pos(Vector2(pos.X, pos.Y));
+ 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) {
@@ -355,9 +355,9 @@ void App::OnPointerMoved(Windows::UI::Core::CoreWindow ^ sender, Windows::UI::Co
Ref<InputEventScreenDrag> screen_drag;
screen_drag.instance();
screen_drag->set_device(0);
- screen_drag->set_pos(Vector2(pos.X, pos.Y));
+ 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_pos().x - last_touch_x[screen_drag->get_index()], screen_drag->get_pos().y - last_touch_y[screen_drag->get_index()]));
+ 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(screen_drag);
if (number_of_contacts > 1)
@@ -372,8 +372,8 @@ void App::OnPointerMoved(Windows::UI::Core::CoreWindow ^ sender, Windows::UI::Co
Ref<InputEventMouseMotion> mouse_motion;
mouse_motion.instance();
mouse_motion->set_device(0);
- mouse_motion->set_pos(Vector2(pos.X, pos.Y));
- mouse_motion->set_global_pos(Vector2(pos.X, pos.Y));
+ 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;
@@ -394,8 +394,8 @@ void App::OnMouseMoved(MouseDevice ^ mouse_device, MouseEventArgs ^ args) {
Ref<InputEventMouseMotion> mouse_motion;
mouse_motion.instance();
mouse_motion->set_device(0);
- mouse_motion->set_pos(Vector2(pos.X, pos.Y));
- mouse_motion->set_global_pos(Vector2(pos.X, pos.Y));
+ 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;
diff --git a/platform/uwp/detect.py b/platform/uwp/detect.py
index baff7f9788..ca469d0056 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,16 +40,36 @@ 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 = ""
- env['ENV'] = os.environ
+ ## 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
@@ -60,9 +81,12 @@ 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"
@@ -74,17 +98,16 @@ def configure(env):
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"):
@@ -106,48 +129,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=['/AI', vc_base_path + 'lib/store/references'])
- env.Append(CPPFLAGS=['/AI', vc_base_path + 'lib/x86/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'])
- 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', vc_base_path + '\\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=['/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',
@@ -164,8 +169,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/windows/detect.py b/platform/windows/detect.py
index 5e56c1db49..a2bc5a11ab 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.")
@@ -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'])
- env.Append(CCFLAGS=['/MT', '/Gd', '/GR', '/nologo'])
+ ## 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:
@@ -339,30 +259,6 @@ def configure(env):
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', '-DDEBUG_ENABLED', '-DDEBUG_MEMORY_ENABLED'])
-
env["CC"] = mingw_prefix + "gcc"
env['AS'] = mingw_prefix + "as"
env['CXX'] = mingw_prefix + "g++"
@@ -371,29 +267,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 3802e7e784..c9271f6266 100644
--- a/platform/windows/export/export.cpp
+++ b/platform/windows/export/export.cpp
@@ -28,7 +28,7 @@
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
#include "editor/editor_export.h"
-#include "platform/windows/logo.h"
+#include "platform/windows/logo.gen.h"
void register_windows_exporter() {
diff --git a/platform/windows/godot.ico b/platform/windows/godot.ico
index fd5c28944f..dd611e07da 100644
--- a/platform/windows/godot.ico
+++ b/platform/windows/godot.ico
Binary files differ
diff --git a/platform/windows/os_windows.cpp b/platform/windows/os_windows.cpp
index 830aae5515..2daf580c0d 100644
--- a/platform/windows/os_windows.cpp
+++ b/platform/windows/os_windows.cpp
@@ -37,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 "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"
@@ -219,7 +219,7 @@ void OS_Windows::_touch_event(bool p_pressed, int p_x, int p_y, int idx) {
event.instance();
event->set_index(idx);
event->set_pressed(p_pressed);
- event->set_pos(Vector2(p_x, p_y));
+ event->set_position(Vector2(p_x, p_y));
if (main_loop) {
input->parse_input_event(event);
@@ -231,7 +231,7 @@ void OS_Windows::_drag_event(int p_x, int p_y, int idx) {
Ref<InputEventScreenDrag> event;
event.instance();
event->set_index(idx);
- event->set_pos(Vector2(p_x, p_y));
+ event->set_position(Vector2(p_x, p_y));
if (main_loop)
input->parse_input_event(event);
@@ -378,7 +378,7 @@ LRESULT OS_Windows::WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
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_pos(Vector2(GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam)));
+ mm->set_position(Vector2(GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam)));
if (mouse_mode == MOUSE_MODE_CAPTURED) {
@@ -386,31 +386,31 @@ LRESULT OS_Windows::WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
old_x = c.x;
old_y = c.y;
- if (mm->get_pos() == c) {
+ if (mm->get_position() == c) {
center = c;
return 0;
}
- Point2i ncenter = mm->get_pos();
+ 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_position(mm->get_pos());
+ input->set_mouse_position(mm->get_position());
mm->set_speed(input->get_last_mouse_speed());
if (old_invalid) {
- old_x = mm->get_pos().x;
- old_y = mm->get_pos().y;
+ old_x = mm->get_position().x;
+ old_y = mm->get_position().y;
old_invalid = false;
}
- mm->set_relative(Vector2(mm->get_pos() - Vector2(old_x, old_y)));
- old_x = mm->get_pos().x;
- old_y = mm->get_pos().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(mm);
@@ -536,15 +536,13 @@ LRESULT OS_Windows::WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
/*
mb->get_button_mask()|=(wParam&MK_XBUTTON1)?(1<<5):0;
mb->get_button_mask()|=(wParam&MK_XBUTTON2)?(1<<6):0;*/
- mb->set_pos(Vector2(GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam)));
+ mb->set_position(Vector2(GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam)));
if (mouse_mode == MOUSE_MODE_CAPTURED) {
- mb->set_pos(Vector2(old_x, old_y));
+ mb->set_position(Vector2(old_x, old_y));
}
- mb->set_global_pos(mb->get_pos());
-
if (uMsg != WM_MOUSEWHEEL) {
if (mb->is_pressed()) {
@@ -560,14 +558,16 @@ 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->get_pos().x;
- coords.y = mb->get_pos().y;
+ coords.x = mb->get_position().x;
+ coords.y = mb->get_position().y;
ScreenToClient(hWnd, &coords);
- mb->set_pos(Vector2(coords.x, coords.y));
+ mb->set_position(Vector2(coords.x, coords.y));
}
+ mb->set_global_position(mb->get_position());
+
if (main_loop) {
input->parse_input_event(mb);
if (mb->is_pressed() && mb->get_button_index() > 3) {
@@ -889,8 +889,8 @@ BOOL CALLBACK OS_Windows::MonitorEnumProc(HMONITOR hMonitor, HDC hdcMonitor, LPR
MonitorInfo minfo;
minfo.hMonitor = hMonitor;
minfo.hdcMonitor = hdcMonitor;
- minfo.rect.pos.x = lprcMonitor->left;
- minfo.rect.pos.y = lprcMonitor->top;
+ minfo.rect.position.x = lprcMonitor->left;
+ minfo.rect.position.y = lprcMonitor->top;
minfo.rect.size.x = lprcMonitor->right - lprcMonitor->left;
minfo.rect.size.y = lprcMonitor->bottom - lprcMonitor->top;
@@ -1029,12 +1029,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();
@@ -1370,7 +1368,7 @@ void OS_Windows::set_current_screen(int p_screen) {
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);
+ return Vector2(monitor_info[p_screen].rect.position);
}
Size2 OS_Windows::get_screen_size(int p_screen) const {
@@ -1412,28 +1410,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;
- //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);
- }*/
+ if (video_mode.borderless_window == false) {
+ RECT crect;
+ GetClientRect(hWnd, &crect);
- //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) {
@@ -1453,21 +1444,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 {
@@ -1477,35 +1465,12 @@ void OS_Windows::set_window_fullscreen(bool p_enabled) {
rect.bottom = video_mode.height;
}
- if (video_mode.resizable) {
-
- 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 {
+ _update_window_style(false);
- 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 {
@@ -1515,30 +1480,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 {
@@ -1578,13 +1523,36 @@ 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) {
diff --git a/platform/windows/os_windows.h b/platform/windows/os_windows.h
index 6cbdd58830..835141145f 100644
--- a/platform/windows/os_windows.h
+++ b/platform/windows/os_windows.h
@@ -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;
diff --git a/platform/x11/detect.py b/platform/x11/detect.py
index 0ba0f68393..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,66 +71,62 @@ 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', '-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
@@ -196,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
+
+ ## Flags
- if os.system("pkg-config --exists alsa") == 0:
+ 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'])
@@ -245,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 d6bad95e5b..69784a473d 100644
--- a/platform/x11/export/export.cpp
+++ b/platform/x11/export/export.cpp
@@ -29,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() {
diff --git a/platform/x11/godot_x11.cpp b/platform/x11/godot_x11.cpp
index b293b1bebb..6f418b213f 100644
--- a/platform/x11/godot_x11.cpp
+++ b/platform/x11/godot_x11.cpp
@@ -28,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>
@@ -38,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/os_x11.cpp b/platform/x11/os_x11.cpp
index 2a912a7ba2..790182794e 100644
--- a/platform/x11/os_x11.cpp
+++ b/platform/x11/os_x11.cpp
@@ -34,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>
@@ -67,6 +68,8 @@
#undef CursorShape
+#include <X11/XKBlib.h>
+
int OS_X11::get_video_driver_count() const {
return 1;
}
@@ -92,6 +95,7 @@ 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;
@@ -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;
@@ -444,6 +499,33 @@ void OS_X11::initialize(const VideoMode &p_desired, int p_video_driver, int p_au
_ensure_data_dir();
}
+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(short x, short y) {
+
+ if (!xic) {
+ return;
+ }
+ ::XPoint spot;
+ spot.x = x;
+ spot.y = y;
+ XVaNestedList preedit_attr = XVaCreateNestedList(0,
+ XNSpotLocation, &spot,
+ NULL);
+ XSetICValues(xic,
+ XNPreeditAttributes, preedit_attr,
+ NULL);
+ XFree(preedit_attr);
+ return;
+}
+
void OS_X11::finalize() {
if (main_loop)
@@ -491,8 +573,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)
@@ -939,6 +1025,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
//
@@ -1040,9 +1145,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);
@@ -1053,6 +1210,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 */
@@ -1081,11 +1239,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;
@@ -1107,17 +1260,19 @@ void OS_X11::handle_key_event(XKeyEvent *p_event, bool p_echo) {
// 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
@@ -1171,6 +1326,18 @@ void OS_X11::handle_key_event(XKeyEvent *p_event, bool p_echo) {
k->set_metakey(false);
}
+ 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);
}
@@ -1252,6 +1419,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();
@@ -1294,6 +1465,9 @@ void OS_X11::process_xevents() {
ButtonPressMask | ButtonReleaseMask | PointerMotionMask,
GrabModeAsync, GrabModeAsync, x11_window, None, CurrentTime);
}
+ if (xic) {
+ XSetICFocus(xic);
+ }
break;
case FocusOut:
@@ -1307,9 +1481,16 @@ void OS_X11::process_xevents() {
}
XUngrabPointer(x11_display, CurrentTime);
}
+ if (xic) {
+ XUnsetICFocus(xic);
+ }
break;
case ConfigureNotify:
+ if (xic) {
+ // Not portable.
+ set_ime_position(0, 1);
+ }
/* call resizeGLScene only if our window-size changed */
if ((event.xconfigure.width == current_videomode.width) &&
@@ -1334,8 +1515,8 @@ void OS_X11::process_xevents() {
get_key_modifier_state(event.xbutton.state, mb);
mb->set_button_mask(get_mouse_button_state(event.xbutton.state));
- mb->set_pos(Vector2(event.xbutton.x, event.xbutton.y));
- mb->set_global_pos(mb->get_pos());
+ 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);
@@ -1443,8 +1624,8 @@ void OS_X11::process_xevents() {
get_key_modifier_state(event.xmotion.state, mm);
mm->set_button_mask(get_mouse_button_state(event.xmotion.state));
- mm->set_pos(pos);
- mm->set_global_pos(pos);
+ 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);
diff --git a/platform/x11/os_x11.h b/platform/x11/os_x11.h
index d62186e5bd..39c512b6bd 100644
--- a/platform/x11/os_x11.h
+++ b/platform/x11/os_x11.h
@@ -113,6 +113,10 @@ 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);
+ void set_ime_position(short x, short y);
+
Point2i last_mouse_pos;
bool last_mouse_pos_valid;
Point2i last_click_pos;
@@ -247,6 +251,9 @@ 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 move_window_to_foreground();
virtual void alert(const String &p_alert, const String &p_title = "ALERT!");
diff --git a/scene/2d/animated_sprite.cpp b/scene/2d/animated_sprite.cpp
index eba638b0f5..a1ab51b3c8 100644
--- a/scene/2d/animated_sprite.cpp
+++ b/scene/2d/animated_sprite.cpp
@@ -30,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"
////////////////////////////
@@ -82,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 {
@@ -101,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 {
@@ -374,6 +377,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();
@@ -400,7 +405,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;
diff --git a/scene/2d/animated_sprite.h b/scene/2d/animated_sprite.h
index 64794b0ca3..80defac079 100644
--- a/scene/2d/animated_sprite.h
+++ b/scene/2d/animated_sprite.h
@@ -47,6 +47,8 @@ class SpriteFrames : public Resource {
loop = true;
speed = 5;
}
+
+ StringName normal_name;
};
Map<StringName, Anim> animations;
@@ -89,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 8bce489624..841e2ef7d3 100644
--- a/scene/2d/area_2d.cpp
+++ b/scene/2d/area_2d.cpp
@@ -29,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;
@@ -329,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);
@@ -357,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);
@@ -501,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) {
@@ -527,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() {
@@ -577,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);
@@ -598,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);
@@ -622,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()
@@ -641,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 3efc1abbd4..12d71f3911 100644
--- a/scene/2d/area_2d.h
+++ b/scene/2d/area_2d.h
@@ -55,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;
@@ -126,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);
@@ -164,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
@@ -179,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..cef473dcdf
--- /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:AudioStream"), &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/camera_2d.cpp b/scene/2d/camera_2d.cpp
index 71f651b0a4..908c95b50c 100644
--- a/scene/2d/camera_2d.cpp
+++ b/scene/2d/camera_2d.cpp
@@ -120,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()) {
@@ -160,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();
}
*/
@@ -267,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;
@@ -330,7 +379,6 @@ void Camera2D::_make_current(Object *p_which) {
if (p_which == this) {
current = true;
- _update_scroll();
} else {
current = false;
}
@@ -342,6 +390,7 @@ void Camera2D::_set_current(bool p_current) {
make_current();
current = p_current;
+ update();
}
bool Camera2D::is_current() const {
@@ -370,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 {
@@ -393,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 {
@@ -554,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);
@@ -616,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");
@@ -643,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);
}
@@ -671,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 686f40bedf..8d9e76be85 100644
--- a/scene/2d/camera_2d.h
+++ b/scene/2d/camera_2d.h
@@ -79,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);
@@ -138,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 b2258ec94b..68a3166aa7 100644
--- a/scene/2d/canvas_item.cpp
+++ b/scene/2d/canvas_item.cpp
@@ -28,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"
@@ -38,6 +39,196 @@
#include "scene/scene_string_names.h"
#include "servers/visual_server.h"
+Mutex *CanvasItemMaterial::material_mutex = NULL;
+SelfList<CanvasItemMaterial>::List CanvasItemMaterial::dirty_materials;
+Map<CanvasItemMaterial::MaterialKey, CanvasItemMaterial::ShaderData> CanvasItemMaterial::shader_map;
+
+void CanvasItemMaterial::init_shaders() {
+
+#ifndef NO_THREADS
+ material_mutex = Mutex::create();
+#endif
+}
+
+void CanvasItemMaterial::finish_shaders() {
+
+#ifndef NO_THREADS
+ memdelete(material_mutex);
+#endif
+}
+
+void CanvasItemMaterial::_update_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 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::flush_changes() {
+
+ if (material_mutex)
+ material_mutex->lock();
+
+ while (dirty_materials.first()) {
+
+ dirty_materials.first()->self()->_update_shader();
+ }
+
+ if (material_mutex)
+ material_mutex->unlock();
+}
+
+void CanvasItemMaterial::_queue_shader_change() {
+
+ if (material_mutex)
+ material_mutex->lock();
+
+ if (!element.in_list()) {
+ dirty_materials.add(&element);
+ }
+
+ 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();
+
+ if (material_mutex)
+ material_mutex->unlock();
+
+ return dirty;
+}
+void CanvasItemMaterial::set_blend_mode(BlendMode p_blend_mode) {
+
+ blend_mode = p_blend_mode;
+ _queue_shader_change();
+}
+
+CanvasItemMaterial::BlendMode CanvasItemMaterial::get_blend_mode() const {
+ return blend_mode;
+}
+
+void CanvasItemMaterial::set_light_mode(LightMode p_light_mode) {
+
+ light_mode = p_light_mode;
+ _queue_shader_change();
+}
+
+CanvasItemMaterial::LightMode CanvasItemMaterial::get_light_mode() const {
+
+ return light_mode;
+}
+
+void CanvasItemMaterial::_validate_property(PropertyInfo &property) const {
+}
+
+void CanvasItemMaterial::_bind_methods() {
+
+ 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);
+
+ 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);
+
+ 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");
+
+ 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()
+ : 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();
+}
+
///////////////////////////////////////////////////////////////////
bool CanvasItem::is_visible_in_tree() const {
@@ -176,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();
@@ -416,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) {
@@ -436,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.");
@@ -448,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.");
@@ -456,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) {
@@ -478,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.");
@@ -486,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) {
@@ -511,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.");
@@ -519,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.");
@@ -533,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) {
@@ -563,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;
@@ -653,7 +879,7 @@ bool CanvasItem::is_draw_behind_parent_enabled() const {
return behind;
}
-void CanvasItem::set_material(const Ref<ShaderMaterial> &p_material) {
+void CanvasItem::set_material(const Ref<Material> &p_material) {
material = p_material;
RID rid;
@@ -674,7 +900,7 @@ bool CanvasItem::get_use_parent_material() const {
return use_parent_material;
}
-Ref<ShaderMaterial> CanvasItem::get_material() const {
+Ref<Material> CanvasItem::get_material() const {
return material;
}
@@ -750,15 +976,17 @@ 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_texture", "texture:Texture", "pos", "modulate", "normal_map:Texture"), &CanvasItem::draw_texture, DEFVAL(Color(1, 1, 1, 1)), DEFVAL(Variant()));
+ ClassDB::bind_method(D_METHOD("draw_texture_rect", "texture:Texture", "rect", "tile", "modulate", "transpose", "normal_map:Texture"), &CanvasItem::draw_texture_rect, DEFVAL(Color(1, 1, 1)), DEFVAL(false), DEFVAL(Variant()));
+ ClassDB::bind_method(D_METHOD("draw_texture_rect_region", "texture:Texture", "rect", "src_rect", "modulate", "transpose", "normal_map:Texture", "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: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_primitive", "points", "colors", "uvs", "texture:Texture", "width", "normal_map:Texture"), &CanvasItem::draw_primitive, DEFVAL(Variant()), DEFVAL(1.0), DEFVAL(Variant()));
+ ClassDB::bind_method(D_METHOD("draw_polygon", "points", "colors", "uvs", "texture:Texture", "normal_map:Texture"), &CanvasItem::draw_polygon, DEFVAL(PoolVector2Array()), DEFVAL(Variant()), DEFVAL(Variant()));
+ ClassDB::bind_method(D_METHOD("draw_colored_polygon", "points", "color", "uvs", "texture:Texture", "normal_map:Texture"), &CanvasItem::draw_colored_polygon, DEFVAL(PoolVector2Array()), DEFVAL(Variant()), 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)));
@@ -776,8 +1004,8 @@ void CanvasItem::_bind_methods() {
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:ShaderMaterial"), &CanvasItem::set_material);
- ClassDB::bind_method(D_METHOD("get_material:ShaderMaterial"), &CanvasItem::get_material);
+ ClassDB::bind_method(D_METHOD("set_material", "material:Material"), &CanvasItem::set_material);
+ ClassDB::bind_method(D_METHOD("get_material: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);
@@ -803,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, "ShaderMaterial"), "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") ;
@@ -865,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 bea4301326..27842727ac 100644
--- a/scene/2d/canvas_item.h
+++ b/scene/2d/canvas_item.h
@@ -31,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"
@@ -42,6 +42,92 @@ class Font;
class StyleBox;
+class CanvasItemMaterial : public Material {
+
+ GDCLASS(CanvasItemMaterial, Material)
+
+public:
+ enum BlendMode {
+ BLEND_MODE_MIX,
+ BLEND_MODE_ADD,
+ BLEND_MODE_SUB,
+ BLEND_MODE_MUL,
+ BLEND_MODE_PREMULT_ALPHA
+ };
+
+ enum LightMode {
+ LIGHT_MODE_NORMAL,
+ LIGHT_MODE_UNSHADED,
+ LIGHT_MODE_LIGHT_ONLY
+ };
+
+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;
+ }
+ };
+
+ 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_blend_mode(BlendMode p_blend_mode);
+ BlendMode get_blend_mode() const;
+
+ void set_light_mode(LightMode p_light_mode);
+ LightMode get_light_mode() const;
+
+ static void init_shaders();
+ static void finish_shaders();
+ static void flush_changes();
+
+ CanvasItemMaterial();
+ virtual ~CanvasItemMaterial();
+};
+
+VARIANT_ENUM_CAST(CanvasItemMaterial::BlendMode)
+VARIANT_ENUM_CAST(CanvasItemMaterial::LightMode)
+
class CanvasItem : public Node {
GDCLASS(CanvasItem, Node);
@@ -83,7 +169,7 @@ private:
bool notify_local_transform;
bool notify_transform;
- Ref<ShaderMaterial> material;
+ Ref<Material> material;
mutable Transform2D global_transform;
mutable bool global_invalid;
@@ -156,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));
@@ -203,8 +291,8 @@ public:
RID get_canvas() const;
Ref<World2D> get_world_2d() const;
- void set_material(const Ref<ShaderMaterial> &p_material);
- Ref<ShaderMaterial> 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;
diff --git a/scene/2d/collision_object_2d.cpp b/scene/2d/collision_object_2d.cpp
index caf9cf201a..0821b00dd9 100644
--- a/scene/2d/collision_object_2d.cpp
+++ b/scene/2d/collision_object_2d.cpp
@@ -31,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) {
@@ -88,82 +76,197 @@ 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());
+ }
+}
+
+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 {
+
+ ERR_FAIL_COND_V(!shapes.has(p_owner), 0);
+
+ 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>());
+
+ return shapes[p_owner].shapes[p_shape].shape;
+}
+int CollisionObject2D::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;
}
-bool CollisionObject2D::_get(const StringName &p_name, Variant &r_ret) const {
+void CollisionObject2D::shape_owner_remove_shape(uint32_t p_owner, int p_shape) {
+
+ ERR_FAIL_COND(!shapes.has(p_owner));
+ ERR_FAIL_INDEX(p_shape, shapes[p_owner].shapes.size());
+
+ 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;
+ }
+ }
+ }
- String name = p_name;
+ total_subshapes--;
+}
- if (name.begins_with("shapes/")) {
+void CollisionObject2D::shape_owner_clear_shapes(uint32_t p_owner) {
- 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(!shapes.has(p_owner));
- return true;
+ while (shape_owner_get_shape_count(p_owner) > 0) {
+ shape_owner_remove_shape(p_owner, 0);
+ }
}
-void CollisionObject2D::_get_property_list(List<PropertyInfo> *p_list) const {
+uint32_t CollisionObject2D::shape_find_owner(int p_shape_index) const {
- //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_INDEX_V(p_shape_index, total_subshapes, 0);
- 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));
+ 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) {
@@ -216,16 +319,6 @@ 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);
@@ -242,100 +335,13 @@ 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) {
@@ -348,6 +354,7 @@ CollisionObject2D::CollisionObject2D(RID p_rid, bool p_area) {
CollisionObject2D::CollisionObject2D() {
//owner=
+
set_notify_transform(true);
}
diff --git a/scene/2d/collision_object_2d.h b/scene/2d/collision_object_2d.h
index 4d4611afd1..3580d3d942 100644
--- a/scene/2d/collision_object_2d.h
+++ b/scene/2d/collision_object_2d.h
@@ -35,37 +35,40 @@
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();
@@ -75,16 +78,29 @@ protected:
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);
+
+ 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 39eef89274..bd669eb4c8 100644
--- a/scene/2d/collision_polygon_2d.cpp
+++ b/scene/2d/collision_polygon_2d.cpp
@@ -35,13 +35,9 @@
#include "thirdparty/misc/triangulator.h"
-void CollisionPolygon2D::_add_to_collision_object(Object *p_obj) {
+void CollisionPolygon2D::_build_polygon() {
- if (unparenting || !can_update_body)
- return;
-
- CollisionObject2D *co = p_obj->cast_to<CollisionObject2D>();
- ERR_FAIL_COND(!co);
+ parent->shape_owner_clear_shapes(owner_id);
if (polygon.size() == 0)
return;
@@ -53,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 {
@@ -83,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() {
@@ -155,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: {
@@ -210,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;
}
}
@@ -222,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());
@@ -233,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();
@@ -251,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 {
@@ -264,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 b1a4a4822d..f0666ba9de 100644
--- a/scene/2d/collision_polygon_2d.h
+++ b/scene/2d/collision_polygon_2d.h
@@ -33,6 +33,8 @@
#include "scene/2d/node_2d.h"
#include "scene/resources/shape_2d.h"
+class CollisionObject2D;
+
class CollisionPolygon2D : public Node2D {
GDCLASS(CollisionPolygon2D, Node2D);
@@ -47,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;
@@ -78,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 1687a898db..ff4aa245ec 100644
--- a/scene/2d/collision_shape_2d.cpp
+++ b/scene/2d/collision_shape_2d.cpp
@@ -37,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: {
@@ -121,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;
}
}
@@ -140,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");
@@ -164,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 3e63981010..1f2b96b91f 100644
--- a/scene/2d/collision_shape_2d.h
+++ b/scene/2d/collision_shape_2d.h
@@ -33,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/light_2d.cpp b/scene/2d/light_2d.cpp
index 34413074c1..e8c2122bd1 100644
--- a/scene/2d/light_2d.cpp
+++ b/scene/2d/light_2d.cpp
@@ -336,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);
@@ -389,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);
@@ -420,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);
@@ -449,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 9b09d54dd8..90e55aeda4 100644
--- a/scene/2d/light_2d.h
+++ b/scene/2d/light_2d.h
@@ -69,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;
@@ -146,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/line_2d.cpp b/scene/2d/line_2d.cpp
index 80969d11b3..5438557d0b 100644
--- a/scene/2d/line_2d.cpp
+++ b/scene/2d/line_2d.cpp
@@ -310,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_builder.cpp b/scene/2d/line_builder.cpp
index add476ae0f..3c1410edbb 100644
--- a/scene/2d/line_builder.cpp
+++ b/scene/2d/line_builder.cpp
@@ -83,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));
}
//----------------------------------------------------------------------------
@@ -337,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)
@@ -498,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);
@@ -525,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/node_2d.cpp b/scene/2d/node_2d.cpp
index ec286b1d54..bd6ab99801 100644
--- a/scene/2d/node_2d.cpp
+++ b/scene/2d/node_2d.cpp
@@ -76,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);
@@ -87,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);
@@ -319,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);
}
diff --git a/scene/2d/particles_2d.cpp b/scene/2d/particles_2d.cpp
index 951861256e..aa9258c7b4 100644
--- a/scene/2d/particles_2d.cpp
+++ b/scene/2d/particles_2d.cpp
@@ -28,903 +28,246 @@
/* 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;
- }
+#include "scene/3d/particles.h"
+#include "scene/scene_string_names.h"
- } break;
- case NOTIFICATION_EXIT_TREE: {
- if (owner) {
- _set_owner(NULL);
- }
+void Particles2D::set_emitting(bool p_emitting) {
- } break;
- }
+ emitting = p_emitting;
+ VS::get_singleton()->particles_set_emitting(particles, emitting);
}
-void ParticleAttractor2D::_owner_exited() {
+void Particles2D::set_amount(int p_amount) {
- ERR_FAIL_COND(!owner);
- owner->attractors.erase(this);
- owner = NULL;
+ 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::_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;
- }
-
- _set_owner(pn);
+ ERR_FAIL_COND(p_lifetime <= 0);
+ lifetime = p_lifetime;
+ VS::get_singleton()->particles_set_lifetime(particles, 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) {
+void Particles2D::set_one_shot(bool p_enable) {
- owner->connect("tree_exited", this, "_owner_exited", varray(), CONNECT_ONESHOT);
- owner->attractors.insert(this);
- }
+ one_shot = p_enable;
+ VS::get_singleton()->particles_set_one_shot(particles, one_shot);
}
+void Particles2D::set_pre_process_time(float p_time) {
-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);
-
- 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");
+ 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) {
-void ParticleAttractor2D::set_enabled(bool p_enabled) {
-
- enabled = p_enabled;
+ explosiveness_ratio = p_ratio;
+ VS::get_singleton()->particles_set_explosiveness_ratio(particles, explosiveness_ratio);
}
+void Particles2D::set_randomness_ratio(float p_ratio) {
-bool ParticleAttractor2D::is_enabled() const {
-
- return enabled;
+ randomness_ratio = p_ratio;
+ VS::get_singleton()->particles_set_randomness_ratio(particles, randomness_ratio);
}
+void Particles2D::set_visibility_rect(const Rect2 &p_aabb) {
-void ParticleAttractor2D::set_radius(float p_radius) {
-
- radius = p_radius;
- update();
-}
+ 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;
-float ParticleAttractor2D::get_radius() const {
+ VS::get_singleton()->particles_set_custom_aabb(particles, aabb);
- return radius;
-}
-
-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) {
+void Particles2D::set_use_local_coordinates(bool p_enable) {
- 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;
-}
-
-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() {
+void Particles2D::_update_particle_emission_transform() {
- owner = NULL;
- radius = 50;
- disable_radius = 0;
- gravity = 100;
- absorption = 0;
- path = String("..");
- enabled = true;
-}
-
-/****************************************/
+ 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));
-_FORCE_INLINE_ static float _rand_from_seed(uint64_t *seed) {
-
- 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) {
-
- 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;
+void Particles2D::set_process_material(const Ref<Material> &p_material) {
- PoolVector<Point2>::Read r;
- int emission_point_count = 0;
- if (emission_points.size()) {
-
- emission_point_count = emission_points.size();
- r = emission_points.read();
- }
-
- 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();
+ 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);
- 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();
+ update_configuration_warning();
}
-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;
+void Particles2D::set_speed_scale(float p_scale) {
- 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);
- }
- Rect2 dst_rect(Point2(), size);
- if (flip_h)
- dst_rect.size.x = -dst_rect.size.x;
- if (flip_v)
- dst_rect.size.y = -dst_rect.size.y;
-
- texture->draw_rect_region(ci, dst_rect, 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;
- }
-}
-
-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) {
-
- 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) {
+bool Particles2D::get_one_shot() const {
- time_scale = p_time_scale;
+ return one_shot;
}
-float Particles2D::get_time_scale() const {
-
- return time_scale;
-}
-
-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;
-}
-
-void Particles2D::set_param(Parameter p_param, float p_value) {
-
- ERR_FAIL_INDEX(p_param, PARAM_MAX);
- param[p_param] = p_value;
+ return pre_process_time;
}
-float Particles2D::get_param(Parameter p_param) const {
+float Particles2D::get_explosiveness_ratio() const {
- ERR_FAIL_INDEX_V(p_param, PARAM_MAX, 0);
- return param[p_param];
+ return explosiveness_ratio;
}
+float Particles2D::get_randomness_ratio() const {
-void Particles2D::set_randomness(Parameter p_param, float p_value) {
-
- ERR_FAIL_INDEX(p_param, PARAM_MAX);
- randomness[p_param] = p_value;
+ return randomness_ratio;
}
-float Particles2D::get_randomness(Parameter p_param) const {
+Rect2 Particles2D::get_visibility_rect() const {
- ERR_FAIL_INDEX_V(p_param, PARAM_MAX, 0);
- return randomness[p_param];
+ return visibility_rect;
}
+bool Particles2D::get_use_local_coordinates() const {
-void Particles2D::set_texture(const Ref<Texture> &p_texture) {
-
- texture = p_texture;
-}
-
-Ref<Texture> Particles2D::get_texture() const {
-
- return texture;
+ return local_coords;
}
+Ref<Material> Particles2D::get_process_material() const {
-void Particles2D::set_color(const Color &p_color) {
-
- default_color = p_color;
+ return process_material;
}
-Color Particles2D::get_color() const {
+float Particles2D::get_speed_scale() const {
- return default_color;
+ return speed_scale;
}
-void Particles2D::set_color_ramp(const Ref<Gradient> &p_color_ramp) {
+void Particles2D::set_draw_order(DrawOrder p_order) {
- color_ramp = p_color_ramp;
+ draw_order = p_order;
+ VS::get_singleton()->particles_set_draw_order(particles, VS::ParticlesDrawOrder(p_order));
}
-Ref<Gradient> Particles2D::get_color_ramp() const {
+Particles2D::DrawOrder Particles2D::get_draw_order() const {
- return color_ramp;
+ return draw_order;
}
-void Particles2D::set_emissor_offset(const Point2 &p_offset) {
-
- emissor_offset = p_offset;
+void Particles2D::set_fixed_fps(int p_count) {
+ fixed_fps = p_count;
+ VS::get_singleton()->particles_set_fixed_fps(particles, p_count);
}
-Point2 Particles2D::get_emissor_offset() const {
-
- return emissor_offset;
+int Particles2D::get_fixed_fps() const {
+ return fixed_fps;
}
-void Particles2D::set_use_local_space(bool p_use) {
-
- local_space = p_use;
+void Particles2D::set_fractional_delta(bool p_enable) {
+ fractional_delta = p_enable;
+ VS::get_singleton()->particles_set_fractional_delta(particles, p_enable);
}
-bool Particles2D::is_using_local_space() const {
-
- return local_space;
+bool Particles2D::get_fractional_delta() const {
+ return fractional_delta;
}
-//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<Gradient>(memnew(Gradient()));
- }
- if (color_ramp.is_valid()) {
- color_ramp->get_points().resize(p_phases);
- }
-}
+String Particles2D::get_configuration_warning() const {
-//Deprecated.
-int Particles2D::get_color_phases() const {
+ String warnings;
- if (color_ramp.is_valid()) {
- return color_ramp->get_points_count();
+ 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 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);
-}
-
-//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 {
-
- ERR_FAIL_INDEX_V(p_phase, MAX_COLOR_PHASES, 0);
- if (color_ramp.is_valid()) {
- return color_ramp->get_offset(p_phase);
- }
- return 0;
-}
-
-void Particles2D::set_emission_half_extents(const Vector2 &p_extents) {
- extents = p_extents;
+ return warnings;
}
-Vector2 Particles2D::get_emission_half_extents() const {
+Rect2 Particles2D::capture_rect() const {
- return extents;
+ 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_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 {
@@ -932,215 +275,133 @@ 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))) {
-void Particles2D::reset() {
+ draw_rect(visibility_rect, Color(0, 0.7, 0.9, 0.4), false);
+ }
+#endif
+ }
- 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: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("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_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", "texture"), &Particles2D::set_texture);
+ 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:Material"), &Particles2D::get_process_material);
+ ClassDB::bind_method(D_METHOD("get_speed_scale"), &Particles2D::get_speed_scale);
+
+ 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_texture", "texture:Texture"), &Particles2D::set_texture);
ClassDB::bind_method(D_METHOD("get_texture:Texture"), &Particles2D::get_texture);
- ClassDB::bind_method(D_METHOD("set_color", "color"), &Particles2D::set_color);
- ClassDB::bind_method(D_METHOD("get_color"), &Particles2D::get_color);
-
- ClassDB::bind_method(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_normal_map", "texture:Texture"), &Particles2D::set_normal_map);
+ ClassDB::bind_method(D_METHOD("get_normal_map:Texture"), &Particles2D::get_normal_map);
- 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("capture_rect"), &Particles2D::capture_rect);
- 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,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++) {
+ particles = VS::get_singleton()->particles_create();
- param[i] = 0;
- randomness[i] = 0;
- }
-
- 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_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 5769fdd251..23278ce746 100644
--- a/scene/2d/particles_2d.h
+++ b/scene/2d/particles_2d.h
@@ -34,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<Gradient> 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_enabled);
+ 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<Gradient> &p_texture);
- Ref<Gradient> 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/physics_body_2d.cpp b/scene/2d/physics_body_2d.cpp
index 626ea10515..8b2653f639 100644
--- a/scene/2d/physics_body_2d.cpp
+++ b/scene/2d/physics_body_2d.cpp
@@ -44,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);
@@ -79,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);
@@ -92,10 +70,6 @@ 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);
ADD_PROPERTY(PropertyInfo(Variant::INT, "layers", PROPERTY_HINT_LAYERS_2D_PHYSICS, "", 0), "_set_layers", "_get_layers"); //for backwards compat
@@ -103,20 +77,17 @@ void PhysicsBody2D::_bind_methods() {
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) {
@@ -146,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 {
@@ -162,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);
}
@@ -584,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) {
@@ -971,248 +942,105 @@ 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.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();
+ }
- 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, 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;
+
+ bool collided = move(motion, collision);
- if (is_colliding()) {
+ 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(p_floor_max_angle)) { //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(p_floor_max_angle)) { //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;
}
}
- Vector2 n = get_collision_normal();
+ Vector2 n = collision.normal;
motion = motion.slide(n);
lv = lv.slide(n);
- Variant collider = _get_collider();
- if (collider.get_type() != Variant::NIL) {
- move_and_slide_colliders.push_back(collider);
- }
+
+ colliders.push_back(collision);
} else {
break;
@@ -1226,26 +1054,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::get_floor_velocity() const {
-Vector2 KinematicBody2D::move_to(const Vector2 &p_position) {
-
- return move(p_position - get_global_position());
+ return floor_velocity;
}
bool KinematicBody2D::test_move(const Transform2D &p_from, const Vector2 &p_motion) {
@@ -1255,98 +1079,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", "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", "pixels"), &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 f706111e7e..8c8e4ebc77 100644
--- a/scene/2d/physics_body_2d.h
+++ b/scene/2d/physics_body_2d.h
@@ -38,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;
@@ -53,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);
@@ -68,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();
};
@@ -272,54 +264,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;
+ 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_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;
+ 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 cb3e67f895..5c1c953a37 100644
--- a/scene/2d/polygon_2d.cpp
+++ b/scene/2d/polygon_2d.cpp
@@ -38,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);
}
@@ -95,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) {
@@ -110,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/ray_cast_2d.cpp b/scene/2d/ray_cast_2d.cpp
index 0a1a8b56ff..cfb4059714 100644
--- a/scene/2d/ray_cast_2d.cpp
+++ b/scene/2d/ray_cast_2d.cpp
@@ -44,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) {
@@ -201,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;
@@ -274,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);
@@ -286,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");
}
@@ -296,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 cfecfa2585..244f4302ad 100644
--- a/scene/2d/ray_cast_2d.h
+++ b/scene/2d/ray_cast_2d.h
@@ -43,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;
@@ -61,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 3cb9ebb5b5..4298377499 100644
--- a/scene/2d/remote_transform_2d.cpp
+++ b/scene/2d/remote_transform_2d.cpp
@@ -63,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) {
@@ -102,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>()) {
@@ -116,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 375efabf2f..d58ec14a95 100644
--- a/scene/2d/remote_transform_2d.h
+++ b/scene/2d/remote_transform_2d.h
@@ -37,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();
@@ -48,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 f503a66208..37139b2b93 100644
--- a/scene/2d/screen_button.cpp
+++ b/scene/2d/screen_button.cpp
@@ -194,40 +194,27 @@ void TouchScreenButton::_input(const Ref<InputEvent> &p_event) {
if (p_event->get_device() != 0)
return;
+ ERR_FAIL_COND(!is_visible_in_tree());
+
+ const InputEventScreenTouch *st = p_event->cast_to<InputEventScreenTouch>();
+
if (passby_press) {
- Ref<InputEventScreenTouch> st = p_event;
- Ref<InputEventScreenTouch> sd = p_event;
+ const InputEventScreenDrag *sd = p_event->cast_to<InputEventScreenDrag>();
- if (st.is_valid() && !st->is_pressed() && finger_pressed == st->get_index()) {
+ if (st && !st->is_pressed() && finger_pressed == st->get_index()) {
_release();
}
- if ((st.is_valid() && st->is_pressed()) || sd.is_valid()) {
+ if ((st && st->is_pressed()) || sd) {
- int index = st.is_valid() ? st->get_index() : sd->get_index();
- Vector2 coord = st.is_valid() ? st->get_pos() : sd->get_pos();
+ int index = st ? st->get_index() : sd->get_index();
+ Point2 coord = st ? st->get_position() : sd->get_position();
if (finger_pressed == -1 || index == finger_pressed) {
- coord = (get_global_transform_with_canvas()).affine_inverse().xform(coord);
-
- bool touched = false;
- if (bitmask.is_valid()) {
-
- if (Rect2(Point2(), bitmask->get_size()).has_point(coord)) {
-
- if (bitmask->get_bit(coord))
- touched = true;
- }
- } else {
-
- if (texture.is_valid())
- touched = Rect2(Point2(), texture->get_size()).has_point(coord);
- }
-
- if (touched) {
+ if (_is_point_inside(coord)) {
if (finger_pressed == -1) {
_press(index);
}
@@ -241,47 +228,15 @@ void TouchScreenButton::_input(const Ref<InputEvent> &p_event) {
} else {
- Ref<InputEventScreenTouch> st = p_event;
-
- if (st.is_valid()) {
+ if (st) {
if (st->is_pressed()) {
- if (!is_visible_in_tree())
- return;
-
const bool can_press = finger_pressed == -1;
if (!can_press)
return; //already fingering
- Point2 coord = (get_global_transform_with_canvas()).affine_inverse().xform(st->get_pos());
- Rect2 item_rect = get_item_rect();
-
- bool touched = false;
- bool check_rect = true;
- if (shape.is_valid()) {
-
- check_rect = false;
- Transform2D xform = shape_centered ? Transform2D().translated(get_item_rect().size * 0.5f) : Transform2D();
- touched = shape->collide(xform, unit_rect, Transform2D(0, coord + Vector2(0.5, 0.5)));
- }
-
- if (bitmask.is_valid()) {
-
- 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_null())
- touched = item_rect.has_point(coord);
- }
-
- if (touched) {
+ if (_is_point_inside(st->get_position())) {
_press(st->get_index());
}
} else {
@@ -293,6 +248,39 @@ void TouchScreenButton::_input(const Ref<InputEvent> &p_event) {
}
}
+bool TouchScreenButton::_is_point_inside(const Point2 &p_point) {
+
+ Point2 coord = (get_global_transform_with_canvas()).affine_inverse().xform(p_point);
+ Rect2 item_rect = get_item_rect();
+
+ bool touched = false;
+ bool check_rect = true;
+
+ if (shape.is_valid()) {
+
+ check_rect = false;
+ Transform2D xform = shape_centered ? Transform2D().translated(item_rect.size * 0.5f) : Transform2D();
+ touched = shape->collide(xform, unit_rect, Transform2D(0, coord + Vector2(0.5, 0.5)));
+ }
+
+ if (bitmask.is_valid()) {
+
+ 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;
diff --git a/scene/2d/screen_button.h b/scene/2d/screen_button.h
index e44f556c31..8923da2ae4 100644
--- a/scene/2d/screen_button.h
+++ b/scene/2d/screen_button.h
@@ -63,6 +63,8 @@ private:
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);
diff --git a/scene/2d/sprite.cpp b/scene/2d/sprite.cpp
index 1735bf3b91..450f8e2474 100644
--- a/scene/2d/sprite.cpp
+++ b/scene/2d/sprite.cpp
@@ -65,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;
@@ -93,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;
}
@@ -109,17 +111,30 @@ void Sprite::set_texture(const Ref<Texture> &p_texture) {
}
#endif
texture = p_texture;
+ /* this should no longer be needed in 3.0
#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();
}
+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 {
return texture;
@@ -201,6 +216,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);
@@ -289,6 +313,9 @@ 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_normal_map", "normal_map:Texture"), &Sprite::set_normal_map);
+ ClassDB::bind_method(D_METHOD("get_normal_map:Texture"), &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);
@@ -307,6 +334,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);
@@ -320,15 +350,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() {
@@ -337,6 +373,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 86ef335d42..d3f9a5f032 100644
--- a/scene/2d/sprite.h
+++ b/scene/2d/sprite.h
@@ -38,6 +38,7 @@ class Sprite : public Node2D {
GDCLASS(Sprite, Node2D);
Ref<Texture> texture;
+ Ref<Texture> normal_map;
bool centered;
Point2 offset;
@@ -46,6 +47,7 @@ class Sprite : public Node2D {
bool vflip;
bool region;
Rect2 region_rect;
+ bool region_filter_clip;
int frame;
@@ -67,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;
@@ -82,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 080276eb25..9d70b75027 100644
--- a/scene/2d/tile_map.cpp
+++ b/scene/2d/tile_map.cpp
@@ -29,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"
@@ -370,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) {
@@ -406,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++;
}
}
@@ -549,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()));
@@ -587,7 +590,7 @@ Map<TileMap::PosKey, TileMap::Quadrant>::Element *TileMap::_create_quadrant(cons
//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_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);
@@ -863,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);
}
}
@@ -1286,7 +1289,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/3d/area.cpp b/scene/3d/area.cpp
index 8dae078e5b..c62a866d8d 100644
--- a/scene/3d/area.cpp
+++ b/scene/3d/area.cpp
@@ -227,7 +227,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;
@@ -253,7 +257,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;
@@ -489,15 +497,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) {
@@ -515,19 +523,19 @@ 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_layer_mask_bit(int p_bit) const {
+bool Area::get_collision_layer_bit(int p_bit) const {
- return get_layer_mask() & (1 << p_bit);
+ return get_collision_layer() & (1 << p_bit);
}
void Area::_bind_methods() {
@@ -565,14 +573,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);
@@ -610,7 +618,7 @@ 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");
}
@@ -628,7 +636,7 @@ 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);
diff --git a/scene/3d/area.h b/scene/3d/area.h
index 64bbae9236..279a52ee69 100644
--- a/scene/3d/area.h
+++ b/scene/3d/area.h
@@ -55,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;
@@ -164,14 +164,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
diff --git a/scene/3d/camera.cpp b/scene/3d/camera.cpp
index d648ff078c..0f4378acdd 100644
--- a/scene/3d/camera.cpp
+++ b/scene/3d/camera.cpp
@@ -626,7 +626,7 @@ 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;
diff --git a/scene/3d/collision_polygon.cpp b/scene/3d/collision_polygon.cpp
index a9a693f370..d9321f7134 100644
--- a/scene/3d/collision_polygon.cpp
+++ b/scene/3d/collision_polygon.cpp
@@ -208,7 +208,7 @@ void CollisionPolygon::set_polygon(const Vector<Point2> &p_polygon) {
aabb = Rect3(Vector3(-1, -1, -1), Vector3(2, 2, 2));
} else {
- aabb.pos -= aabb.size * 0.3;
+ aabb.position -= aabb.size * 0.3;
aabb.size += aabb.size * 0.6;
}
_update_parent();
diff --git a/scene/3d/gi_probe.cpp b/scene/3d/gi_probe.cpp
index 96311236ef..adca1492c3 100644
--- a/scene/3d/gi_probe.cpp
+++ b/scene/3d/gi_probe.cpp
@@ -564,7 +564,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;
@@ -619,7 +619,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);
@@ -700,15 +700,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
@@ -720,7 +720,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;
@@ -885,7 +885,7 @@ Vector<Color> GIProbe::_get_bake_texture(Ref<Image> p_image, const Color &p_colo
Vector<Color> ret;
- if (p_image.is_null()) {
+ 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++) {
@@ -894,9 +894,11 @@ Vector<Color> GIProbe::_get_bake_texture(Ref<Image> p_image, const Color &p_colo
return ret;
}
+ p_image = p_image->duplicate();
if (p_image->is_compressed()) {
print_line("DECOMPRESSING!!!!");
+
p_image->decompress();
}
p_image->convert(Image::FORMAT_RGBA8);
@@ -907,10 +909,11 @@ Vector<Color> GIProbe::_get_bake_texture(Ref<Image> p_image, const Color &p_colo
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;
}
@@ -970,7 +973,7 @@ GIProbe::Baker::MaterialCache GIProbe::_get_material_cache(Ref<Material> p_mater
return mc;
}
-void GIProbe::_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) {
+void GIProbe::_plot_mesh(const Transform &p_xform, Ref<ArrayMesh> &p_mesh, Baker *p_baker, const Vector<Ref<Material> > &p_materials, const Ref<Material> &p_override_material) {
for (int i = 0; i < p_mesh->get_surface_count(); i++) {
@@ -1064,7 +1067,7 @@ void GIProbe::_find_meshes(Node *p_at_node, Baker *p_baker) {
MeshInstance *mi = p_at_node->cast_to<MeshInstance>();
if (mi && mi->get_flag(GeometryInstance::FLAG_USE_BAKED_LIGHT)) {
- Ref<Mesh> mesh = mi->get_mesh();
+ Ref<ArrayMesh> mesh = mi->get_mesh();
if (mesh.is_valid()) {
Rect3 aabb = mesh->get_aabb();
@@ -1091,7 +1094,7 @@ void GIProbe::_find_meshes(Node *p_at_node, Baker *p_baker) {
for (int i = 0; i < meshes.size(); i += 2) {
Transform mxf = meshes[i];
- Ref<Mesh> mesh = meshes[i + 1];
+ Ref<ArrayMesh> mesh = meshes[i + 1];
if (!mesh.is_valid())
continue;
@@ -1152,7 +1155,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]));
@@ -1271,12 +1274,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++;
@@ -1292,11 +1296,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);
}
@@ -1313,7 +1317,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();
{
@@ -1464,7 +1468,7 @@ GIProbe::GIProbe() {
subdiv = SUBDIV_128;
dynamic_range = 4;
energy = 1.0;
- bias = 0.4;
+ bias = 1.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 3b05d9952b..b5ee86455e 100644
--- a/scene/3d/gi_probe.h
+++ b/scene/3d/gi_probe.h
@@ -145,7 +145,7 @@ private:
struct PlotMesh {
Ref<Material> override_material;
Vector<Ref<Material> > instance_materials;
- Ref<Mesh> mesh;
+ Ref<ArrayMesh> mesh;
Transform local_xform;
};
@@ -173,7 +173,7 @@ private:
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);
+ void _plot_mesh(const Transform &p_xform, Ref<ArrayMesh> &p_mesh, Baker *p_baker, const Vector<Ref<Material> > &p_materials, const Ref<Material> &p_override_material);
void _find_meshes(Node *p_at_node, Baker *p_baker);
void _fixup_plot(int p_idx, int p_level, int p_x, int p_y, int p_z, Baker *p_baker);
diff --git a/scene/3d/immediate_geometry.cpp b/scene/3d/immediate_geometry.cpp
index 8c1ad1d052..128c8b44c3 100644
--- a/scene/3d/immediate_geometry.cpp
+++ b/scene/3d/immediate_geometry.cpp
@@ -65,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 {
diff --git a/scene/3d/light.cpp b/scene/3d/light.cpp
index 6ab65d3994..9c87acec6e 100644
--- a/scene/3d/light.cpp
+++ b/scene/3d/light.cpp
@@ -234,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,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() {
@@ -318,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);
@@ -328,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;
}
@@ -371,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 c02f9d12d3..22ff5c0763 100644
--- a/scene/3d/light.h
+++ b/scene/3d/light.h
@@ -60,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
};
diff --git a/scene/3d/listener.cpp b/scene/3d/listener.cpp
index 148afbffa2..c7d3bac2f8 100644
--- a/scene/3d/listener.cpp
+++ b/scene/3d/listener.cpp
@@ -152,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/mesh_instance.cpp b/scene/3d/mesh_instance.cpp
index 5b5bce342d..62e1a95209 100644
--- a/scene/3d/mesh_instance.cpp
+++ b/scene/3d/mesh_instance.cpp
@@ -32,6 +32,7 @@
#include "body_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) {
@@ -98,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"));
}
}
}
@@ -274,6 +275,81 @@ void MeshInstance::_mesh_changed() {
materials.resize(mesh->get_surface_count());
}
+void MeshInstance::create_debug_tagents() {
+
+ 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);
@@ -281,12 +357,18 @@ void MeshInstance::_bind_methods() {
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_surface_material", "surface", "material:Material"), &MeshInstance::set_surface_material);
+ ClassDB::bind_method(D_METHOD("get_surface_material: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);
ClassDB::bind_method(D_METHOD("create_convex_collision"), &MeshInstance::create_convex_collision);
ClassDB::set_method_flags("MeshInstance", "create_convex_collision", METHOD_FLAGS_DEFAULT);
ClassDB::bind_method(D_METHOD("_mesh_changed"), &MeshInstance::_mesh_changed);
+ ClassDB::bind_method(D_METHOD("create_debug_tagents"), &MeshInstance::create_debug_tagents);
+ ClassDB::set_method_flags("MeshInstance", "create_debug_tagents", 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 c11c52b76d..be328084af 100644
--- a/scene/3d/mesh_instance.h
+++ b/scene/3d/mesh_instance.h
@@ -83,6 +83,8 @@ public:
Node *create_convex_collision_node();
void create_convex_collision();
+ void create_debug_tagents();
+
virtual Rect3 get_aabb() const;
virtual PoolVector<Face3> get_faces(uint32_t p_usage_flags) const;
diff --git a/scene/3d/navigation_mesh.cpp b/scene/3d/navigation_mesh.cpp
index 13fd852fe7..4c93bcfb5e 100644
--- a/scene/3d/navigation_mesh.cpp
+++ b/scene/3d/navigation_mesh.cpp
@@ -149,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);
@@ -187,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);
diff --git a/scene/3d/navigation_mesh.h b/scene/3d/navigation_mesh.h
index c8f6d936aa..e5a3dc7b43 100644
--- a/scene/3d/navigation_mesh.h
+++ b/scene/3d/navigation_mesh.h
@@ -44,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 71079ea780..c8f45a8d7e 100644
--- a/scene/3d/particles.cpp
+++ b/scene/3d/particles.cpp
@@ -58,6 +58,13 @@ void Particles::set_lifetime(float p_lifetime) {
lifetime = p_lifetime;
VS::get_singleton()->particles_set_lifetime(particles, lifetime);
}
+
+void Particles::set_one_shot(bool p_one_shot) {
+
+ one_shot = p_one_shot;
+ VS::get_singleton()->particles_set_one_shot(particles, one_shot);
+}
+
void Particles::set_pre_process_time(float p_time) {
pre_process_time = p_time;
@@ -114,6 +121,11 @@ float Particles::get_lifetime() const {
return lifetime;
}
+bool Particles::get_one_shot() const {
+
+ return one_shot;
+}
+
float Particles::get_pre_process_time() const {
return pre_process_time;
@@ -233,6 +245,11 @@ String Particles::get_configuration_warning() const {
return warnings;
}
+void Particles::restart() {
+
+ VisualServer::get_singleton()->particles_restart(particles);
+}
+
Rect3 Particles::capture_aabb() const {
return VS::get_singleton()->particles_get_current_aabb(particles);
@@ -254,6 +271,7 @@ 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);
@@ -267,6 +285,7 @@ void Particles::_bind_methods() {
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);
@@ -287,23 +306,26 @@ void Particles::_bind_methods() {
ClassDB::bind_method(D_METHOD("get_draw_passes"), &Particles::get_draw_passes);
ClassDB::bind_method(D_METHOD("get_draw_pass_mesh: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_GROUP("Parameters", "");
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::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, "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, "ParticlesMaterial,ShaderMaterial"), "set_process_material", "get_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++) {
@@ -322,6 +344,7 @@ 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);
@@ -404,6 +427,7 @@ void ParticlesMaterial::init_shaders() {
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";
@@ -481,6 +505,28 @@ void ParticlesMaterial::_update_shader() {
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";
@@ -515,25 +561,6 @@ void ParticlesMaterial::_update_shader() {
if (tex_parameters[PARAM_ANIM_OFFSET].is_valid())
code += "uniform sampler2D anim_offset_texture;\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";
- } break;
- }
-
if (trail_size_modifier.is_valid()) {
code += "uniform sampler2D trail_size_modifier;\n";
}
@@ -567,7 +594,7 @@ void ParticlesMaterial::_update_shader() {
code += "\n";
code += " uint base_number=NUMBER/uint(trail_divisor);\n";
- code += " uint alt_seed=hash(base_number+uint(1));\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";
@@ -576,6 +603,11 @@ void ParticlesMaterial::_update_shader() {
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())
@@ -593,11 +625,21 @@ void ParticlesMaterial::_update_shader() {
else
code += " float tex_anim_offset = 0.0;\n";
- 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";
+ 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
@@ -614,21 +656,31 @@ void ParticlesMaterial::_update_shader() {
} break;
case EMISSION_SHAPE_POINTS:
case EMISSION_SHAPE_DIRECTED_POINTS: {
- code += " int point = min(emission_texture_point_count-1,int(rand_from_seed(alt_seed) * float(emission_texture_point_count)));\n";
- code += " ivec2 tex_size = textureSize( emission_texture_points, 0 );\n";
- code += " ivec2 tex_ofs = ivec2( point % tex_size.x, point / tex_size.x );\n";
- code += " TRANSFORM[3].xyz = texelFetch(emission_texture_points, tex_ofs,0).xyz;\n";
+ code += " TRANSFORM[3].xyz = texelFetch(emission_texture_points, emission_tex_ofs,0).xyz;\n";
+
if (emission_shape == EMISSION_SHAPE_DIRECTED_POINTS) {
- code += " vec3 normal = texelFetch(emission_texture_normal, 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";
+ 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";
@@ -685,6 +737,9 @@ void ParticlesMaterial::_update_shader() {
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+=normalize(VELOCITY) * (linear_accel+tex_linear_accel)*mix(1.0,rand_from_seed(alt_seed),linear_accel_random);\n";
code += " //apply radial acceleration\n";
@@ -693,11 +748,17 @@ void ParticlesMaterial::_update_shader() {
code += " //org=p_transform.origin;\n";
code += " force+=normalize(pos-org) * (radial_accel+tex_radial_accel)*mix(1.0,rand_from_seed(alt_seed),radial_accel_random);\n";
code += " //apply tangential acceleration;\n";
- code += " force+=normalize(cross(normalize(pos-org),normalize(gravity))) * ((tangent_accel+tex_tangent_accel)*mix(1.0,rand_from_seed(alt_seed),radial_accel_random));\n";
+ if (flags[FLAG_DISABLE_Z]) {
+ code += " force+=vec3(normalize((pos-org).yx * vec2(-1.0,1.0)),0.0) * ((tangent_accel+tex_tangent_accel)*mix(1.0,rand_from_seed(alt_seed),radial_accel_random));\n";
+
+ } else {
+ code += " force+=normalize(cross(normalize(pos-org),normalize(gravity))) * ((tangent_accel+tex_tangent_accel)*mix(1.0,rand_from_seed(alt_seed),radial_accel_random));\n";
+ }
code += " //apply attractor forces\n";
code += " VELOCITY+=force * DELTA;\n";
- if (tex_parameters[PARAM_INITIAL_LINEAR_VELOCITY].is_valid())
+ 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";
@@ -709,9 +770,16 @@ void ParticlesMaterial::_update_shader() {
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)*3.1416/180.0;\n";
- code += " CUSTOM.x=((base_angle+tex_angle)+CUSTOM.y*LIFETIME*(angular_velocity+tex_angular_velocity)*mix(1.0,rand_from_seed(alt_seed)*2.0-1.0,angular_velocity_random))*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*LIFETIME*(anim_speed+tex_anim_speed)*mix(1.0,rand_from_seed(alt_seed),anim_speed_random);\n"; //angle
+ 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
@@ -747,28 +815,40 @@ void ParticlesMaterial::_update_shader() {
} 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";
- //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";
+
+ 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 {
- 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";
+ //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";
@@ -779,6 +859,10 @@ void ParticlesMaterial::_update_shader() {
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";
@@ -968,16 +1052,11 @@ float ParticlesMaterial::get_param_randomness(Parameter p_param) const {
static void _adjust_curve_range(const Ref<Texture> &p_texture, float p_min, float p_max) {
- Ref<CurveTexture> curve = p_texture;
- if (!curve.is_valid())
+ Ref<CurveTexture> curve_tex = p_texture;
+ if (!curve_tex.is_valid())
return;
- if (curve->get_max() == 1.0) {
- curve->set_max(p_max);
- }
- if (curve->get_min() == 0.0) {
- curve->set_min(p_min);
- }
+ curve_tex->ensure_default_setup(p_min, p_max);
}
void ParticlesMaterial::set_param_texture(Parameter p_param, const Ref<Texture> &p_texture) {
@@ -1021,16 +1100,9 @@ void ParticlesMaterial::set_param_texture(Parameter p_param, const Ref<Texture>
case PARAM_SCALE: {
VisualServer::get_singleton()->material_set_param(_get_material(), shader_names->scale_texture, p_texture);
- Ref<CurveTexture> curve = p_texture;
- if (curve.is_valid()) {
- if (curve->get_min() == 0 && curve->get_max() == 1) {
-
- curve->set_max(32);
- PoolVector<Vector2> points;
- points.push_back(Vector2(0, 1));
- points.push_back(Vector2(1, 1));
- curve->set_points(points);
- }
+ Ref<CurveTexture> curve_tex = p_texture;
+ if (curve_tex.is_valid()) {
+ curve_tex->ensure_default_setup();
}
} break;
@@ -1130,6 +1202,16 @@ void ParticlesMaterial::set_emission_normal_texture(const Ref<Texture> &p_normal
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;
@@ -1158,6 +1240,11 @@ Ref<Texture> ParticlesMaterial::get_emission_normal_texture() const {
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;
@@ -1181,14 +1268,7 @@ void ParticlesMaterial::set_trail_size_modifier(const Ref<CurveTexture> &p_trail
Ref<CurveTexture> curve = trail_size_modifier;
if (curve.is_valid()) {
- if (curve->get_min() == 0 && curve->get_max() == 1) {
-
- curve->set_max(32);
- PoolVector<Vector2> points;
- points.push_back(Vector2(0, 1));
- points.push_back(Vector2(1, 1));
- curve->set_points(points);
- }
+ curve->ensure_default_setup();
}
RID texture;
@@ -1247,7 +1327,7 @@ void ParticlesMaterial::_validate_property(PropertyInfo &property) const {
property.usage = 0;
}
- if (property.name == "emission_point_texture" && (emission_shape != EMISSION_SHAPE_POINTS && emission_shape != EMISSION_SHAPE_DIRECTED_POINTS)) {
+ if ((property.name == "emission_point_texture" || property.name == "emission_color_texture") && (emission_shape < EMISSION_SHAPE_POINTS)) {
property.usage = 0;
}
@@ -1301,6 +1381,9 @@ void ParticlesMaterial::_bind_methods() {
ClassDB::bind_method(D_METHOD("set_emission_normal_texture", "texture:Texture"), &ParticlesMaterial::set_emission_normal_texture);
ClassDB::bind_method(D_METHOD("get_emission_normal_texture:Texture"), &ParticlesMaterial::get_emission_normal_texture);
+ ClassDB::bind_method(D_METHOD("set_emission_color_texture", "texture:Texture"), &ParticlesMaterial::set_emission_color_texture);
+ ClassDB::bind_method(D_METHOD("get_emission_color_texture: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);
@@ -1326,10 +1409,12 @@ void ParticlesMaterial::_bind_methods() {
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");
@@ -1379,12 +1464,13 @@ void ParticlesMaterial::_bind_methods() {
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,1,0.01"), "set_param", "get_param", PARAM_ANIM_SPEED);
+ 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);
diff --git a/scene/3d/particles.h b/scene/3d/particles.h
index 63ebd7ed7b..0549eb4c09 100644
--- a/scene/3d/particles.h
+++ b/scene/3d/particles.h
@@ -58,6 +58,7 @@ private:
RID particles;
bool emitting;
+ bool one_shot;
int amount;
float lifetime;
float pre_process_time;
@@ -86,6 +87,7 @@ public:
void set_emitting(bool p_emitting);
void set_amount(int p_amount);
void set_lifetime(float p_lifetime);
+ void set_one_shot(bool p_enabled);
void set_pre_process_time(float p_time);
void set_explosiveness_ratio(float p_ratio);
void set_randomness_ratio(float p_ratio);
@@ -97,6 +99,7 @@ public:
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;
@@ -122,6 +125,8 @@ public:
virtual String get_configuration_warning() const;
+ void restart();
+
Rect3 capture_aabb() const;
Particles();
~Particles();
@@ -154,6 +159,8 @@ public:
enum Flags {
FLAG_ALIGN_Y_TO_VELOCITY,
FLAG_ROTATE_Y,
+ FLAG_DISABLE_Z,
+ FLAG_ANIM_LOOP,
FLAG_MAX
};
@@ -171,11 +178,12 @@ private:
struct {
uint32_t texture_mask : 16;
uint32_t texture_color : 1;
- uint32_t flags : 2;
+ 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;
@@ -213,6 +221,7 @@ private:
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;
}
@@ -269,6 +278,7 @@ private:
StringName emission_texture_point_count;
StringName emission_texture_points;
StringName emission_texture_normal;
+ StringName emission_texture_color;
StringName trail_divisor;
StringName trail_size_modifier;
@@ -302,8 +312,11 @@ private:
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;
@@ -347,6 +360,7 @@ public:
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;
@@ -354,6 +368,7 @@ public:
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);
diff --git a/scene/3d/path.cpp b/scene/3d/path.cpp
index d535c545a8..5c29918118 100644
--- a/scene/3d/path.cpp
+++ b/scene/3d/path.cpp
@@ -108,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/physics_body.cpp b/scene/3d/physics_body.cpp
index 98babedf0d..718daab75a 100644
--- a/scene/3d/physics_body.cpp
+++ b/scene/3d/physics_body.cpp
@@ -28,7 +28,7 @@
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
#include "physics_body.h"
-#include "method_bind_ext.inc"
+#include "method_bind_ext.gen.inc"
#include "scene/scene_string_names.h"
void PhysicsBody::_notification(int p_what) {
@@ -59,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) {
@@ -167,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;
}
@@ -520,11 +520,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) {
diff --git a/scene/3d/physics_body.h b/scene/3d/physics_body.h
index d13f84dc15..db4147f8f6 100644
--- a/scene/3d/physics_body.h
+++ b/scene/3d/physics_body.h
@@ -38,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);
@@ -54,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);
diff --git a/scene/3d/quad.cpp b/scene/3d/quad.cpp
deleted file mode 100644
index c3d83ad50d..0000000000
--- a/scene/3d/quad.cpp
+++ /dev/null
@@ -1,226 +0,0 @@
-/*************************************************************************/
-/* quad.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 "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/quad.h b/scene/3d/quad.h
deleted file mode 100644
index bb6c1219ad..0000000000
--- a/scene/3d/quad.h
+++ /dev/null
@@ -1,76 +0,0 @@
-/*************************************************************************/
-/* quad.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 QUAD_H
-#define QUAD_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();
-
-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();
-};
-
-#endif // QUAD_H
diff --git a/scene/3d/ray_cast.cpp b/scene/3d/ray_cast.cpp
index d24aa6ae2a..67e7fb0e12 100644
--- a/scene/3d/ray_cast.cpp
+++ b/scene/3d/ray_cast.cpp
@@ -46,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) {
@@ -170,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;
@@ -243,15 +243,15 @@ 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");
}
@@ -266,7 +266,7 @@ void RayCast::_create_debug_shape() {
line_material->set_albedo(Color(1.0, 0.8, 0.6));
}
- Ref<Mesh> mesh = memnew(Mesh);
+ Ref<ArrayMesh> mesh = memnew(ArrayMesh);
MeshInstance *mi = memnew(MeshInstance);
mi->set_mesh(mesh);
@@ -287,7 +287,7 @@ void RayCast::_update_debug_shape() {
if (!mi->get_mesh().is_valid())
return;
- Ref<Mesh> mesh = mi->get_mesh();
+ Ref<ArrayMesh> mesh = mi->get_mesh();
if (mesh->get_surface_count() > 0)
mesh->surface_remove(0);
@@ -323,7 +323,7 @@ RayCast::RayCast() {
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 63a53d724f..e9b34c4f75 100644
--- a/scene/3d/ray_cast.h
+++ b/scene/3d/ray_cast.h
@@ -47,7 +47,7 @@ class RayCast : public Spatial {
Set<RID> exclude;
- uint32_t layer_mask;
+ uint32_t collision_layer;
uint32_t type_mask;
Node *debug_shape;
@@ -69,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 845245b090..86a62bec97 100644
--- a/scene/3d/reflection_probe.cpp
+++ b/scene/3d/reflection_probe.cpp
@@ -181,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/remote_transform.cpp b/scene/3d/remote_transform.cpp
index b36f444bea..4dcfb5f94e 100644
--- a/scene/3d/remote_transform.cpp
+++ b/scene/3d/remote_transform.cpp
@@ -63,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) {
@@ -102,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>()) {
@@ -116,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 9fa3011185..c25b57966e 100644
--- a/scene/3d/remote_transform.h
+++ b/scene/3d/remote_transform.h
@@ -39,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();
@@ -50,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/scenario_fx.cpp b/scene/3d/scenario_fx.cpp
index 874c21546d..abc7766ecb 100644
--- a/scene/3d/scenario_fx.cpp
+++ b/scene/3d/scenario_fx.cpp
@@ -28,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();
@@ -77,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).");
diff --git a/scene/3d/scenario_fx.h b/scene/3d/scenario_fx.h
index b2a4bc5472..d1e0a63130 100644
--- a/scene/3d/scenario_fx.h
+++ b/scene/3d/scenario_fx.h
@@ -36,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/spatial.cpp b/scene/3d/spatial.cpp
index 3debbf02c3..20c2cc1eb5 100644
--- a/scene/3d/spatial.cpp
+++ b/scene/3d/spatial.cpp
@@ -541,10 +541,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() {
@@ -552,14 +549,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;
diff --git a/scene/3d/spatial.h b/scene/3d/spatial.h
index 764950aa8e..d114a6231b 100644
--- a/scene/3d/spatial.h
+++ b/scene/3d/spatial.h
@@ -31,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>
diff --git a/scene/3d/sprite_3d.cpp b/scene/3d/sprite_3d.cpp
index e97b22f9e0..78e8e92afc 100644
--- a/scene/3d/sprite_3d.cpp
+++ b/scene/3d/sprite_3d.cpp
@@ -273,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);
@@ -294,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;
@@ -335,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();
@@ -360,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()) {
@@ -387,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 = VS::get_singleton()->material_2d_get(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());
@@ -421,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);
@@ -579,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"));
@@ -861,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()) {
@@ -888,7 +892,7 @@ 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 = VS::get_singleton()->material_2d_get(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());
@@ -922,7 +926,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);
diff --git a/scene/3d/sprite_3d.h b/scene/3d/sprite_3d.h
index 625b37c32e..b4600c00b8 100644
--- a/scene/3d/sprite_3d.h
+++ b/scene/3d/sprite_3d.h
@@ -41,6 +41,7 @@ public:
enum DrawFlags {
FLAG_TRANSPARENT,
FLAG_SHADED,
+ FLAG_DOUBLE_SIDED,
FLAG_MAX
};
diff --git a/scene/3d/visual_instance.cpp b/scene/3d/visual_instance.cpp
index 104fa0f70f..6f8c38eddd 100644
--- a/scene/3d/visual_instance.cpp
+++ b/scene/3d/visual_instance.cpp
@@ -316,7 +316,7 @@ 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, "visible_in_all_rooms"), "set_flag", "get_flag", FLAG_VISIBLE_IN_ALL_ROOMS);
diff --git a/scene/animation/animation_player.cpp b/scene/animation/animation_player.cpp
index c4ea42d461..543b64bd15 100644
--- a/scene/animation/animation_player.cpp
+++ b/scene/animation/animation_player.cpp
@@ -202,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: {
diff --git a/scene/animation/tween.cpp b/scene/animation/tween.cpp
index 2a6ffb5628..ad0b0fbfb2 100644
--- a/scene/animation/tween.cpp
+++ b/scene/animation/tween.cpp
@@ -28,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) {
@@ -421,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);
@@ -963,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;
diff --git a/scene/audio/audio_player.cpp b/scene/audio/audio_player.cpp
index ad72a512d8..bcca834642 100644
--- a/scene/audio/audio_player.cpp
+++ b/scene/audio/audio_player.cpp
@@ -29,7 +29,7 @@
/*************************************************************************/
#include "audio_player.h"
-void AudioPlayer::_mix_audio() {
+void AudioStreamPlayer::_mix_audio() {
if (!stream_playback.is_valid()) {
return;
@@ -95,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) {
@@ -111,7 +111,7 @@ 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();
@@ -136,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
@@ -159,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();
@@ -182,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();
@@ -191,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) {
@@ -208,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") {
@@ -255,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:AudioStream"), &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");
@@ -297,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;
@@ -309,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 5a8a8494e1..8bd6844dec 100644
--- a/scene/audio/audio_player.h
+++ b/scene/audio/audio_player.h
@@ -33,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 {
@@ -60,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;
@@ -94,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 318db8458b..c1dbc82f3c 100644
--- a/scene/gui/base_button.cpp
+++ b/scene/gui/base_button.cpp
@@ -162,7 +162,7 @@ void BaseButton::_gui_input(Ref<InputEvent> p_event) {
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_pos());
+ status.pressing_inside = has_point(mm->get_position());
if (last_press_inside != status.pressing_inside)
update();
}
diff --git a/scene/gui/button_array.cpp b/scene/gui/button_array.cpp
deleted file mode 100644
index 0d518059c8..0000000000
--- a/scene/gui/button_array.cpp
+++ /dev/null
@@ -1,546 +0,0 @@
-/*************************************************************************/
-/* button_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 "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 Ref<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;
- }
-
- Ref<InputEventMouseButton> mb = p_event;
-
- if (mb.is_valid() && mb->is_pressed() && mb->get_button_index() == BUTTON_LEFT) {
-
- int ofs = orientation == HORIZONTAL ? mb->get_pos().x : mb->get_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) {
-
- set_selected(i);
- emit_signal("button_selected", i);
- return;
- }
- }
- }
-
- Ref<InputEventMouseMotion> mm = p_event;
-
- if (mm.is_valid()) {
-
- int ofs = orientation == HORIZONTAL ? mm->get_pos().x : mm->get_pos().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 0ebf681cb6..0000000000
--- a/scene/gui/button_array.h
+++ /dev/null
@@ -1,131 +0,0 @@
-/*************************************************************************/
-/* button_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 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 Ref<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/color_picker.cpp b/scene/gui/color_picker.cpp
index 662ce63946..9ef340edbc 100644
--- a/scene/gui/color_picker.cpp
+++ b/scene/gui/color_picker.cpp
@@ -48,7 +48,15 @@ void ColorPicker::_notification(int p_what) {
btn_pick->set_icon(get_icon("screen_picker", "ColorPicker"));
_update_color();
- }
+ } break;
+
+ case MainLoop::NOTIFICATION_WM_QUIT_REQUEST: {
+ if (screen != NULL) {
+ if (screen->is_visible()) {
+ screen->hide();
+ }
+ }
+ } break;
}
}
@@ -84,9 +92,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();
}
@@ -117,9 +122,6 @@ void ColorPicker::_value_changed(double) {
}
set_pick_color(color);
-
- _update_text_value();
-
emit_signal("color_changed", color);
}
@@ -156,6 +158,8 @@ void ColorPicker::_update_color() {
_update_text_value();
sample->update();
+ uv_edit->update();
+ w_edit->update();
updating = false;
}
@@ -250,7 +254,7 @@ 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, 20)), color);
}
void ColorPicker::_hsv_draw(int p_wich, Control *c) {
@@ -263,23 +267,23 @@ void ColorPicker::_hsv_draw(int p_wich, Control *c) {
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;
@@ -290,7 +294,7 @@ void ColorPicker::_hsv_draw(int p_wich, Control *c) {
} else if (p_wich == 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());
@@ -304,10 +308,10 @@ void ColorPicker::_uv_input(const Ref<InputEvent> &ev) {
if (bev.is_valid()) {
if (bev->is_pressed() && bev->get_button_index() == BUTTON_LEFT) {
changing_color = true;
- float x = CLAMP((float)bev->get_pos().x, 0, 256);
- float y = CLAMP((float)bev->get_pos().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);
@@ -323,10 +327,10 @@ void ColorPicker::_uv_input(const Ref<InputEvent> &ev) {
if (mev.is_valid()) {
if (!changing_color)
return;
- float x = CLAMP((float)mev->get_pos().x, 0, 256);
- float y = CLAMP((float)mev->get_pos().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);
@@ -343,8 +347,8 @@ void ColorPicker::_w_input(const Ref<InputEvent> &ev) {
if (bev->is_pressed() && bev->get_button_index() == BUTTON_LEFT) {
changing_color = true;
- h = 1 - ((float)bev->get_pos().y) / 256.0;
-
+ 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;
}
@@ -361,8 +365,8 @@ void ColorPicker::_w_input(const Ref<InputEvent> &ev) {
if (!changing_color)
return;
- float y = CLAMP((float)mev->get_pos().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);
@@ -378,10 +382,10 @@ void ColorPicker::_preset_input(const Ref<InputEvent> &ev) {
if (bev.is_valid()) {
if (bev->is_pressed() && bev->get_button_index() == BUTTON_LEFT) {
- int index = bev->get_pos().x / (preset->get_size().x / presets.size());
+ int index = bev->get_position().x / (preset->get_size().x / presets.size());
set_pick_color(presets[index]);
} else if (bev->is_pressed() && bev->get_button_index() == BUTTON_RIGHT) {
- int index = bev->get_pos().x / (preset->get_size().x / presets.size());
+ int index = bev->get_position().x / (preset->get_size().x / presets.size());
presets.erase(presets[index]);
_update_presets();
bt_add_preset->show();
@@ -394,7 +398,7 @@ void ColorPicker::_preset_input(const Ref<InputEvent> &ev) {
if (mev.is_valid()) {
- int index = mev->get_pos().x * presets.size();
+ int index = mev->get_position().x * presets.size();
if (preset->get_size().x != 0) {
index /= preset->get_size().x;
}
@@ -422,21 +426,14 @@ void ColorPicker::_screen_input(const Ref<InputEvent> &ev) {
if (mev.is_valid()) {
Viewport *r = get_tree()->get_root();
- if (!r->get_visible_rect().has_point(Point2(mev->get_global_pos().x, mev->get_global_pos().y)))
+ if (!r->get_visible_rect().has_point(Point2(mev->get_global_position().x, mev->get_global_position().y)))
return;
- Ref<Image> img = r->get_screen_capture();
- if (!img.is_null()) {
- last_capture = img;
- r->queue_screen_capture();
- }
- if (last_capture.is_valid() && !last_capture->empty()) {
- int pw = last_capture->get_format() == Image::FORMAT_RGBA8 ? 4 : 3;
- int ofs = (mev->get_global_pos().y * last_capture->get_width() + mev->get_global_pos().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<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);
}
}
@@ -453,11 +450,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() {
@@ -507,12 +504,14 @@ 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));
+ uv_edit->set_h_size_flags(SIZE_EXPAND_FILL);
+ uv_edit->set_v_size_flags(SIZE_EXPAND_FILL);
Vector<Variant> args = Vector<Variant>();
args.push_back(0);
args.push_back(uv_edit);
@@ -522,7 +521,9 @@ ColorPicker::ColorPicker()
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(30, 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);
@@ -548,6 +549,7 @@ ColorPicker::ColorPicker()
HBoxContainer *hbc = memnew(HBoxContainer);
labels[i] = memnew(Label(lt[i]));
+ labels[i]->set_custom_minimum_size(Size2(10, 0));
hbc->add_child(labels[i]);
scroll[i] = memnew(HSlider);
@@ -569,7 +571,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);
@@ -600,7 +602,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);
}
@@ -629,6 +631,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) {
diff --git a/scene/gui/color_picker.h b/scene/gui/color_picker.h
index ca47c3a5f4..de624fd029 100644
--- a/scene/gui/color_picker.h
+++ b/scene/gui/color_picker.h
@@ -47,7 +47,6 @@ class ColorPicker : public BoxContainer {
private:
Control *screen;
- Ref<Image> last_capture;
Control *uv_edit;
Control *w_edit;
TextureRect *sample;
diff --git a/scene/gui/container.cpp b/scene/gui/container.cpp
index c428d524a4..2a96f8260c 100644
--- a/scene/gui/container.cpp
+++ b/scene/gui/container.cpp
@@ -95,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_position(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));
diff --git a/scene/gui/control.cpp b/scene/gui/control.cpp
index 83fa20bee5..e9e299ffc5 100644
--- a/scene/gui/control.cpp
+++ b/scene/gui/control.cpp
@@ -58,7 +58,7 @@ void Control::edit_set_state(const Variant &p_state) {
Dictionary s = p_state;
Rect2 state = s["rect"];
- set_position(state.pos);
+ set_position(state.position);
set_size(state.size);
set_rotation(s["rot"]);
set_scale(s["scale"]);
@@ -90,19 +90,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 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_position(new_rect.pos);
+ set_position(new_rect.position);
set_size(new_rect.size);
}
@@ -353,8 +364,9 @@ void Control::remove_child_notify(Node *p_child) {
void Control::_update_canvas_item_transform() {
- Transform2D xform = Transform2D(data.rotation, get_position());
- 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);
}
@@ -1184,6 +1196,7 @@ Size2 Control::get_parent_area_size() const {
parent_size = get_viewport()->get_visible_rect().size;
}
+
return parent_size;
}
@@ -1216,12 +1229,28 @@ void Control::_size_changed() {
}
}
- 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;
+ 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;
+
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.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);
+ }
+
+ 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;
@@ -1477,7 +1506,7 @@ Rect2 Control::get_global_rect() const {
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;
}
@@ -1886,8 +1915,8 @@ Control::CursorShape Control::get_cursor_shape(const Point2 &p_pos) const {
Transform2D Control::get_transform() const {
- Transform2D xform = Transform2D(data.rotation, get_position());
- xform.scale_basis(data.scale);
+ Transform2D xform = _get_internal_transform();
+ xform[2] += get_position();
return xform;
}
@@ -1949,10 +1978,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),
@@ -2008,10 +2037,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;
@@ -2213,6 +2242,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;
@@ -2299,6 +2341,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);
@@ -2324,6 +2387,7 @@ void Control::_bind_methods() {
// 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);
@@ -2334,6 +2398,7 @@ void Control::_bind_methods() {
// 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_position"), &Control::get_global_position);
@@ -2387,6 +2452,12 @@ void Control::_bind_methods() {
ClassDB::bind_method(D_METHOD("get_parent_control: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()));
ClassDB::bind_method(D_METHOD("_get_tooltip"), &Control::_get_tooltip);
@@ -2437,12 +2508,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_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_");
@@ -2458,8 +2534,8 @@ 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_horizontal", PROPERTY_HINT_FLAGS, "Fill,Expand,Shrink Center,Shrink End"), "set_h_size_flags", "get_h_size_flags");
+ ADD_PROPERTYNO(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::INT, "size_flags_stretch_ratio", PROPERTY_HINT_RANGE, "1,128,0.01"), "set_stretch_ratio", "get_stretch_ratio");
ADD_GROUP("Theme", "");
ADD_PROPERTYNZ(PropertyInfo(Variant::OBJECT, "theme", PROPERTY_HINT_RESOURCE_TYPE, "Theme"), "set_theme", "get_theme");
@@ -2501,11 +2577,16 @@ void Control::_bind_methods() {
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);
+
ADD_SIGNAL(MethodInfo("resized"));
ADD_SIGNAL(MethodInfo("gui_input", PropertyInfo(Variant::OBJECT, "ev", PROPERTY_HINT_RESOURCE_TYPE, "InputEvent")));
ADD_SIGNAL(MethodInfo("mouse_entered"));
@@ -2542,6 +2623,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 5834d1550a..86cf8f6dbd 100644
--- a/scene/gui/control.h
+++ b/scene/gui/control.h
@@ -57,6 +57,11 @@ public:
ANCHOR_CENTER,
};
+ enum GrowDirection {
+ GROW_DIRECTION_BEGIN,
+ GROW_DIRECTION_END
+ };
+
enum FocusMode {
FOCUS_NONE,
FOCUS_CLICK,
@@ -67,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
};
@@ -117,9 +124,12 @@ private:
float margin[4];
AnchorType anchor[4];
FocusMode focus_mode;
+ GrowDirection h_grow;
+ GrowDirection v_grow;
float rotation;
Vector2 scale;
+ Vector2 pivot_offset;
bool pending_resize;
@@ -200,6 +210,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);
@@ -273,6 +285,12 @@ public:
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;
@@ -293,6 +311,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;
@@ -409,5 +430,6 @@ VARIANT_ENUM_CAST(Control::FocusMode);
VARIANT_ENUM_CAST(Control::SizeFlags);
VARIANT_ENUM_CAST(Control::CursorShape);
VARIANT_ENUM_CAST(Control::MouseFilter);
+VARIANT_ENUM_CAST(Control::GrowDirection);
#endif
diff --git a/scene/gui/dialogs.cpp b/scene/gui/dialogs.cpp
index 627bc96fb1..60d1350405 100644
--- a/scene/gui/dialogs.cpp
+++ b/scene/gui/dialogs.cpp
@@ -90,15 +90,15 @@ bool WindowDialog::has_point(const Point2 &p_point) const {
// Enlarge upwards for title bar.
int title_height = get_constant("title_height", "WindowDialog");
- r.pos.y -= title_height;
+ 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;
}
@@ -113,7 +113,7 @@ void WindowDialog::_gui_input(const Ref<InputEvent> &p_event) {
if (mb->is_pressed()) {
// Begin a possible dragging operation.
- drag_type = _drag_hit_test(Point2(mb->get_pos().x, mb->get_pos().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_position() - get_position();
drag_offset_far = get_position() + get_size() - get_global_mouse_position();
@@ -131,7 +131,7 @@ void WindowDialog::_gui_input(const Ref<InputEvent> &p_event) {
// Update the cursor while moving along the borders.
CursorShape cursor = CURSOR_ARROW;
if (resizable) {
- int preview_drag_type = _drag_hit_test(Point2(mm->get_pos().x, mm->get_pos().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:
@@ -162,28 +162,28 @@ void WindowDialog::_gui_input(const Ref<InputEvent> &p_event) {
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_position(rect.pos);
+ set_position(rect.position);
}
}
}
diff --git a/scene/gui/color_ramp_edit.cpp b/scene/gui/gradient_edit.cpp
index 8c47f8559a..58bce57580 100644
--- a/scene/gui/color_ramp_edit.cpp
+++ b/scene/gui/gradient_edit.cpp
@@ -27,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);
@@ -46,7 +46,7 @@ ColorRampEdit::ColorRampEdit() {
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++) {
@@ -58,7 +58,7 @@ 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);
@@ -68,10 +68,10 @@ void ColorRampEdit::_show_color_picker() {
popup->popup();
}
-ColorRampEdit::~ColorRampEdit() {
+GradientEdit::~GradientEdit() {
}
-void ColorRampEdit::_gui_input(const Ref<InputEvent> &p_event) {
+void GradientEdit::_gui_input(const Ref<InputEvent> &p_event) {
Ref<InputEventKey> k = p_event;
@@ -88,14 +88,14 @@ void ColorRampEdit::_gui_input(const Ref<InputEvent> &p_event) {
Ref<InputEventMouseButton> mb = p_event;
//Show color picker on double click.
if (mb.is_valid() && mb->get_button_index() == 1 && mb->is_doubleclick() && mb->is_pressed()) {
- grabbed = _get_point_from_pos(mb->get_pos().x);
+ grabbed = _get_point_from_pos(mb->get_position().x);
_show_color_picker();
accept_event();
}
//Delete point on right click
if (mb.is_valid() && mb->get_button_index() == 2 && mb->is_pressed()) {
- grabbed = _get_point_from_pos(mb->get_pos().x);
+ grabbed = _get_point_from_pos(mb->get_position().x);
if (grabbed != -1) {
points.remove(grabbed);
grabbed = -1;
@@ -109,7 +109,7 @@ void ColorRampEdit::_gui_input(const Ref<InputEvent> &p_event) {
//Hold alt key to duplicate selected color
if (mb.is_valid() && mb->get_button_index() == 1 && mb->is_pressed() && mb->get_alt()) {
- int x = mb->get_pos().x;
+ int x = mb->get_position().x;
grabbed = _get_point_from_pos(x);
if (grabbed != -1) {
@@ -134,7 +134,7 @@ void ColorRampEdit::_gui_input(const Ref<InputEvent> &p_event) {
if (mb.is_valid() && mb->get_button_index() == 1 && mb->is_pressed()) {
update();
- int x = mb->get_pos().x;
+ int x = mb->get_position().x;
int total_w = get_size().width - get_size().height - 3;
//Check if color selector was clicked.
@@ -214,7 +214,7 @@ void ColorRampEdit::_gui_input(const Ref<InputEvent> &p_event) {
int total_w = get_size().width - get_size().height - 3;
- int x = mm->get_pos().x;
+ int x = mm->get_position().x;
float newofs = CLAMP(x / float(total_w), 0, 1);
@@ -272,7 +272,7 @@ void ColorRampEdit::_gui_input(const Ref<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")) {
@@ -370,7 +370,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));
@@ -391,12 +391,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;
@@ -405,7 +405,7 @@ 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();
@@ -420,33 +420,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<Gradient::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<Gradient::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 0fe447c43a..6c4ae6fd15 100644
--- a/scene/gui/color_ramp_edit.h
+++ b/scene/gui/gradient_edit.h
@@ -37,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;
@@ -68,8 +68,8 @@ public:
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 c52cdd9325..9d45b6e70a 100644
--- a/scene/gui/graph_edit.cpp
+++ b/scene/gui/graph_edit.cpp
@@ -168,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())
@@ -374,7 +374,7 @@ void GraphEdit::_top_layer_input(const Ref<InputEvent> &p_ev) {
if (mb.is_valid() && mb->get_button_index() == BUTTON_LEFT && mb->is_pressed()) {
Ref<Texture> port = get_icon("port", "GraphNode");
- Vector2 mpos(mb->get_pos().x, mb->get_pos().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--) {
@@ -483,12 +483,12 @@ void GraphEdit::_top_layer_input(const Ref<InputEvent> &p_ev) {
Ref<InputEventMouseMotion> mm = p_ev;
if (mm.is_valid() && connecting) {
- connecting_to = mm->get_pos();
+ connecting_to = mm->get_position();
connecting_target = false;
top_layer->update();
Ref<Texture> port = get_icon("port", "GraphNode");
- Vector2 mpos = mm->get_pos();
+ 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--) {
@@ -546,7 +546,7 @@ void GraphEdit::_top_layer_input(const Ref<InputEvent> &p_ev) {
} else if (!just_disconected) {
String from = connecting_from;
int from_slot = connecting_index;
- Vector2 ofs = Vector2(mb->get_pos().x, mb->get_pos().y);
+ Vector2 ofs = Vector2(mb->get_position().x, mb->get_position().y);
emit_signal("connection_to_empty", from, from_slot, ofs);
}
connecting = false;
@@ -568,7 +568,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);
@@ -581,11 +581,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);
}
}
@@ -609,7 +610,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
@@ -817,7 +827,7 @@ void GraphEdit::_gui_input(const Ref<InputEvent> &p_ev) {
connecting = false;
top_layer->update();
} else {
- emit_signal("popup_request", b->get_global_pos());
+ emit_signal("popup_request", b->get_global_position());
}
}
}
@@ -880,7 +890,7 @@ void GraphEdit::_gui_input(const Ref<InputEvent> &p_ev) {
if (gn) {
- if (_filter_input(b->get_pos()))
+ if (_filter_input(b->get_position()))
return;
dragging = true;
@@ -905,7 +915,7 @@ void GraphEdit::_gui_input(const Ref<InputEvent> &p_ev) {
}
} else {
- if (_filter_input(b->get_pos()))
+ if (_filter_input(b->get_position()))
return;
if (Input::get_singleton()->is_key_pressed(KEY_SPACE))
return;
diff --git a/scene/gui/graph_edit.h b/scene/gui/graph_edit.h
index 22d053d312..e908829d5f 100644
--- a/scene/gui/graph_edit.h
+++ b/scene/gui/graph_edit.h
@@ -110,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);
diff --git a/scene/gui/graph_node.cpp b/scene/gui/graph_node.cpp
index fb0ff4f320..538dd846e4 100644
--- a/scene/gui/graph_node.cpp
+++ b/scene/gui/graph_node.cpp
@@ -28,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) {
@@ -239,7 +239,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();
@@ -582,11 +582,9 @@ void GraphNode::_gui_input(const Ref<InputEvent> &p_ev) {
ERR_EXPLAIN("GraphNode must be the child of a GraphEdit node.");
ERR_FAIL_COND(get_parent_control() == NULL);
- print_line("INPUT EVENT BUTTON");
-
if (mb->is_pressed() && mb->get_button_index() == BUTTON_LEFT) {
- Vector2 mpos = Vector2(mb->get_pos().x, mb->get_pos().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();
@@ -616,7 +614,7 @@ void GraphNode::_gui_input(const Ref<InputEvent> &p_ev) {
Ref<InputEventMouseMotion> mm = p_ev;
if (resizing && mm.is_valid()) {
- Vector2 mpos = mm->get_pos();
+ Vector2 mpos = mm->get_position();
Vector2 diff = mpos - resizing_from;
diff --git a/scene/gui/input_action.cpp b/scene/gui/input_action.cpp
index 311cb4ab13..3f80c31c8b 100644
--- a/scene/gui/input_action.cpp
+++ b/scene/gui/input_action.cpp
@@ -43,7 +43,7 @@ Ref<InputEvent> ShortCut::get_shortcut() const {
bool ShortCut::is_shortcut(const Ref<InputEvent> &p_event) const {
- return shortcut.is_valid() && shortcut->action_match(p_event);
+ return shortcut.is_valid() && shortcut->shortcut_match(p_event);
}
String ShortCut::get_as_text() const {
diff --git a/scene/gui/item_list.cpp b/scene/gui/item_list.cpp
index a9f063280b..160b7b151a 100644
--- a/scene/gui/item_list.cpp
+++ b/scene/gui/item_list.cpp
@@ -431,7 +431,7 @@ void ItemList::_gui_input(const Ref<InputEvent> &p_event) {
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->get_pos().x, mb->get_pos().y);
+ Vector2 pos(mb->get_position().x, mb->get_position().y);
Ref<StyleBox> bg = get_stylebox("bg");
pos -= bg->get_offset();
pos.y += scroll_bar->get_value();
@@ -475,7 +475,7 @@ void ItemList::_gui_input(const Ref<InputEvent> &p_event) {
if (mb->get_button_index() == BUTTON_RIGHT) {
- emit_signal("item_rmb_selected", i, Vector2(mb->get_pos().x, mb->get_pos().y));
+ emit_signal("item_rmb_selected", i, Vector2(mb->get_position().x, mb->get_position().y));
}
} else {
@@ -486,7 +486,7 @@ void ItemList::_gui_input(const Ref<InputEvent> &p_event) {
if (items[i].selected && mb->get_button_index() == BUTTON_RIGHT) {
- emit_signal("item_rmb_selected", i, Vector2(mb->get_pos().x, mb->get_pos().y));
+ emit_signal("item_rmb_selected", i, Vector2(mb->get_position().x, mb->get_position().y));
} else {
bool selected = !items[i].selected;
@@ -501,7 +501,7 @@ void ItemList::_gui_input(const Ref<InputEvent> &p_event) {
if (mb->get_button_index() == BUTTON_RIGHT) {
- emit_signal("item_rmb_selected", i, Vector2(mb->get_pos().x, mb->get_pos().y));
+ emit_signal("item_rmb_selected", i, Vector2(mb->get_position().x, mb->get_position().y));
} else if (/*select_mode==SELECT_SINGLE &&*/ mb->is_doubleclick()) {
emit_signal("item_activated", i);
@@ -857,7 +857,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));
@@ -906,10 +906,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));
}
}
@@ -928,26 +928,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);
}
@@ -965,7 +968,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) {
@@ -985,7 +988,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;
}
@@ -1001,7 +1004,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 != "") {
@@ -1046,7 +1049,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++) {
@@ -1074,7 +1077,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);
}
@@ -1083,7 +1086,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);
}
}
@@ -1141,7 +1144,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 {
@@ -1220,6 +1223,36 @@ 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;
+}
+
void ItemList::_bind_methods() {
ClassDB::bind_method(D_METHOD("add_item", "text", "icon:Texture", "selectable"), &ItemList::add_item, DEFVAL(Variant()), DEFVAL(true));
@@ -1299,6 +1332,22 @@ 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_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);
diff --git a/scene/gui/item_list.h b/scene/gui/item_list.h
index c7abc2990f..9cb7016b60 100644
--- a/scene/gui/item_list.h
+++ b/scene/gui/item_list.h
@@ -103,6 +103,9 @@ private:
real_t icon_scale;
+ Array _get_items() const;
+ void _set_items(const Array &p_items);
+
void _scroll_changed(double);
void _gui_input(const Ref<InputEvent> &p_event);
diff --git a/scene/gui/label.cpp b/scene/gui/label.cpp
index f3a279bada..fb85930ceb 100644
--- a/scene/gui/label.cpp
+++ b/scene/gui/label.cpp
@@ -65,7 +65,12 @@ void Label::_notification(int p_what) {
if (p_what == NOTIFICATION_TRANSLATION_CHANGED) {
- xl_text = XL_MESSAGE(text);
+ String new_text = XL_MESSAGE(text);
+ if (new_text == xl_text)
+ return; //nothing new
+ xl_text = new_text;
+
+ regenerate_word_cache();
minimum_size_changed();
update();
}
diff --git a/scene/gui/line_edit.cpp b/scene/gui/line_edit.cpp
index 38debe8a77..bc579020bd 100644
--- a/scene/gui/line_edit.cpp
+++ b/scene/gui/line_edit.cpp
@@ -64,7 +64,7 @@ void LineEdit::_gui_input(Ref<InputEvent> p_event) {
shift_selection_check_pre(b->get_shift());
- set_cursor_at_pixel_pos(b->get_pos().x);
+ set_cursor_at_pixel_pos(b->get_position().x);
if (b->get_shift()) {
@@ -118,7 +118,7 @@ void LineEdit::_gui_input(Ref<InputEvent> p_event) {
if (m->get_button_mask() & BUTTON_LEFT) {
if (selection.creating) {
- set_cursor_at_pixel_pos(m->get_pos().x);
+ set_cursor_at_pixel_pos(m->get_position().x);
selection_fill_at_cursor();
}
}
diff --git a/scene/gui/patch_9_rect.cpp b/scene/gui/patch_9_rect.cpp
index 0c2b94d700..735f36b55d 100644
--- a/scene/gui/patch_9_rect.cpp
+++ b/scene/gui/patch_9_rect.cpp
@@ -44,7 +44,7 @@ void NinePatchRect::_notification(int p_what) {
texture->get_rect_region(rect, src_rect, rect, src_rect);
RID ci = get_canvas_item();
- 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::NINE_PATCH_STRETCH, VS::NINE_PATCH_STRETCH, draw_center);
+ 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);
}
}
@@ -62,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"));
@@ -74,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) {
@@ -150,6 +161,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;
@@ -159,6 +190,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 ba978f2f81..602a6d22bf 100644
--- a/scene/gui/patch_9_rect.h
+++ b/scene/gui/patch_9_rect.h
@@ -38,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;
@@ -61,7 +70,15 @@ public:
void set_draw_center(bool p_enable);
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 655d8ed6f6..8979e0f111 100644
--- a/scene/gui/popup.cpp
+++ b/scene/gui/popup.cpp
@@ -170,8 +170,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_position(rect.pos);
+ rect.position = ((window_size - rect.size) / 2.0).floor();
+ set_position(rect.position);
set_size(rect.size);
show_modal(exclusive);
@@ -193,8 +193,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_position(rect.pos);
+ rect.position = ((window_size - rect.size) / 2.0).floor();
+ set_position(rect.position);
set_size(rect.size);
show_modal(exclusive);
@@ -216,7 +216,7 @@ void Popup::popup(const Rect2 &bounds) {
// Fit the popup into the optionally provided bounds.
if (!bounds.has_no_area()) {
- set_position(bounds.pos);
+ set_position(bounds.position);
set_size(bounds.size);
}
_fix_size();
diff --git a/scene/gui/popup_menu.cpp b/scene/gui/popup_menu.cpp
index 985d9addc9..74b26da580 100644
--- a/scene/gui/popup_menu.cpp
+++ b/scene/gui/popup_menu.cpp
@@ -190,12 +190,12 @@ void PopupMenu::_activate_submenu(int over) {
PopupMenu *pum = pm->cast_to<PopupMenu>();
if (pum) {
- pr.pos -= pum->get_global_position();
+ 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));
}
}
}
@@ -284,7 +284,7 @@ void PopupMenu::_gui_input(const Ref<InputEvent> &p_event) {
//update hover
Ref<InputEventMouseMotion> ie;
ie.instance();
- ie->set_pos(b->get_pos() + Vector2(0, s));
+ ie->set_position(b->get_position() + Vector2(0, s));
_gui_input(ie);
}
} break;
@@ -303,13 +303,13 @@ void PopupMenu::_gui_input(const Ref<InputEvent> &p_event) {
//update hover
Ref<InputEventMouseMotion> ie;
ie.instance();
- ie->set_pos(b->get_pos() - Vector2(0, s));
+ ie->set_position(b->get_position() - Vector2(0, s));
_gui_input(ie);
}
} break;
case BUTTON_LEFT: {
- int over = _get_mouse_over(b->get_pos());
+ int over = _get_mouse_over(b->get_position());
if (invalidated_click) {
invalidated_click = false;
@@ -348,13 +348,13 @@ void PopupMenu::_gui_input(const Ref<InputEvent> &p_event) {
for (List<Rect2>::Element *E = autohide_areas.front(); E; E = E->next()) {
- if (!Rect2(Point2(), get_size()).has_point(m->get_pos()) && E->get().has_point(m->get_pos())) {
+ if (!Rect2(Point2(), get_size()).has_point(m->get_position()) && E->get().has_point(m->get_position())) {
call_deferred("hide");
return;
}
}
- int over = _get_mouse_over(m->get_pos());
+ 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 (id < 0) {
@@ -884,7 +884,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>();
@@ -895,8 +895,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();
}
}
@@ -1019,6 +1019,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);
@@ -1107,10 +1117,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")));
@@ -1128,6 +1142,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 7ef532453d..a9bd8f7e50 100644
--- a/scene/gui/popup_menu.h
+++ b/scene/gui/popup_menu.h
@@ -85,6 +85,7 @@ class PopupMenu : public Popup {
bool invalidated_click;
bool hide_on_item_selection;
+ bool hide_on_checkable_item_selection;
Vector2 moved;
Array _get_items() const;
@@ -168,6 +169,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/rich_text_label.cpp b/scene/gui/rich_text_label.cpp
index a618810c11..c6b8398736 100644
--- a/scene/gui/rich_text_label.cpp
+++ b/scene/gui/rich_text_label.cpp
@@ -264,7 +264,7 @@ void RichTextLabel::_process_line(ItemFrame *p_frame, const Vector2 &p_ofs, int
cw = tab_size * font->get_char_size(' ').width;
}
- if (end > 0 && w + cw + wofs > p_width) {
+ if (end > 0 && w + cw + begin > p_width) {
break; //don't allow lines longer than assigned width
}
@@ -751,7 +751,7 @@ void RichTextLabel::_gui_input(Ref<InputEvent> p_event) {
Item *item = NULL;
bool outside;
- _find_click(main, b->get_pos(), &item, &line, &outside);
+ _find_click(main, b->get_position(), &item, &line, &outside);
if (item) {
@@ -852,7 +852,7 @@ void RichTextLabel::_gui_input(Ref<InputEvent> p_event) {
int line = 0;
Item *item = NULL;
- _find_click(main, m->get_pos(), &item, &line);
+ _find_click(main, m->get_position(), &item, &line);
if (!item)
return; // do not update
@@ -1822,16 +1822,41 @@ 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("set_text", "text"), &RichTextLabel::set_text);
ClassDB::bind_method(D_METHOD("add_image", "image:Texture"), &RichTextLabel::add_image);
ClassDB::bind_method(D_METHOD("newline"), &RichTextLabel::add_newline);
ClassDB::bind_method(D_METHOD("remove_line"), &RichTextLabel::remove_line);
- ClassDB::bind_method(D_METHOD("push_font", "font"), &RichTextLabel::push_font);
+ ClassDB::bind_method(D_METHOD("push_font", "font:Font"), &RichTextLabel::push_font);
ClassDB::bind_method(D_METHOD("push_color", "color"), &RichTextLabel::push_color);
ClassDB::bind_method(D_METHOD("push_align", "align"), &RichTextLabel::push_align);
ClassDB::bind_method(D_METHOD("push_indent", "level"), &RichTextLabel::push_indent);
@@ -1854,7 +1879,7 @@ void RichTextLabel::_bind_methods() {
ClassDB::bind_method(D_METHOD("set_scroll_follow", "follow"), &RichTextLabel::set_scroll_follow);
ClassDB::bind_method(D_METHOD("is_scroll_following"), &RichTextLabel::is_scroll_following);
- ClassDB::bind_method(D_METHOD("get_v_scroll"), &RichTextLabel::get_v_scroll);
+ ClassDB::bind_method(D_METHOD("get_v_scroll:VScrollBar"), &RichTextLabel::get_v_scroll);
ClassDB::bind_method(D_METHOD("scroll_to_line", "line"), &RichTextLabel::scroll_to_line);
@@ -1873,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);
@@ -1881,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")));
@@ -1914,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 {
@@ -1964,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 eedb7e54db..409a8f6b3f 100644
--- a/scene/gui/rich_text_label.h
+++ b/scene/gui/rich_text_label.h
@@ -258,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);
@@ -340,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 27a16ccc33..bd66cd2745 100644
--- a/scene/gui/scroll_bar.cpp
+++ b/scene/gui/scroll_bar.cpp
@@ -72,7 +72,7 @@ void ScrollBar::_gui_input(Ref<InputEvent> p_event) {
if (b->is_pressed()) {
- double ofs = orientation == VERTICAL ? b->get_pos().y : b->get_pos().x;
+ double ofs = orientation == VERTICAL ? b->get_position().y : b->get_position().x;
Ref<Texture> decr = get_icon("decrement");
Ref<Texture> incr = get_icon("increment");
@@ -130,7 +130,7 @@ void ScrollBar::_gui_input(Ref<InputEvent> p_event) {
if (drag.active) {
- double ofs = orientation == VERTICAL ? m->get_pos().y : m->get_pos().x;
+ double ofs = orientation == VERTICAL ? m->get_position().y : m->get_position().x;
Ref<Texture> decr = get_icon("decrement");
double decr_size = orientation == VERTICAL ? decr->get_height() : decr->get_width();
@@ -141,7 +141,7 @@ void ScrollBar::_gui_input(Ref<InputEvent> p_event) {
set_as_ratio(drag.value_at_click + diff);
} else {
- double ofs = orientation == VERTICAL ? m->get_pos().y : m->get_pos().x;
+ double ofs = orientation == VERTICAL ? m->get_position().y : m->get_position().x;
Ref<Texture> decr = get_icon("decrement");
Ref<Texture> incr = get_icon("increment");
@@ -267,14 +267,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);
diff --git a/scene/gui/scroll_container.cpp b/scene/gui/scroll_container.cpp
index 70b4ac47f8..cc1a637d2b 100644
--- a/scene/gui/scroll_container.cpp
+++ b/scene/gui/scroll_container.cpp
@@ -233,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/slider.cpp b/scene/gui/slider.cpp
index ae2bf0999e..c84608ef2e 100644
--- a/scene/gui/slider.cpp
+++ b/scene/gui/slider.cpp
@@ -39,6 +39,10 @@ Size2 Slider::get_minimum_size() const {
void Slider::_gui_input(Ref<InputEvent> p_event) {
+ if (!editable) {
+ return;
+ }
+
Ref<InputEventMouseButton> mb = p_event;
if (mb.is_valid()) {
@@ -46,7 +50,7 @@ void Slider::_gui_input(Ref<InputEvent> p_event) {
if (mb->is_pressed()) {
Ref<Texture> grabber = get_icon(mouse_inside || has_focus() ? "grabber_highlight" : "grabber");
- grab.pos = orientation == VERTICAL ? mb->get_pos().y : mb->get_pos().x;
+ grab.pos = orientation == VERTICAL ? mb->get_position().y : mb->get_position().x;
double grab_width = (double)grabber->get_size().width;
double grab_height = (double)grabber->get_size().height;
@@ -75,7 +79,7 @@ void Slider::_gui_input(Ref<InputEvent> p_event) {
Size2i size = get_size();
Ref<Texture> grabber = get_icon("grabber");
- float motion = (orientation == VERTICAL ? mm->get_pos().y : mm->get_pos().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;
@@ -158,7 +162,7 @@ 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_highlight" : "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) {
@@ -231,6 +235,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);
@@ -240,6 +255,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");
@@ -251,5 +270,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 7194484058..f3cf3c6f48 100644
--- a/scene/gui/slider.h
+++ b/scene/gui/slider.h
@@ -46,6 +46,7 @@ class Slider : public Range {
bool mouse_inside;
Orientation orientation;
float custom_step;
+ bool editable;
protected:
void _gui_input(Ref<InputEvent> p_event);
@@ -65,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 2eb2028391..c5b9df15b9 100644
--- a/scene/gui/spin_box.cpp
+++ b/scene/gui/spin_box.cpp
@@ -96,7 +96,7 @@ void SpinBox::_gui_input(const Ref<InputEvent> &p_event) {
if (mb.is_valid() && mb->is_pressed()) {
- bool up = mb->get_pos().y < (get_size().height / 2);
+ bool up = mb->get_position().y < (get_size().height / 2);
switch (mb->get_button_index()) {
@@ -135,7 +135,7 @@ void SpinBox::_gui_input(const Ref<InputEvent> &p_event) {
if (mb.is_valid() && mb->is_pressed() && mb->get_button_index() == 1) {
//set_default_cursor_shape(CURSOR_VSIZE);
- Vector2 cpos = Vector2(mb->get_pos().x, mb->get_pos().y);
+ Vector2 cpos = Vector2(mb->get_position().x, mb->get_position().y);
drag.mouse_pos = cpos;
}
@@ -155,7 +155,7 @@ void SpinBox::_gui_input(const Ref<InputEvent> &p_event) {
if (mm.is_valid() && mm->get_button_mask() & 1) {
- Vector2 cpos = mm->get_pos();
+ Vector2 cpos = mm->get_position();
if (drag.enabled) {
diff --git a/scene/gui/split_container.cpp b/scene/gui/split_container.cpp
index 91fd18e2ed..e3dad08809 100644
--- a/scene/gui/split_container.cpp
+++ b/scene/gui/split_container.cpp
@@ -131,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) {
@@ -144,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) {
@@ -286,16 +296,16 @@ void SplitContainer::_gui_input(const Ref<InputEvent> &p_event) {
if (vertical) {
- if (mb->get_pos().y > middle_sep && mb->get_pos().y < middle_sep + sep) {
+ if (mb->get_position().y > middle_sep && mb->get_position().y < middle_sep + sep) {
dragging = true;
- drag_from = mb->get_pos().y;
+ drag_from = mb->get_position().y;
drag_ofs = expand_ofs;
}
} else {
- if (mb->get_pos().x > middle_sep && mb->get_pos().x < middle_sep + sep) {
+ if (mb->get_position().x > middle_sep && mb->get_position().x < middle_sep + sep) {
dragging = true;
- drag_from = mb->get_pos().x;
+ drag_from = mb->get_position().x;
drag_ofs = expand_ofs;
}
}
@@ -312,7 +322,7 @@ void SplitContainer::_gui_input(const Ref<InputEvent> &p_event) {
if (dragging) {
- expand_ofs = drag_ofs + ((vertical ? mm->get_pos().y : mm->get_pos().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 94b80cf279..87a210f24c 100644
--- a/scene/gui/split_container.h
+++ b/scene/gui/split_container.h
@@ -34,7 +34,7 @@
class SplitContainer : public Container {
- GDCLASS(SplitContainer, Container);
+ GDCLASS(SplitContainer, Container)
public:
enum DraggerVisibility {
diff --git a/scene/gui/tab_container.cpp b/scene/gui/tab_container.cpp
index 6bbfa1aeb0..5ebcef3e8d 100644
--- a/scene/gui/tab_container.cpp
+++ b/scene/gui/tab_container.cpp
@@ -69,7 +69,7 @@ void TabContainer::_gui_input(const Ref<InputEvent> &p_event) {
if (mb.is_valid() && mb->is_pressed() && mb->get_button_index() == BUTTON_LEFT) {
- Point2 pos(mb->get_pos().x, mb->get_pos().y);
+ Point2 pos(mb->get_position().x, mb->get_position().y);
Size2 size = get_size();
// Click must be on tabs in the tab header area.
@@ -233,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;
diff --git a/scene/gui/tabs.cpp b/scene/gui/tabs.cpp
index d94c33e408..4316f06a53 100644
--- a/scene/gui/tabs.cpp
+++ b/scene/gui/tabs.cpp
@@ -85,7 +85,7 @@ void Tabs::_gui_input(const Ref<InputEvent> &p_event) {
if (mm.is_valid()) {
- Point2 pos = mm->get_pos();
+ Point2 pos = mm->get_position();
highlight_arrow = -1;
if (buttons_visible) {
@@ -103,13 +103,17 @@ void Tabs::_gui_input(const Ref<InputEvent> &p_event) {
}
// 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;
@@ -122,6 +126,10 @@ void Tabs::_gui_input(const Ref<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;
@@ -165,7 +173,7 @@ void Tabs::_gui_input(const Ref<InputEvent> &p_event) {
mb->get_button_index() == BUTTON_LEFT) {
// clicks
- Point2 pos(mb->get_pos().x, mb->get_pos().y);
+ Point2 pos(mb->get_position().x, mb->get_position().y);
if (buttons_visible) {
@@ -234,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");
@@ -286,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;
@@ -313,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);
@@ -323,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()) {
@@ -340,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)
@@ -350,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;
}
@@ -364,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)
@@ -374,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) {
@@ -419,6 +424,7 @@ void Tabs::set_current_tab(int p_current) {
current = p_current;
_change_notify("current_tab");
+ _update_cache();
update();
}
@@ -427,6 +433,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());
@@ -480,15 +490,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();
}
@@ -505,6 +581,7 @@ void Tabs::remove_tab(int p_idx) {
tabs.remove(p_idx);
if (current >= p_idx)
current--;
+ _update_cache();
update();
minimum_size_changed();
@@ -516,6 +593,41 @@ 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) {
tab_align = p_align;
@@ -587,7 +699,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) {
@@ -604,37 +716,35 @@ 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) {
@@ -642,6 +752,10 @@ void Tabs::set_tab_close_display_policy(CloseButtonDisplayPolicy p_policy) {
update();
}
+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);
@@ -663,6 +777,8 @@ void Tabs::_bind_methods() {
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_PROPERTY(PropertyInfo(Variant::INT, "current_tab", PROPERTY_HINT_RANGE, "-1,4096,1", PROPERTY_USAGE_EDITOR), "set_current_tab", "get_current_tab");
@@ -688,4 +804,6 @@ Tabs::Tabs() {
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 61b97d2dff..613c604b12 100644
--- a/scene/gui/tabs.h
+++ b/scene/gui/tabs.h
@@ -59,6 +59,7 @@ private:
int ofs_cache;
bool disabled;
int size_cache;
+ int size_text;
int x_cache;
int x_size_cache;
@@ -74,7 +75,6 @@ private:
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;
@@ -85,15 +85,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 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>());
@@ -117,13 +124,16 @@ public:
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();
diff --git a/scene/gui/text_edit.cpp b/scene/gui/text_edit.cpp
index 4989a3d863..936a9b77f8 100644
--- a/scene/gui/text_edit.cpp
+++ b/scene/gui/text_edit.cpp
@@ -1069,16 +1069,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;
@@ -1086,14 +1086,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++) {
@@ -1105,14 +1105,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;
@@ -1445,7 +1445,7 @@ void TextEdit::_gui_input(const Ref<InputEvent> &p_gui_input) {
Ref<InputEventMouseButton> mb = p_gui_input;
if (mb.is_valid()) {
- if (completion_active && completion_rect.has_point(mb->get_pos())) {
+ if (completion_active && completion_rect.has_point(mb->get_position())) {
if (!mb->is_pressed())
return;
@@ -1468,7 +1468,7 @@ void TextEdit::_gui_input(const Ref<InputEvent> &p_gui_input) {
if (mb->get_button_index() == BUTTON_LEFT) {
- completion_index = CLAMP(completion_line_ofs + (mb->get_pos().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();
@@ -1500,7 +1500,7 @@ void TextEdit::_gui_input(const Ref<InputEvent> &p_gui_input) {
_reset_caret_blink_timer();
int row, col;
- _get_mouse_pos(Point2i(mb->get_pos().x, mb->get_pos().y), row, col);
+ _get_mouse_pos(Point2i(mb->get_position().x, mb->get_position().y), row, col);
if (mb->get_command() && highlighted_word != String()) {
@@ -1511,7 +1511,7 @@ void TextEdit::_gui_input(const Ref<InputEvent> &p_gui_input) {
// toggle breakpoint on gutter click
if (draw_breakpoint_gutter) {
int gutter = cache.style_normal->get_margin(MARGIN_LEFT);
- if (mb->get_pos().x > gutter && mb->get_pos().x <= gutter + cache.breakpoint_gutter_width + 3) {
+ 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;
@@ -1646,7 +1646,7 @@ void TextEdit::_gui_input(const Ref<InputEvent> &p_gui_input) {
if (select_identifiers_enabled) {
if (mm->get_command() && mm->get_button_mask() == 0) {
- String new_word = get_word_at_pos(mm->get_pos());
+ String new_word = get_word_at_pos(mm->get_position());
if (new_word != highlighted_word) {
highlighted_word = new_word;
update();
@@ -1666,7 +1666,7 @@ void TextEdit::_gui_input(const Ref<InputEvent> &p_gui_input) {
_reset_caret_blink_timer();
int row, col;
- _get_mouse_pos(mm->get_pos(), row, col);
+ _get_mouse_pos(mm->get_position(), row, col);
select(selection.selecting_line, selection.selecting_column, row, col);
diff --git a/scene/gui/tree.cpp b/scene/gui/tree.cpp
index b17192fe4f..d8788b4eca 100644
--- a/scene/gui/tree.cpp
+++ b/scene/gui/tree.cpp
@@ -610,6 +610,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);
@@ -670,6 +716,9 @@ 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("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:Texture", "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);
@@ -677,12 +726,19 @@ void TreeItem::_bind_methods() {
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);
@@ -709,6 +765,7 @@ TreeItem::TreeItem(Tree *p_tree) {
tree = p_tree;
collapsed = false;
+ disable_folding = false;
parent = 0; // parent item
next = 0; // next in list
@@ -732,6 +789,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;
@@ -772,6 +833,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");
@@ -833,6 +899,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: {}
@@ -867,6 +936,32 @@ int Tree::get_item_height(TreeItem *p_item) const {
void Tree::draw_item_rect(const TreeItem::Cell &p_cell, const Rect2i &p_rect, const Color &p_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()) {
@@ -877,8 +972,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);
+ rect.position.x += bmsize.x + cache.hseparation;
rect.size.x -= bmsize.x + cache.hseparation;
}
@@ -887,14 +982,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
@@ -943,20 +1032,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)
@@ -964,9 +1039,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) {
@@ -984,6 +1065,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;
@@ -1007,16 +1098,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())
@@ -1028,34 +1119,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_position(get_global_position() + 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);
}
@@ -1066,22 +1162,22 @@ 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");
- 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) {
@@ -1094,7 +1190,7 @@ int Tree::draw_item(const Point2i &p_pos, const Point2 &p_draw_ofs, const Size2
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) {
@@ -1109,7 +1205,7 @@ 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);
@@ -1137,7 +1233,7 @@ 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);
@@ -1157,7 +1253,7 @@ 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);
@@ -1176,7 +1272,7 @@ 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));
//p_item->cells[i].icon->draw(ci, icon_ofs);
@@ -1202,12 +1298,28 @@ int Tree::draw_item(const Point2i &p_pos, const Point2 &p_draw_ofs, const Size2
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);
downarrow->draw(ci, arrow_pos);
@@ -1231,6 +1343,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) );
@@ -1252,8 +1377,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);
@@ -1445,7 +1570,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());
@@ -1461,6 +1586,18 @@ 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()) {
+ plus++;
+ col_width += cache.hseparation;
+ col_width += get_column_width(i + plus);
+ plus++;
+ }
+ }
+
if (x > col_width) {
col_ofs += col_width;
x -= col_width;
@@ -1485,6 +1622,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;
@@ -1697,11 +1839,18 @@ 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_position() + 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);
+
+ if (on_arrow || !p_item->cells[col].custom_button) {
+ 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));
+ 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);
+ }
click_handled = true;
return -1;
} break;
@@ -2122,7 +2271,7 @@ void Tree::_gui_input(Ref<InputEvent> p_event) {
Ref<StyleBox> bg = cache.bg;
- Point2 pos = mm->get_pos() - bg->get_offset();
+ Point2 pos = mm->get_position() - bg->get_offset();
Cache::ClickType old_hover = cache.hover_type;
int old_index = cache.hover_index;
@@ -2148,9 +2297,9 @@ void Tree::_gui_input(Ref<InputEvent> p_event) {
}
}
- if (drop_mode_flags && root) {
+ if (root) {
- Point2 mpos = mm->get_pos();
+ Point2 mpos = mm->get_position();
mpos -= cache.bg->get_offset();
mpos.y -= _get_title_button_height();
if (mpos.y >= 0) {
@@ -2163,11 +2312,17 @@ void Tree::_gui_input(Ref<InputEvent> p_event) {
int col, h, section;
TreeItem *it = _find_item_at_pos(root, mpos, col, h, section);
- if (it != drop_mode_over || section != drop_mode_section) {
+ if (drop_mode_flags && it != drop_mode_over || section != drop_mode_section) {
drop_mode_over = it;
drop_mode_section = section;
update();
}
+
+ if (it != cache.hover_item || col != cache.hover_cell) {
+ cache.hover_item = it;
+ cache.hover_cell = col;
+ update();
+ }
}
}
@@ -2180,7 +2335,7 @@ void Tree::_gui_input(Ref<InputEvent> p_event) {
if (!range_drag_enabled) {
- Vector2 cpos = mm->get_pos();
+ Vector2 cpos = mm->get_position();
if (cpos.distance_to(pressing_pos) > 2) {
range_drag_enabled = true;
range_drag_capture_pos = cpos;
@@ -2217,7 +2372,7 @@ void Tree::_gui_input(Ref<InputEvent> p_event) {
if (b->get_button_index() == BUTTON_LEFT) {
- Point2 pos = b->get_pos() - cache.bg->get_offset();
+ Point2 pos = b->get_position() - cache.bg->get_offset();
if (show_column_titles) {
pos.y -= _get_title_button_height();
@@ -2251,7 +2406,7 @@ void Tree::_gui_input(Ref<InputEvent> p_event) {
warp_mouse(range_drag_capture_pos);
} else {
Rect2 rect = get_selected()->get_meta("__focus_rect");
- if (rect.has_point(Point2(b->get_pos().x, b->get_pos().y))) {
+ if (rect.has_point(Point2(b->get_position().x, b->get_position().y))) {
edit_selected();
} else {
emit_signal("item_double_clicked");
@@ -2295,7 +2450,7 @@ void Tree::_gui_input(Ref<InputEvent> p_event) {
case BUTTON_LEFT: {
Ref<StyleBox> bg = cache.bg;
- Point2 pos = b->get_pos() - bg->get_offset();
+ 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();
@@ -2333,7 +2488,7 @@ void Tree::_gui_input(Ref<InputEvent> p_event) {
blocked--;
if (pressing_for_editor) {
- pressing_pos = b->get_pos();
+ pressing_pos = b->get_position();
}
if (b->get_button_index() == BUTTON_RIGHT)
@@ -2401,7 +2556,7 @@ bool Tree::edit_selected() {
edited_item = s;
edited_col = col;
- custom_popup_rect = Rect2i(get_global_position() + 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);
@@ -2416,7 +2571,7 @@ bool Tree::edit_selected() {
}
popup_menu->set_size(Size2(rect.size.width, 0));
- popup_menu->set_position(get_global_position() + 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;
@@ -2424,7 +2579,7 @@ 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_position() + rect.pos;
+ Point2i textedpos = get_global_position() + rect.position;
text_editor->set_position(textedpos);
text_editor->set_size(rect.size);
text_editor->clear();
@@ -2671,7 +2826,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);
}
}
}
@@ -3053,11 +3208,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 {
@@ -3065,7 +3220,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);
}
@@ -3469,6 +3624,7 @@ 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_custom_button_pressed"));
ADD_SIGNAL(MethodInfo("item_double_clicked"));
ADD_SIGNAL(MethodInfo("item_collapsed", PropertyInfo(Variant::OBJECT, "item")));
//ADD_SIGNAL( MethodInfo("item_doubleclicked" ) );
@@ -3575,6 +3731,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 0c07109e7d..59e35bb230 100644
--- a/scene/gui/tree.h
+++ b/scene/gui/tree.h
@@ -58,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;
@@ -81,6 +87,10 @@ private:
bool custom_bg_color;
bool custom_bg_outline;
Color bg_color;
+ bool custom_button;
+ bool expand_right;
+
+ TextAlign text_align;
Variant meta;
String tooltip;
@@ -107,6 +117,7 @@ private:
Cell() {
custom_draw_obj = 0;
+ custom_button = false;
mode = TreeItem::CELL_MODE_STRING;
min = 0;
max = 100;
@@ -120,6 +131,8 @@ private:
custom_bg_color = false;
expr = false;
icon_max_w = 0;
+ text_align = ALIGN_LEFT;
+ expand_right = false;
}
Size2 get_icon_size() const;
@@ -129,6 +142,7 @@ private:
Vector<Cell> cells;
bool collapsed; // wont show childs
+ bool disable_folding;
TreeItem *parent; // parent item
TreeItem *next; // next in list
@@ -238,18 +252,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 {
@@ -369,6 +396,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;
@@ -383,6 +414,7 @@ private:
Color guide_color;
Color drop_position_color;
Color relationship_line_color;
+ Color custom_button_font_highlight;
int hseparation;
int vseparation;
@@ -410,6 +442,9 @@ private:
int hover_index;
Point2 click_pos;
+ TreeItem *hover_item;
+ int hover_cell;
+
} cache;
int _get_title_button_height() const;
diff --git a/scene/main/node.cpp b/scene/main/node.cpp
index 0c65c44392..61e563143c 100755
--- a/scene/main/node.cpp
+++ b/scene/main/node.cpp
@@ -37,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) {
@@ -77,16 +76,6 @@ 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()));
if (data.unhandled_input)
@@ -108,7 +97,6 @@ void Node::_notification(int p_notification) {
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;
@@ -472,69 +460,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 ********/
@@ -962,7 +909,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) {
@@ -982,7 +929,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;
}
}
@@ -1006,16 +953,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) {
@@ -1035,7 +982,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;
}
}
@@ -1059,12 +1006,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;
}
@@ -2845,8 +2792,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);
@@ -2902,10 +2849,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);
@@ -2977,8 +2920,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 4a41fb82ab..7baa65c022 100644
--- a/scene/main/node.h
+++ b/scene/main/node.h
@@ -35,7 +35,7 @@
#include "map.h"
#include "object.h"
#include "path_db.h"
-#include "scene/main/scene_main_loop.h"
+#include "scene/main/scene_tree.h"
#include "script_language.h"
class Viewport;
@@ -61,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)
@@ -122,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;
@@ -173,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;
@@ -393,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
@@ -414,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/scene_main_loop.cpp b/scene/main/scene_tree.cpp
index 96a3519840..1e5735de97 100644
--- a/scene/main/scene_main_loop.cpp
+++ b/scene/main/scene_tree.cpp
@@ -27,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 "scene_main_loop.h"
+#include "scene_tree.h"
#include "global_config.h"
#include "message_queue.h"
@@ -687,7 +687,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: {
@@ -839,12 +841,12 @@ Ref<Material> SceneTree::get_debug_collision_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<SpatialMaterial> mat = memnew(SpatialMaterial);
/*mat->set_flag(Material::FLAG_UNSHADED,true);
@@ -1761,6 +1763,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);
@@ -1971,6 +1983,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);
@@ -1986,7 +1999,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);
@@ -2021,7 +2034,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;
@@ -2058,7 +2071,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;
@@ -2234,6 +2247,7 @@ void SceneTree::_bind_methods() {
ClassDB::bind_method(D_METHOD("set_network_peer", "peer:NetworkedMultiplayerPeer"), &SceneTree::set_network_peer);
ClassDB::bind_method(D_METHOD("is_network_server"), &SceneTree::is_network_server);
ClassDB::bind_method(D_METHOD("has_network_peer"), &SceneTree::has_network_peer);
+ ClassDB::bind_method(D_METHOD("get_network_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);
diff --git a/scene/main/scene_main_loop.h b/scene/main/scene_tree.h
index 5d42c66652..76a4becdbc 100644
--- a/scene/main/scene_main_loop.h
+++ b/scene/main/scene_tree.h
@@ -33,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"
@@ -169,7 +170,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;
@@ -406,7 +407,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; }
@@ -450,6 +451,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/viewport.cpp b/scene/main/viewport.cpp
index f62cebe042..4fb4e02148 100644
--- a/scene/main/viewport.cpp
+++ b/scene/main/viewport.cpp
@@ -49,6 +49,7 @@
#include "scene/scene_string_names.h"
#include "global_config.h"
+#include "scene/3d/scenario_fx.h"
void ViewportTexture::setup_local_to_scene() {
@@ -117,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)
@@ -319,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();
@@ -512,7 +518,7 @@ void Viewport::_notification(int p_what) {
if (mm.is_valid()) {
- pos = mm->get_pos();
+ pos = mm->get_position();
motion_tested = true;
physics_last_mousepos = pos;
}
@@ -520,19 +526,19 @@ void Viewport::_notification(int p_what) {
Ref<InputEventMouseButton> mb = ev;
if (mb.is_valid()) {
- pos = mb->get_pos();
+ pos = mb->get_position();
}
Ref<InputEventScreenDrag> sd = ev;
if (sd.is_valid()) {
- pos = sd->get_pos();
+ pos = sd->get_position();
}
Ref<InputEventScreenTouch> st = ev;
if (st.is_valid()) {
- pos = st->get_pos();
+ pos = st->get_position();
}
if (ss2d) {
@@ -1013,10 +1019,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) {
@@ -1051,10 +1056,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) {
@@ -1152,6 +1156,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 {
@@ -1228,16 +1233,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);
-}
-Ref<Image> Viewport::get_screen_capture() const {
-
- //return VS::get_singleton()->viewport_get_screen_capture(viewport);
- return Ref<Image>();
-}
-
Ref<ViewportTexture> Viewport::get_texture() const {
return default_texture;
@@ -1310,7 +1305,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);
}
@@ -1473,17 +1468,17 @@ void Viewport::_gui_show_tooltip() {
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_position(r.pos);
+ gui.tooltip_popup->set_global_position(r.position);
gui.tooltip_popup->set_size(r.size);
gui.tooltip_popup->raise();
@@ -1685,7 +1680,7 @@ void Viewport::_gui_input_event(Ref<InputEvent> p_event) {
gui.key_event_accepted = false;
- Point2 mpos = mb->get_pos();
+ Point2 mpos = mb->get_position();
if (mb->is_pressed()) {
Size2 pos = mpos;
@@ -1740,11 +1735,11 @@ void Viewport::_gui_input_event(Ref<InputEvent> p_event) {
mb = mb->xformed_by(Transform2D()); // make a copy of the event
- mb->set_global_pos(pos);
+ mb->set_global_position(pos);
pos = gui.focus_inv_xform.xform(pos);
- mb->set_pos(pos);
+ mb->set_position(pos);
#ifdef DEBUG_ENABLED
if (ScriptDebugger::get_singleton()) {
@@ -1841,9 +1836,9 @@ void Viewport::_gui_input_event(Ref<InputEvent> p_event) {
Size2 pos = mpos;
mb = mb->xformed_by(Transform2D()); //make a copy
- mb->set_global_pos(pos);
+ mb->set_global_position(pos);
pos = gui.focus_inv_xform.xform(pos);
- mb->set_pos(pos);
+ mb->set_position(pos);
if (gui.mouse_focus->can_process()) {
_gui_call_input(gui.mouse_focus, mb);
@@ -1869,7 +1864,7 @@ void Viewport::_gui_input_event(Ref<InputEvent> p_event) {
if (mm.is_valid()) {
gui.key_event_accepted = false;
- Point2 mpos = mm->get_pos();
+ Point2 mpos = mm->get_position();
gui.last_mouse_pos = mpos;
@@ -1961,7 +1956,7 @@ void Viewport::_gui_input_event(Ref<InputEvent> p_event) {
mm = mm->xformed_by(Transform2D()); //make a copy
- mm->set_global_pos(mpos);
+ mm->set_global_position(mpos);
mm->set_speed(speed);
mm->set_relative(rel);
@@ -1999,7 +1994,7 @@ void Viewport::_gui_input_event(Ref<InputEvent> p_event) {
//pos = gui.focus_inv_xform.xform(pos);
- mm->set_pos(pos);
+ mm->set_position(pos);
Control::CursorShape cursor_shape = over->get_cursor_shape(pos);
OS::get_singleton()->set_cursor_shape((OS::CursorShape)cursor_shape);
@@ -2318,7 +2313,7 @@ void Viewport::_gui_grab_click_focus(Control *p_control) {
//send unclic
Point2 click = gui.mouse_focus->get_global_transform_with_canvas().affine_inverse().xform(gui.last_mouse_pos);
- mb->set_pos(click);
+ 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);
@@ -2326,7 +2321,7 @@ void Viewport::_gui_grab_click_focus(Control *p_control) {
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->set_pos(click);
+ 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);
@@ -2357,7 +2352,7 @@ void Viewport::unhandled_input(const Ref<InputEvent> &p_event) {
if (physics_object_picking && !get_tree()->input_handled) {
- if (p_event->cast_to<InputEventMouseButton>() || p_event->cast_to<InputEventMouseMotion>() || p_event->cast_to<InputEventScreenDrag>() || p_event->cast_to<InputEventScreenTouch>()) {
+ 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);
}
}
@@ -2516,6 +2511,32 @@ 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_size", "size"), &Viewport::set_size);
@@ -2550,8 +2571,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);
@@ -2569,6 +2588,14 @@ 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("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:ViewportTexture"), &Viewport::get_texture);
ClassDB::bind_method(D_METHOD("set_physics_object_picking", "enable"), &Viewport::set_physics_object_picking);
@@ -2622,6 +2649,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");
@@ -2656,6 +2685,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);
@@ -2730,6 +2772,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 7470cefb49..bd9747d878 100644
--- a/scene/main/viewport.h
+++ b/scene/main/viewport.h
@@ -77,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();
};
@@ -113,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;
@@ -195,6 +222,10 @@ private:
RID texture_rid;
uint32_t texture_flags;
+ DebugDraw debug_draw;
+
+ Usage usage;
+
int shadow_atlas_size;
ShadowAtlasQuadrantSubdiv shadow_atlas_quadrant_subdiv[4];
@@ -382,9 +413,6 @@ public:
Vector2 get_camera_coords(const Vector2 &p_viewport_coords) const;
Vector2 get_camera_rect_size() const;
- void queue_screen_capture();
- Ref<Image> get_screen_capture() const;
-
void set_use_own_world(bool p_world);
bool is_using_own_world() const;
@@ -416,6 +444,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();
};
@@ -423,5 +459,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 0a3f64eacd..76e07db93d 100644
--- a/scene/register_scene_types.cpp
+++ b/scene/register_scene_types.cpp
@@ -42,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"
@@ -74,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"
@@ -112,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"
@@ -129,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"
@@ -172,6 +171,8 @@
#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"
@@ -206,9 +207,7 @@
#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"
@@ -276,7 +275,7 @@ void register_scene_types() {
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));
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));
+ GlobalConfig::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);
@@ -360,9 +359,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>();
@@ -410,7 +406,6 @@ void register_scene_types() {
ClassDB::register_class<Camera>();
ClassDB::register_class<Listener>();
ClassDB::register_class<InterpolatedCamera>();
- ClassDB::register_class<TestCube>();
ClassDB::register_class<MeshInstance>();
ClassDB::register_class<ImmediateGeometry>();
ClassDB::register_class<Sprite3D>();
@@ -426,7 +421,6 @@ void register_scene_types() {
ClassDB::register_class<Portal>();
ClassDB::register_class<Particles>();
ClassDB::register_class<Position3D>();
- ClassDB::register_class<Quad>();
ClassDB::register_class<NavigationMeshInstance>();
ClassDB::register_class<NavigationMesh>();
ClassDB::register_class<Navigation>();
@@ -475,9 +469,12 @@ void register_scene_types() {
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>();
@@ -523,11 +520,20 @@ void register_scene_types() {
ClassDB::register_virtual_class<Shader>();
#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<SpatialMaterial>();
ClassDB::add_compatibility_class("FixedSpatialMaterial", "SpatialMaterial");
+ ClassDB::add_compatibility_class("Mesh", "ArrayMesh");
SceneTree::add_idle_callback(SpatialMaterial::flush_changes);
SpatialMaterial::init_shaders();
@@ -574,6 +580,7 @@ void register_scene_types() {
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>();
@@ -589,7 +596,8 @@ void register_scene_types() {
OS::get_singleton()->yield(); //may take time to init
- ClassDB::register_class<AudioPlayer>();
+ ClassDB::register_class<AudioStreamPlayer>();
+ ClassDB::register_class<AudioStreamPlayer2D>();
ClassDB::register_virtual_class<VideoStream>();
ClassDB::register_class<AudioStreamSample>();
@@ -659,5 +667,6 @@ void unregister_scene_types() {
SpatialMaterial::finish_shaders();
ParticlesMaterial::finish_shaders();
+ CanvasItemMaterial::finish_shaders();
SceneStringNames::free();
}
diff --git a/scene/resources/animation.cpp b/scene/resources/animation.cpp
index 545c700354..459d3ffe41 100644
--- a/scene/resources/animation.cpp
+++ b/scene/resources/animation.cpp
@@ -1133,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;
@@ -1165,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: {
diff --git a/scene/resources/animation.h b/scene/resources/animation.h
index ef5befac65..b363f2b666 100644
--- a/scene/resources/animation.h
+++ b/scene/resources/animation.h
@@ -37,7 +37,7 @@
class Animation : public Resource {
GDCLASS(Animation, Resource);
- RES_BASE_EXTENSION("anm");
+ RES_BASE_EXTENSION("anim");
public:
enum TrackType {
diff --git a/scene/resources/audio_stream_sample.cpp b/scene/resources/audio_stream_sample.cpp
index 4f2ab18637..f12e231074 100644
--- a/scene/resources/audio_stream_sample.cpp
+++ b/scene/resources/audio_stream_sample.cpp
@@ -39,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);
@@ -122,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);
diff --git a/scene/resources/audio_stream_sample.h b/scene/resources/audio_stream_sample.h
index 84d450e3f2..680f037f15 100644
--- a/scene/resources/audio_stream_sample.h
+++ b/scene/resources/audio_stream_sample.h
@@ -53,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;
@@ -84,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/bit_mask.cpp b/scene/resources/bit_mask.cpp
index e512f8a968..a473067937 100644
--- a/scene/resources/bit_mask.cpp
+++ b/scene/resources/bit_mask.cpp
@@ -67,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/box_shape.cpp b/scene/resources/box_shape.cpp
index fedfc71313..d5c25b718e 100644
--- a/scene/resources/box_shape.cpp
+++ b/scene/resources/box_shape.cpp
@@ -34,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/capsule_shape_2d.cpp b/scene/resources/capsule_shape_2d.cpp
index 3f41526bcb..20177692a1 100644
--- a/scene/resources/capsule_shape_2d.cpp
+++ b/scene/resources/capsule_shape_2d.cpp
@@ -80,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/circle_shape_2d.cpp b/scene/resources/circle_shape_2d.cpp
index 4512e1c4a9..1b7e09ddfb 100644
--- a/scene/resources/circle_shape_2d.cpp
+++ b/scene/resources/circle_shape_2d.cpp
@@ -58,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/concave_polygon_shape_2d.cpp b/scene/resources/concave_polygon_shape_2d.cpp
index 653540a663..b8c931421e 100644
--- a/scene/resources/concave_polygon_shape_2d.cpp
+++ b/scene/resources/concave_polygon_shape_2d.cpp
@@ -68,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/convex_polygon_shape_2d.cpp b/scene/resources/convex_polygon_shape_2d.cpp
index fcbf66c8cd..e13f7faf70 100644
--- a/scene/resources/convex_polygon_shape_2d.cpp
+++ b/scene/resources/convex_polygon_shape_2d.cpp
@@ -78,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/curve.cpp b/scene/resources/curve.cpp
index 10c12c9411..338311b87b 100644
--- a/scene/resources/curve.cpp
+++ b/scene/resources/curve.cpp
@@ -380,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();
diff --git a/scene/resources/curve.h b/scene/resources/curve.h
index 17c0ac9f5e..83a4357bfb 100644
--- a/scene/resources/curve.h
+++ b/scene/resources/curve.h
@@ -82,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_interval);
+ 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);
diff --git a/scene/resources/default_theme/default_theme.cpp b/scene/resources/default_theme/default_theme.cpp
index 7e5065a03b..d70d91a17e 100644
--- a/scene/resources/default_theme/default_theme.cpp
+++ b/scene/resources/default_theme/default_theme.cpp
@@ -138,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);
@@ -170,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]);
@@ -510,20 +510,24 @@ void fill_default_theme(Ref<Theme> &t, const Ref<Font> &default_font, const Ref<
t->set_stylebox("slider", "HSlider", make_stylebox(hslider_bg_png, 4, 4, 4, 4));
t->set_stylebox("grabber_highlight", "HSlider", make_stylebox(hslider_grabber_hl_png, 6, 6, 6, 6));
+ t->set_stylebox("grabber_disabled", "HSlider", make_stylebox(hslider_grabber_disabled_png, 6, 6, 6, 6));
t->set_stylebox("focus", "HSlider", focus);
t->set_icon("grabber", "HSlider", make_icon(hslider_grabber_png));
t->set_icon("grabber_highlight", "HSlider", make_icon(hslider_grabber_hl_png));
+ t->set_icon("grabber_disabled", "HSlider", make_icon(hslider_grabber_disabled_png));
t->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_highlight", "VSlider", make_stylebox(vslider_grabber_hl_png, 6, 6, 6, 6));
+ t->set_stylebox("grabber_disabled", "VSlider", make_stylebox(vslider_grabber_disabled_png, 6, 6, 6, 6));
t->set_stylebox("focus", "HSlider", focus);
t->set_icon("grabber", "VSlider", make_icon(vslider_grabber_png));
t->set_icon("grabber_highlight", "VSlider", make_icon(vslider_grabber_hl_png));
+ t->set_icon("grabber_disabled", "VSlider", make_icon(vslider_grabber_disabled_png));
t->set_icon("tick", "VSlider", make_icon(vslider_tick_png));
// SpinBox
@@ -626,6 +630,9 @@ void fill_default_theme(Ref<Theme> &t, const Ref<Font> &default_font, const Ref<
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_stylebox("custom_button", "Tree", sb_button_normal);
+ t->set_stylebox("custom_button_pressed", "Tree", sb_button_pressed);
+ t->set_stylebox("custom_button_hover", "Tree", sb_button_hover);
t->set_icon("checked", "Tree", make_icon(checked_png));
t->set_icon("unchecked", "Tree", make_icon(unchecked_png));
@@ -645,6 +652,7 @@ void fill_default_theme(Ref<Theme> &t, const Ref<Font> &default_font, const Ref<
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_color("custom_button_font_highlight", "Tree", control_font_color_hover);
t->set_constant("hseparation", "Tree", 4 * scale);
t->set_constant("vseparation", "Tree", 4 * scale);
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/theme_data.h b/scene/resources/default_theme/theme_data.h
index b9c401525a..70a8ad12cb 100644
--- a/scene/resources/default_theme/theme_data.h
+++ b/scene/resources/default_theme/theme_data.h
@@ -138,6 +138,10 @@ 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_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_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
};
@@ -434,6 +438,10 @@ 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_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 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
};
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/environment.cpp b/scene/resources/environment.cpp
index 66f913f347..33e62e3a00 100644
--- a/scene/resources/environment.cpp
+++ b/scene/resources/environment.cpp
@@ -217,6 +217,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 {
@@ -283,12 +284,39 @@ void Environment::_validate_property(PropertyInfo &property) const {
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 {
@@ -299,57 +327,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 {
@@ -360,6 +378,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 {
@@ -452,7 +471,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 {
@@ -469,7 +489,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 {
@@ -482,7 +502,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 {
@@ -492,18 +512,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 {
@@ -514,29 +534,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 {
@@ -546,7 +566,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 {
@@ -558,6 +578,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 {
@@ -610,6 +631,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 {
@@ -661,10 +683,142 @@ 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_sky", "sky:CubeMap"), &Environment::set_sky);
+ ClassDB::bind_method(D_METHOD("set_sky", "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);
@@ -695,6 +849,60 @@ void Environment::_bind_methods() {
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_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);
@@ -736,28 +944,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);
@@ -835,7 +1039,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");
@@ -860,8 +1064,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);
@@ -883,7 +1087,7 @@ 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");
@@ -961,10 +1165,9 @@ Environment::Environment() {
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;
@@ -982,7 +1185,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;
@@ -997,6 +1200,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 d9141ccd9c..a7c0e2a03d 100644
--- a/scene/resources/environment.h
+++ b/scene/resources/environment.h
@@ -100,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;
@@ -122,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;
@@ -138,6 +137,23 @@ 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;
@@ -208,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_transition);
+ 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_transition);
+ 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;
@@ -262,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;
@@ -307,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 692dc47677..225a42f651 100644
--- a/scene/resources/font.cpp
+++ b/scene/resources/font.cpp
@@ -120,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);
@@ -272,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"))
diff --git a/scene/resources/font.h b/scene/resources/font.h
index 20978acccd..a04ffbdd4b 100644
--- a/scene/resources/font.h
+++ b/scene/resources/font.h
@@ -66,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/material.cpp b/scene/resources/material.cpp
index 9184b86237..705702b8be 100644
--- a/scene/resources/material.cpp
+++ b/scene/resources/material.cpp
@@ -30,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"), &Material::set_next_pass);
+ ClassDB::bind_method(D_METHOD("get_next_pass:Material"), &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();
@@ -49,7 +74,7 @@ Material::~Material() {
bool ShaderMaterial::_set(const StringName &p_name, const Variant &p_value) {
- if (p_name == SceneStringNames::get_singleton()->shader_shader) {
+ if (p_name == SceneStringNames::get_singleton()->shader) {
set_shader(p_value);
return true;
} else {
@@ -75,7 +100,7 @@ bool ShaderMaterial::_set(const StringName &p_name, const Variant &p_value) {
bool ShaderMaterial::_get(const StringName &p_name, Variant &r_ret) const {
- if (p_name == SceneStringNames::get_singleton()->shader_shader) {
+ if (p_name == SceneStringNames::get_singleton()->shader) {
r_ret = get_shader();
return true;
@@ -97,7 +122,7 @@ bool ShaderMaterial::_get(const StringName &p_name, Variant &r_ret) const {
void ShaderMaterial::_get_property_list(List<PropertyInfo> *p_list) const {
- p_list->push_back(PropertyInfo(Variant::OBJECT, "shader/shader", PROPERTY_HINT_RESOURCE_TYPE, "Shader,ShaderGraph"));
+ p_list->push_back(PropertyInfo(Variant::OBJECT, "shader", PROPERTY_HINT_RESOURCE_TYPE, "Shader,ShaderGraph"));
if (!shader.is_null()) {
@@ -190,19 +215,24 @@ void SpatialMaterial::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->texture_names[TEXTURE_ALBEDO] = "texture_albedo";
shader_names->texture_names[TEXTURE_METALLIC] = "texture_metallic";
@@ -213,7 +243,7 @@ void SpatialMaterial::init_shaders() {
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_DETAIL_MASK] = "texture_detail_mask";
@@ -266,7 +296,12 @@ void SpatialMaterial::_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;
@@ -278,6 +313,20 @@ void SpatialMaterial::_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";
@@ -286,21 +335,23 @@ void SpatialMaterial::_update_shader() {
code += ",ontop";
}
+ 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";
code += "uniform float specular;\n";
code += "uniform float metallic;\n";
+ if (grow_enabled) {
+ code += "uniform float grow;\n";
+ }
code += "uniform float roughness : hint_range(0,1);\n";
code += "uniform float point_size : hint_range(0,128);\n";
code += "uniform sampler2D texture_metallic : hint_white;\n";
code += "uniform sampler2D texture_roughness : 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";
if (billboard_mode == BILLBOARD_PARTICLES) {
code += "uniform int particles_anim_h_frames;\n";
code += "uniform int particles_anim_v_frames;\n";
@@ -314,6 +365,11 @@ void SpatialMaterial::_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";
+ }
+
if (features[FEATURE_NORMAL_MAPPING]) {
code += "uniform sampler2D texture_normal : hint_normal;\n";
code += "uniform float normal_scale : hint_range(-16,16);\n";
@@ -348,6 +404,33 @@ void SpatialMaterial::_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";
@@ -360,7 +443,10 @@ void SpatialMaterial::_update_shader() {
code += "\tPOINT_SIZE=point_size;\n";
}
- code += "\tUV=UV*uv1_scale+uv1_offset;\n";
+
+ if (!flags[FLAG_UV1_USE_TRIPLANAR]) {
+ code += "\tUV=UV*uv1_scale.xy+uv1_offset.xy;\n";
+ }
switch (billboard_mode) {
case BILLBOARD_DISABLED: {
@@ -390,7 +476,6 @@ void SpatialMaterial::_update_shader() {
//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;
}
@@ -413,18 +498,109 @@ void SpatialMaterial::_update_shader() {
code += "\t}\n";
}
- if (detail_uv == DETAIL_UV_2) {
+ 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]) {
@@ -432,52 +608,133 @@ void SpatialMaterial::_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 = triplanar_texture(texture_metallic,uv1_power_normal,uv1_world_pos).r;\n";
+ } else {
+ code += "\tfloat metallic_tex = texture(texture_metallic,base_uv).r;\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 = triplanar_texture(texture_roughness,uv1_power_normal,uv1_world_pos).r;\n";
+ } else {
+ code += "\tfloat roughness_tex = texture(texture_roughness,base_uv).r;\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 * texture(texture_refraction,base_uv).r * 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]) {
+ 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 = triplanar_texture(texture_ambient_occlusion,uv2_power_normal,uv2_world_pos).r;\n";
+ } else {
+ code += "\tAO = texture(texture_ambient_occlusion,base_uv2).r;\n";
+ }
+ } else {
+ if (flags[FLAG_UV1_USE_TRIPLANAR]) {
+ code += "\tAO = triplanar_texture(texture_ambient_occlusion,uv1_power_normal,uv1_world_pos).r;\n";
+ } else {
+ code += "\tAO = texture(texture_ambient_occlusion,base_uv).r;\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: {
@@ -495,17 +752,10 @@ void SpatialMaterial::_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";
}
- code += "\tfloat metallic_tex = texture(texture_metallic,UV).r;\n";
- code += "\tMETALLIC = metallic_tex * metallic;\n";
- code += "\tfloat roughness_tex = texture(texture_roughness,UV).r;\n";
- code += "\tROUGHNESS = roughness_tex * roughness;\n";
- code += "\tSPECULAR = specular;\n";
-
code += "}\n";
ShaderData shader_data;
@@ -687,15 +937,15 @@ float SpatialMaterial::get_anisotropy() const {
return anisotropy;
}
-void SpatialMaterial::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 SpatialMaterial::get_height_scale() const {
+float SpatialMaterial::get_depth_scale() const {
- return height_scale;
+ return depth_scale;
}
void SpatialMaterial::set_subsurface_scattering_strength(float p_subsurface_scattering_strength) {
@@ -720,16 +970,6 @@ float SpatialMaterial::get_refraction() const {
return refraction;
}
-void SpatialMaterial::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 SpatialMaterial::get_refraction_roughness() const {
-
- return refraction_roughness;
-}
-
void SpatialMaterial::set_detail_uv(DetailUV p_detail_uv) {
if (detail_uv == p_detail_uv)
@@ -805,6 +1045,19 @@ SpatialMaterial::DiffuseMode SpatialMaterial::get_diffuse_mode() const {
return diffuse_mode;
}
+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);
@@ -857,6 +1110,9 @@ void SpatialMaterial::_validate_feature(const String &text, Feature feature, Pro
if (property.name.begins_with(text) && property.name != text + "_enabled" && !features[feature]) {
property.usage = 0;
}
+ if ((property.name == "depth_min_layers" || property.name == "depth_max_layers") && !deep_parallax) {
+ property.usage = 0;
+ }
}
void SpatialMaterial::_validate_property(PropertyInfo &property) const {
@@ -866,7 +1122,7 @@ void SpatialMaterial::_validate_property(PropertyInfo &property) const {
_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);
@@ -874,6 +1130,10 @@ void SpatialMaterial::_validate_property(PropertyInfo &property) const {
if (property.name.begins_with("particles_anim_") && billboard_mode != BILLBOARD_PARTICLES) {
property.usage = 0;
}
+
+ if (property.name == "params_grow_amount" && !grow_enabled) {
+ property.usage = 0;
+ }
}
void SpatialMaterial::set_line_width(float p_line_width) {
@@ -898,49 +1158,71 @@ float SpatialMaterial::get_point_size() const {
return point_size;
}
-void SpatialMaterial::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 SpatialMaterial::get_uv1_scale() const {
+Vector3 SpatialMaterial::get_uv1_scale() const {
return uv1_scale;
}
-void SpatialMaterial::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 SpatialMaterial::get_uv1_offset() const {
+Vector3 SpatialMaterial::get_uv1_offset() const {
return uv1_offset;
}
-void SpatialMaterial::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 SpatialMaterial::get_uv2_scale() const {
+Vector3 SpatialMaterial::get_uv2_scale() const {
return uv2_scale;
}
-void SpatialMaterial::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 SpatialMaterial::get_uv2_offset() const {
+Vector3 SpatialMaterial::get_uv2_offset() const {
return uv2_offset;
}
+void SpatialMaterial::set_uv2_triplanar_blend_sharpness(float p_sharpness) {
+
+ uv2_triplanar_sharpness = p_sharpness;
+ VS::get_singleton()->material_set_param(_get_material(), shader_names->uv2_blend_sharpness, p_sharpness);
+}
+
+float SpatialMaterial::get_uv2_triplanar_blend_sharpness() const {
+
+ return uv2_triplanar_sharpness;
+}
+
void SpatialMaterial::set_billboard_mode(BillboardMode p_mode) {
billboard_mode = p_mode;
@@ -985,6 +1267,58 @@ int SpatialMaterial::get_particles_anim_loop() const {
return particles_anim_loop;
}
+void SpatialMaterial::set_depth_deep_parallax(bool p_enable) {
+
+ deep_parallax = p_enable;
+ _queue_shader_change();
+ _change_notify();
+}
+
+bool SpatialMaterial::is_depth_deep_parallax_enabled() const {
+
+ return deep_parallax;
+}
+
+void SpatialMaterial::set_depth_deep_parallax_min_layers(int p_layer) {
+
+ 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 {
+
+ return deep_parallax_min_layers;
+}
+
+void SpatialMaterial::set_depth_deep_parallax_max_layers(int p_layer) {
+
+ 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 {
+
+ return deep_parallax_max_layers;
+}
+
+void SpatialMaterial::set_grow_enabled(bool p_enable) {
+ grow_enabled = p_enable;
+ _queue_shader_change();
+ _change_notify();
+}
+
+bool SpatialMaterial::is_grow_enabled() const {
+ return grow_enabled;
+}
+
+void SpatialMaterial::set_grow(float p_grow) {
+ grow = p_grow;
+ VS::get_singleton()->material_set_param(_get_material(), shader_names->grow, p_grow);
+}
+
+float SpatialMaterial::get_grow() const {
+
+ return grow;
+}
+
void SpatialMaterial::_bind_methods() {
ClassDB::bind_method(D_METHOD("set_albedo", "albedo"), &SpatialMaterial::set_albedo);
@@ -1023,8 +1357,8 @@ void SpatialMaterial::_bind_methods() {
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_height_scale", "height_scale"), &SpatialMaterial::set_height_scale);
- ClassDB::bind_method(D_METHOD("get_height_scale"), &SpatialMaterial::get_height_scale);
+ 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);
@@ -1032,9 +1366,6 @@ void SpatialMaterial::_bind_methods() {
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_refraction_roughness", "refraction_roughness"), &SpatialMaterial::set_refraction_roughness);
- ClassDB::bind_method(D_METHOD("get_refraction_roughness"), &SpatialMaterial::get_refraction_roughness);
-
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);
@@ -1056,6 +1387,9 @@ void SpatialMaterial::_bind_methods() {
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"), &SpatialMaterial::get_flag);
@@ -1074,12 +1408,18 @@ void SpatialMaterial::_bind_methods() {
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);
@@ -1092,6 +1432,21 @@ void SpatialMaterial::_bind_methods() {
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_grow_enabled", "enable"), &SpatialMaterial::set_grow_enabled);
+ ClassDB::bind_method(D_METHOD("is_grow_enabled"), &SpatialMaterial::is_grow_enabled);
+
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);
@@ -1103,13 +1458,16 @@ void SpatialMaterial::_bind_methods() {
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, "Lambert,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_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");
@@ -1120,17 +1478,17 @@ void SpatialMaterial::_bind_methods() {
ADD_PROPERTYI(PropertyInfo(Variant::OBJECT, "albedo_texture", PROPERTY_HINT_RESOURCE_TYPE, "Texture"), "set_texture", "get_texture", TEXTURE_ALBEDO);
ADD_GROUP("Metallic", "metallic_");
- ADD_PROPERTY(PropertyInfo(Variant::REAL, "metallic_amount", PROPERTY_HINT_RANGE, "0,1,0.01"), "set_metallic", "get_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_GROUP("Roughness", "roughness_");
- ADD_PROPERTY(PropertyInfo(Variant::REAL, "roughness_amount", PROPERTY_HINT_RANGE, "0,1,0.01"), "set_roughness", "get_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_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);
@@ -1141,29 +1499,33 @@ void SpatialMaterial::_bind_methods() {
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_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);
@@ -1172,8 +1534,7 @@ void SpatialMaterial::_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_GROUP("Detail", "detail_");
@@ -1185,12 +1546,16 @@ void SpatialMaterial::_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_METALLIC);
@@ -1201,7 +1566,7 @@ void SpatialMaterial::_bind_methods() {
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_DETAIL_MASK);
@@ -1219,7 +1584,7 @@ void SpatialMaterial::_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);
@@ -1248,9 +1613,16 @@ void SpatialMaterial::_bind_methods() {
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);
@@ -1274,21 +1646,29 @@ SpatialMaterial::SpatialMaterial()
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);
+ 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;
detail_blend_mode = BLEND_MODE_MIX;
@@ -1298,6 +1678,7 @@ SpatialMaterial::SpatialMaterial()
flags[i] = 0;
}
diffuse_mode = DIFFUSE_LAMBERT;
+ specular_mode = SPECULAR_SCHLICK_GGX;
for (int i = 0; i < FEATURE_MAX; i++) {
features[i] = false;
diff --git a/scene/resources/material.h b/scene/resources/material.h
index f974db0aa7..276064bce4 100644
--- a/scene/resources/material.h
+++ b/scene/resources/material.h
@@ -42,16 +42,21 @@
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();
@@ -97,7 +102,7 @@ public:
TEXTURE_CLEARCOAT,
TEXTURE_FLOWMAP,
TEXTURE_AMBIENT_OCCLUSION,
- TEXTURE_HEIGHT,
+ TEXTURE_DEPTH,
TEXTURE_SUBSURFACE_SCATTERING,
TEXTURE_REFRACTION,
TEXTURE_DETAIL_MASK,
@@ -120,7 +125,7 @@ public:
FEATURE_CLEARCOAT,
FEATURE_ANISOTROPY,
FEATURE_AMBIENT_OCCLUSION,
- FEATURE_HEIGHT_MAPPING,
+ FEATURE_DEPTH_MAPPING,
FEATURE_SUBSURACE_SCATTERING,
FEATURE_REFRACTION,
FEATURE_DETAIL,
@@ -155,14 +160,26 @@ public:
FLAG_SRGB_VERTEX_COLOR,
FLAG_USE_POINT_SIZE,
FLAG_FIXED_SIZE,
+ FLAG_UV1_USE_TRIPLANAR,
+ FLAG_UV2_USE_TRIPLANAR,
+ FLAG_AO_ON_UV2,
FLAG_MAX
};
enum DiffuseMode {
DIFFUSE_LAMBERT,
- DIFFUSE_LAMBERT_WRAP,
+ DIFFUSE_HALF_LAMBERT,
DIFFUSE_OREN_NAYAR,
DIFFUSE_BURLEY,
+ DIFFUSE_TOON,
+ };
+
+ enum SpecularMode {
+ SPECULAR_SCHLICK_GGX,
+ SPECULAR_BLINN,
+ SPECULAR_PHONG,
+ SPECULAR_TOON,
+ SPECULAR_DISABLED,
};
enum BillboardMode {
@@ -176,20 +193,22 @@ private:
union MaterialKey {
struct {
- uint32_t feature_mask : 11;
- uint32_t detail_uv : 1;
- uint32_t blend_mode : 2;
- uint32_t depth_draw_mode : 2;
- uint32_t cull_mode : 2;
- uint32_t flags : 6;
- uint32_t detail_blend_mode : 2;
- uint32_t diffuse_mode : 2;
- uint32_t invalid_key : 1;
- uint32_t specular_mode : 1;
- uint32_t billboard_mode : 2;
+ 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 : 9;
+ 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;
@@ -225,7 +244,10 @@ 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;
}
@@ -243,10 +265,9 @@ 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;
@@ -255,6 +276,12 @@ private:
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 texture_names[TEXTURE_MAX];
};
@@ -280,29 +307,37 @@ 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;
+ 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];
+ SpecularMode specular_mode;
DiffuseMode diffuse_mode;
BillboardMode billboard_mode;
@@ -353,8 +388,17 @@ 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_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_strength);
float get_subsurface_scattering_strength() const;
@@ -362,9 +406,6 @@ public:
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;
@@ -389,6 +430,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;
@@ -398,17 +442,23 @@ 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_offset(const Vector2 &p_offset);
- Vector2 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 Vector2 &p_scale);
- Vector2 get_uv2_scale() const;
+ void set_uv2_scale(const Vector3 &p_scale);
+ Vector3 get_uv2_scale() const;
- void set_uv2_offset(const Vector2 &p_offset);
- Vector2 get_uv2_offset() 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_billboard_mode(BillboardMode p_mode);
BillboardMode get_billboard_mode() const;
@@ -421,6 +471,12 @@ public:
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;
+
static void init_shaders();
static void finish_shaders();
static void flush_changes();
@@ -437,6 +493,7 @@ 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)
//////////////////////
diff --git a/scene/resources/mesh.cpp b/scene/resources/mesh.cpp
index 4846d84b33..ef7011b2af 100644
--- a/scene/resources/mesh.cpp
+++ b/scene/resources/mesh.cpp
@@ -32,6 +32,390 @@
#include "scene/resources/convex_polygon_shape.h"
#include "surface_tool.h"
+void Mesh::_clear_triangle_mesh() {
+
+ 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;
+}
+
+Mesh::Mesh() {
+}
+
static const char *_array_name[] = {
"vertex_array",
"normal_array",
@@ -45,34 +429,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;
@@ -191,7 +575,7 @@ 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;
@@ -270,7 +654,7 @@ 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;
@@ -284,13 +668,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();
@@ -304,16 +692,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);
@@ -324,7 +714,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();
@@ -335,38 +726,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.");
@@ -389,15 +781,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.");
@@ -407,54 +799,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)
@@ -465,40 +857,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]);
}
@@ -510,7 +902,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();
@@ -518,129 +910,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;
@@ -668,13 +958,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);
}
@@ -685,315 +975,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);
- }
+ surfs[i]->commit(Ref<ArrayMesh>(this));
}
-
- 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;
- }
- }
- }
- }
-
- {
- 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("create_trimesh_shape:Shape"), &Mesh::create_trimesh_shape);
- ClassDB::bind_method(D_METHOD("create_convex_shape:Shape"), &Mesh::create_convex_shape);
- ClassDB::bind_method(D_METHOD("create_outline:Mesh", "margin"), &Mesh::create_outline);
- 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:Material"), &ArrayMesh::surface_set_material);
+ ClassDB::bind_method(D_METHOD("surface_get_material: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:Shape"), &ArrayMesh::create_trimesh_shape);
+ ClassDB::bind_method(D_METHOD("create_convex_shape:Shape"), &ArrayMesh::create_convex_shape);
+ ClassDB::bind_method(D_METHOD("create_outline:ArrayMesh", "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"), &Mesh::get_faces);
- ClassDB::bind_method(D_METHOD("generate_triangle_mesh:TriangleMesh"), &Mesh::generate_triangle_mesh);
+ ClassDB::bind_method(D_METHOD("get_faces"), &ArrayMesh::get_faces);
+ ClassDB::bind_method(D_METHOD("generate_triangle_mesh:TriangleMesh"), &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);
@@ -1027,81 +1044,13 @@ void Mesh::_bind_methods() {
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);
}
-
-////////////////////////
-
-void QuadMesh::_bind_methods() {
-
- ClassDB::bind_method(D_METHOD("set_material", "material:Material"), &QuadMesh::set_material);
- ClassDB::bind_method(D_METHOD("get_material:Material"), &QuadMesh::get_material);
-
- ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "material", PROPERTY_HINT_RESOURCE_TYPE, "Material"), "set_material", "get_material");
-}
-
-void QuadMesh::set_material(const Ref<Material> &p_material) {
-
- surface_set_material(0, p_material);
-}
-
-Ref<Material> QuadMesh::get_material() const {
-
- return surface_get_material(0);
-}
-
-QuadMesh::QuadMesh() {
-
- 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]);
- }
-
- Array arr;
- arr.resize(ARRAY_MAX);
- arr[ARRAY_VERTEX] = faces;
- arr[ARRAY_NORMAL] = normals;
- arr[ARRAY_TANGENT] = tangents;
- arr[ARRAY_TEX_UV] = uvs;
-
- add_surface_from_arrays(PRIMITIVE_TRIANGLE_FAN, arr);
-}
diff --git a/scene/resources/mesh.h b/scene/resources/mesh.h
index e441b4924a..f716b59fe9 100644
--- a/scene/resources/mesh.h
+++ b/scene/resources/mesh.h
@@ -38,10 +38,13 @@
/**
@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();
public:
enum {
@@ -111,11 +114,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;
@@ -124,8 +156,6 @@ private:
Vector<StringName> blend_shapes;
Rect3 custom_aabb;
- mutable Ref<TriangleMesh> triangle_mesh;
-
void _recompute_aabb();
protected:
@@ -177,33 +207,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();
-
- ~Mesh();
-};
-
-class QuadMesh : public Mesh {
-
- GDCLASS(QuadMesh, Mesh)
+ ArrayMesh();
-protected:
- virtual bool _is_generated() const { return true; }
- static void _bind_methods();
-
-public:
- void set_material(const Ref<Material> &p_material);
- Ref<Material> get_material() const;
- QuadMesh();
+ ~ArrayMesh();
};
VARIANT_ENUM_CAST(Mesh::ArrayType);
diff --git a/scene/resources/mesh_data_tool.cpp b/scene/resources/mesh_data_tool.cpp
index b6b47bf443..dc3713fb57 100644
--- a/scene/resources/mesh_data_tool.cpp
+++ b/scene/resources/mesh_data_tool.cpp
@@ -38,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);
@@ -179,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;
@@ -309,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);
diff --git a/scene/resources/mesh_data_tool.h b/scene/resources/mesh_data_tool.h
index f6797d3e5e..ad771edbd1 100644
--- a/scene/resources/mesh_data_tool.h
+++ b/scene/resources/mesh_data_tool.h
@@ -78,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.h b/scene/resources/mesh_library.h
index a381f54a19..cc39110a99 100644
--- a/scene/resources/mesh_library.h
+++ b/scene/resources/mesh_library.h
@@ -39,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.h b/scene/resources/multimesh.h
index 4a00685b9f..7d6a0ce44f 100644
--- a/scene/resources/multimesh.h
+++ b/scene/resources/multimesh.h
@@ -36,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/polygon_path_finder.cpp b/scene/resources/polygon_path_finder.cpp
index 472031366f..80b413630a 100644
--- a/scene/resources/polygon_path_finder.cpp
+++ b/scene/resources/polygon_path_finder.cpp
@@ -71,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/primitive_meshes.cpp b/scene/resources/primitive_meshes.cpp
new file mode 100644
index 0000000000..81cfd0e5f0
--- /dev/null
+++ b/scene/resources/primitive_meshes.cpp
@@ -0,0 +1,1466 @@
+/*************************************************************************/
+/* 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() {
+ if (!cache_is_dirty)
+ return;
+
+ Array arr;
+ arr.resize(VS::ARRAY_MAX);
+ _create_mesh_array(arr);
+
+ // 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());
+
+ cache_is_dirty = false;
+
+ _clear_triangle_mesh();
+ emit_changed();
+}
+
+void PrimitiveMesh::_queue_update(bool p_first_mesh) {
+
+ if (first_mesh && p_first_mesh) {
+ first_mesh = false;
+ cache_is_dirty = true;
+ _update();
+ return;
+ }
+
+ if (!cache_is_dirty) {
+ cache_is_dirty = true;
+ call_deferred("_update");
+ }
+}
+
+void PrimitiveMesh::set_aabb(Rect3 p_aabb) {
+ aabb = p_aabb;
+}
+
+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);
+ 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);
+ 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());
+ 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);
+ 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 {
+ return aabb;
+}
+
+RID PrimitiveMesh::get_rid() const {
+ return mesh;
+}
+
+void PrimitiveMesh::_bind_methods() {
+ ClassDB::bind_method(D_METHOD("_update"), &PrimitiveMesh::_update);
+
+ ClassDB::bind_method(D_METHOD("set_material", "material:Material"), &PrimitiveMesh::set_material);
+ ClassDB::bind_method(D_METHOD("get_material: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 (!cache_is_dirty) {
+ // 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
+ cache_is_dirty = false;
+ first_mesh = true;
+ _queue_update();
+}
+
+PrimitiveMesh::~PrimitiveMesh() {
+ VisualServer::get_singleton()->free(mesh);
+}
+
+/**
+ CapsuleMesh
+*/
+
+void CapsuleMesh::_create_mesh_array(Array &p_arr) {
+ 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
+
+ set_aabb(Rect3(Vector3(-radius, -radius, (mid_height * -0.5) - radius), Vector3(radius * 2.0, radius * 2.0, mid_height + (2.0 * 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);
+
+ /* 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;
+ _queue_update();
+}
+
+float CapsuleMesh::get_radius() const {
+ return radius;
+}
+
+void CapsuleMesh::set_mid_height(const float p_mid_height) {
+ mid_height = p_mid_height;
+ _queue_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;
+ _queue_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;
+ _queue_update(true); //last property set, force update mesh
+}
+
+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) {
+ 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
+ set_aabb(Rect3(start_pos, size));
+
+ 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;
+ _queue_update();
+}
+
+Vector3 CubeMesh::get_size() const {
+ return size;
+}
+
+void CubeMesh::set_subdivide_width(const int p_subdivide) {
+ subdivide_w = p_subdivide > 0 ? p_subdivide : 0;
+ _queue_update();
+}
+
+int CubeMesh::get_subdivide_width() const {
+ return subdivide_w;
+}
+
+void CubeMesh::set_subdivide_height(const int p_subdivide) {
+ subdivide_h = p_subdivide > 0 ? p_subdivide : 0;
+ _queue_update();
+}
+
+int CubeMesh::get_subdivide_height() const {
+ return subdivide_h;
+}
+
+void CubeMesh::set_subdivide_depth(const int p_subdivide) {
+ subdivide_d = p_subdivide > 0 ? p_subdivide : 0;
+ _queue_update(true); //last property set, force update mesh
+}
+
+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) {
+ int i, j, prevrow, thisrow, point;
+ float x, y, z, u, v, radius;
+
+ radius = bottom_radius > top_radius ? bottom_radius : top_radius;
+
+ set_aabb(Rect3(Vector3(-radius, height * -0.5, -radius), Vector3(radius * 2.0, height, radius * 2.0)));
+
+ 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;
+ _queue_update();
+}
+
+float CylinderMesh::get_top_radius() const {
+ return top_radius;
+}
+
+void CylinderMesh::set_bottom_radius(const float p_radius) {
+ bottom_radius = p_radius;
+ _queue_update();
+}
+
+float CylinderMesh::get_bottom_radius() const {
+ return bottom_radius;
+}
+
+void CylinderMesh::set_height(const float p_height) {
+ height = p_height;
+ _queue_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;
+ _queue_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;
+ _queue_update(true); //last property set, force update mesh
+}
+
+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) {
+ int i, j, prevrow, thisrow, point;
+ float x, z;
+
+ Size2 start_pos = size * -0.5;
+
+ set_aabb(Rect3(Vector3(start_pos.x, 0.0, start_pos.y), Vector3(size.x, 0.0, size.y)));
+
+ 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;
+ _queue_update();
+}
+
+Size2 PlaneMesh::get_size() const {
+ return size;
+}
+
+void PlaneMesh::set_subdivide_width(const int p_subdivide) {
+ subdivide_w = p_subdivide > 0 ? p_subdivide : 0;
+ _queue_update();
+}
+
+int PlaneMesh::get_subdivide_width() const {
+ return subdivide_w;
+}
+
+void PlaneMesh::set_subdivide_depth(const int p_subdivide) {
+ subdivide_d = p_subdivide > 0 ? p_subdivide : 0;
+ _queue_update(true); //last property set, force update mesh
+}
+
+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) {
+ 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
+ set_aabb(Rect3(start_pos, size));
+
+ 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;
+ _queue_update();
+}
+
+float PrismMesh::get_left_to_right() const {
+ return left_to_right;
+}
+
+void PrismMesh::set_size(const Vector3 &p_size) {
+ size = p_size;
+ _queue_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;
+ _queue_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;
+ _queue_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;
+ _queue_update(true); //last property set, force update mesh
+}
+
+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) {
+ 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;
+ _queue_update(true);
+}
+
+/**
+ SphereMesh
+*/
+
+void SphereMesh::_create_mesh_array(Array &p_arr) {
+ int i, j, prevrow, thisrow, point;
+ float x, y, z;
+
+ // set our bounding box
+ set_aabb(Rect3(Vector3(-radius, height * -0.5, -radius), Vector3(radius * 2.0, height, radius * 2.0)));
+
+ 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;
+ _queue_update();
+}
+
+float SphereMesh::get_radius() const {
+ return radius;
+}
+
+void SphereMesh::set_height(const float p_height) {
+ height = p_height;
+ _queue_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;
+ _queue_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;
+ _queue_update();
+}
+
+int SphereMesh::get_rings() const {
+ return rings;
+}
+
+void SphereMesh::set_is_hemisphere(const bool p_is_hemisphere) {
+ is_hemisphere = p_is_hemisphere;
+ _queue_update(true); //last property set, force update mesh
+}
+
+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..5e1387e864
--- /dev/null
+++ b/scene/resources/primitive_meshes.h
@@ -0,0 +1,313 @@
+/*************************************************************************/
+/* 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;
+ Rect3 aabb;
+
+ Ref<Material> material;
+
+ bool first_mesh;
+ bool cache_is_dirty;
+ void _update();
+
+protected:
+ Mesh::PrimitiveType primitive_type;
+
+ static void _bind_methods();
+
+ virtual void _create_mesh_array(Array &p_arr) = 0;
+ void _queue_update(bool p_first_mesh = false); //pretty bad hack to have the mesh built firt time parameters are set without delay
+
+ void set_aabb(Rect3 p_aabb);
+
+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);
+
+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);
+
+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);
+
+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);
+
+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);
+
+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);
+
+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);
+
+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/scene_format_text.cpp b/scene/resources/scene_format_text.cpp
index f62fa93e04..8ad2970005 100644
--- a/scene/resources/scene_format_text.cpp
+++ b/scene/resources/scene_format_text.cpp
@@ -332,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;
}
@@ -606,6 +607,15 @@ 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);
diff --git a/scene/resources/scene_format_text.h b/scene/resources/scene_format_text.h
index a7e78d62fe..1ea6465c21 100644
--- a/scene/resources/scene_format_text.h
+++ b/scene/resources/scene_format_text.h
@@ -38,6 +38,7 @@
class ResourceInteractiveLoaderText : public ResourceInteractiveLoader {
+ bool translation_remapped;
String local_path;
String res_path;
String error_text;
@@ -94,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 145374ff05..99062d693b 100644
--- a/scene/resources/segment_shape_2d.cpp
+++ b/scene/resources/segment_shape_2d.cpp
@@ -35,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();
@@ -69,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;
}
@@ -121,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/shader_graph.h b/scene/resources/shader_graph.h
index b9ec294eb8..36578ce1f7 100644
--- a/scene/resources/shader_graph.h
+++ b/scene/resources/shader_graph.h
@@ -37,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 b449932b17..6be88374e5 100644
--- a/scene/resources/shape.cpp
+++ b/scene/resources/shape.cpp
@@ -30,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"
@@ -49,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 01b8db650e..c15638aeed 100644
--- a/scene/resources/shape.h
+++ b/scene/resources/shape.h
@@ -31,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; }
@@ -50,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_line_2d.cpp b/scene/resources/shape_line_2d.cpp
index 89c1cea252..c38ae04eff 100644
--- a/scene/resources/shape_line_2d.cpp
+++ b/scene/resources/shape_line_2d.cpp
@@ -76,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/style_box.cpp b/scene/resources/style_box.cpp
index b665de2de1..2714ffec10 100644
--- a/scene/resources/style_box.cpp
+++ b/scene/resources/style_box.cpp
@@ -114,6 +114,19 @@ 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;
@@ -138,12 +151,16 @@ void StyleBoxTexture::draw(RID p_canvas_item, const Rect2 &p_rect) const {
texture->get_rect_region(rect, src_rect, rect, src_rect);
- rect.pos.x -= expand_margin[MARGIN_LEFT];
- rect.pos.y -= expand_margin[MARGIN_TOP];
+ 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];
- 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::NINE_PATCH_STRETCH, VS::NINE_PATCH_STRETCH, draw_center, modulate);
+ 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::NINE_PATCH_STRETCH, VS::NINE_PATCH_STRETCH, draw_center, modulate, normal_rid);
}
void StyleBoxTexture::set_draw_center(bool p_draw) {
@@ -209,6 +226,9 @@ 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_normal_map", "normal_map:Texture"), &StyleBoxTexture::set_normal_map);
+ ClassDB::bind_method(D_METHOD("get_normal_map:Texture"), &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);
@@ -227,6 +247,7 @@ void StyleBoxTexture::_bind_methods() {
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);
@@ -352,26 +373,26 @@ void StyleBoxFlat::draw(RID p_canvas_item, const Rect2 &p_rect) const {
color_downright.b = (border_size - i) * color_downright.b / border_size + i * bg_color.b / border_size;
}
- 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);
+ vs->canvas_item_add_rect(p_canvas_item, Rect2(Point2i(r.position.x, r.position.y + r.size.y - 1), Size2(r.size.x, 1)), color_downright);
+ vs->canvas_item_add_rect(p_canvas_item, Rect2(Point2i(r.position.x + r.size.x - 1, r.position.y), Size2(1, r.size.y)), color_downright);
- 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);
+ vs->canvas_item_add_rect(p_canvas_item, Rect2(r.position, Size2(r.size.x, 1)), color_upleft);
+ vs->canvas_item_add_rect(p_canvas_item, Rect2(r.position, Size2(1, r.size.y)), color_upleft);
- r.pos.x++;
- r.pos.y++;
+ r.position.x++;
+ r.position.y++;
r.size.x -= 2;
r.size.y -= 2;
}
if (draw_center)
- vs->canvas_item_add_rect(p_canvas_item, Rect2(r.pos, r.size), bg_color);
+ vs->canvas_item_add_rect(p_canvas_item, Rect2(r.position, r.size), bg_color);
Rect2i r_add = p_rect;
- vs->canvas_item_add_rect(p_canvas_item, Rect2(Point2i(r_add.pos.x - additional_border_size[MARGIN_LEFT], r_add.pos.y - additional_border_size[MARGIN_TOP]), Size2(r_add.size.width + additional_border_size[MARGIN_LEFT] + additional_border_size[MARGIN_RIGHT], additional_border_size[MARGIN_TOP])), light_color);
- vs->canvas_item_add_rect(p_canvas_item, Rect2(Point2i(r_add.pos.x - additional_border_size[MARGIN_LEFT], r_add.pos.y), Size2(additional_border_size[MARGIN_LEFT], r_add.size.height)), light_color);
- vs->canvas_item_add_rect(p_canvas_item, Rect2(Point2i(r_add.pos.x + r_add.size.width, r_add.pos.y), Size2(additional_border_size[MARGIN_RIGHT], r_add.size.height)), dark_color);
- vs->canvas_item_add_rect(p_canvas_item, Rect2(Point2i(r_add.pos.x - additional_border_size[MARGIN_LEFT], r_add.pos.y + r_add.size.height), Size2(r_add.size.width + additional_border_size[MARGIN_LEFT] + additional_border_size[MARGIN_RIGHT], additional_border_size[MARGIN_BOTTOM])), dark_color);
+ vs->canvas_item_add_rect(p_canvas_item, Rect2(Point2i(r_add.position.x - additional_border_size[MARGIN_LEFT], r_add.position.y - additional_border_size[MARGIN_TOP]), Size2(r_add.size.width + additional_border_size[MARGIN_LEFT] + additional_border_size[MARGIN_RIGHT], additional_border_size[MARGIN_TOP])), light_color);
+ vs->canvas_item_add_rect(p_canvas_item, Rect2(Point2i(r_add.position.x - additional_border_size[MARGIN_LEFT], r_add.position.y), Size2(additional_border_size[MARGIN_LEFT], r_add.size.height)), light_color);
+ vs->canvas_item_add_rect(p_canvas_item, Rect2(Point2i(r_add.position.x + r_add.size.width, r_add.position.y), Size2(additional_border_size[MARGIN_RIGHT], r_add.size.height)), dark_color);
+ vs->canvas_item_add_rect(p_canvas_item, Rect2(Point2i(r_add.position.x - additional_border_size[MARGIN_LEFT], r_add.position.y + r_add.size.height), Size2(r_add.size.width + additional_border_size[MARGIN_LEFT] + additional_border_size[MARGIN_RIGHT], additional_border_size[MARGIN_BOTTOM])), dark_color);
}
float StyleBoxFlat::get_style_margin(Margin p_margin) const {
diff --git a/scene/resources/style_box.h b/scene/resources/style_box.h
index bbb2444bd7..7547c2ea81 100644
--- a/scene/resources/style_box.h
+++ b/scene/resources/style_box.h
@@ -39,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];
@@ -81,6 +81,7 @@ class StyleBoxTexture : public StyleBox {
float margin[4];
Rect2 region_rect;
Ref<Texture> texture;
+ Ref<Texture> normal_map;
bool draw_center;
Color modulate;
@@ -101,6 +102,9 @@ 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;
diff --git a/scene/resources/surface_tool.cpp b/scene/resources/surface_tool.cpp
index 4c36d79a7a..b2822ca0c4 100644
--- a/scene/resources/surface_tool.cpp
+++ b/scene/resources/surface_tool.cpp
@@ -28,7 +28,7 @@
/* 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
@@ -224,13 +224,13 @@ void SurfaceTool::add_index(int p_index) {
index_array.push_back(p_index);
}
-Ref<Mesh> SurfaceTool::commit(const Ref<Mesh> &p_existing) {
+Ref<ArrayMesh> SurfaceTool::commit(const Ref<ArrayMesh> &p_existing) {
- Ref<Mesh> mesh;
+ Ref<ArrayMesh> mesh;
if (p_existing.is_valid())
mesh = p_existing;
else
- mesh = Ref<Mesh>(memnew(Mesh));
+ mesh.instance();
int varr_len = vertex_array.size();
diff --git a/scene/resources/surface_tool.h b/scene/resources/surface_tool.h
index b143086e11..753c3626b8 100644
--- a/scene/resources/surface_tool.h
+++ b/scene/resources/surface_tool.h
@@ -125,7 +125,7 @@ public:
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 bc8deb501e..171826cb2f 100644
--- a/scene/resources/texture.cpp
+++ b/scene/resources/texture.cpp
@@ -28,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 {
@@ -36,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 {
@@ -65,9 +70,9 @@ 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"), &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"), &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:Texture", "clip_uv"), &Texture::draw_rect_region, DEFVAL(Color(1, 1, 1)), DEFVAL(false), DEFVAL(Variant()), DEFVAL(true));
BIND_CONSTANT(FLAG_MIPMAPS);
BIND_CONSTANT(FLAG_REPEAT);
@@ -86,7 +91,7 @@ Texture::Texture() {
void ImageTexture::reload_from_file() {
- String path = get_path();
+ String path = ResourceLoader::path_remap(get_path());
if (!path.is_resource_file())
return;
@@ -265,23 +270,26 @@ 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) {
@@ -390,8 +398,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 {
@@ -421,12 +438,13 @@ 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);
@@ -444,6 +462,14 @@ Error StreamTexture::_load_data(const String &p_path, int &tw, int &th, int &fla
VS::get_singleton()->texture_set_detect_srgb_callback(texture, NULL, NULL);
}
+ 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;
}
@@ -494,9 +520,9 @@ Error StreamTexture::_load_data(const String &p_path, int &tw, int &th, int &fla
img = Image::lossy_unpacker(pv);
}
- if (img.is_null()) {
+ 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();
@@ -647,23 +673,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 {
@@ -681,13 +710,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() {
@@ -845,7 +877,7 @@ void AtlasTexture::_bind_methods() {
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;
@@ -860,10 +892,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;
@@ -879,11 +912,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;
@@ -892,26 +926,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 {
@@ -922,24 +957,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;
@@ -1076,16 +1111,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)
@@ -1093,13 +1128,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)
@@ -1107,6 +1143,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
@@ -1116,9 +1153,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);
}
}
@@ -1336,262 +1373,102 @@ CubeMap::~CubeMap() {
void CurveTexture::_bind_methods() {
- ClassDB::bind_method(D_METHOD("set_max", "max"), &CurveTexture::set_max);
- ClassDB::bind_method(D_METHOD("get_max"), &CurveTexture::get_max);
-
- ClassDB::bind_method(D_METHOD("set_min", "min"), &CurveTexture::set_min);
- ClassDB::bind_method(D_METHOD("get_min"), &CurveTexture::get_min);
-
ClassDB::bind_method(D_METHOD("set_width", "width"), &CurveTexture::set_width);
- ClassDB::bind_method(D_METHOD("set_points", "points"), &CurveTexture::set_points);
- ClassDB::bind_method(D_METHOD("get_points"), &CurveTexture::get_points);
-
- ADD_PROPERTY(PropertyInfo(Variant::REAL, "min", PROPERTY_HINT_RANGE, "-1024,1024"), "set_min", "get_min");
- ADD_PROPERTY(PropertyInfo(Variant::REAL, "max", PROPERTY_HINT_RANGE, "-1024,1024"), "set_max", "get_max");
- ADD_PROPERTY(PropertyInfo(Variant::INT, "width", PROPERTY_HINT_RANGE, "32,4096"), "set_width", "get_width");
- ADD_PROPERTY(PropertyInfo(Variant::POOL_VECTOR2_ARRAY, "points"), "set_points", "get_points");
-}
-void CurveTexture::set_max(float p_max) {
-
- max = p_max;
- emit_changed();
-}
-float CurveTexture::get_max() const {
-
- return max;
-}
+ ClassDB::bind_method(D_METHOD("set_curve", "curve:Curve"), &CurveTexture::set_curve);
+ ClassDB::bind_method(D_METHOD("get_curve:Curve"), &CurveTexture::get_curve);
-void CurveTexture::set_min(float p_min) {
+ ClassDB::bind_method(D_METHOD("_update"), &CurveTexture::_update);
- min = p_min;
- emit_changed();
+ 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");
}
-float CurveTexture::get_min() const {
- return min;
-}
void CurveTexture::set_width(int p_width) {
ERR_FAIL_COND(p_width < 32 || p_width > 4096);
- width = p_width;
- if (points.size())
- set_points(points);
+ _width = p_width;
+ _update();
}
+
int CurveTexture::get_width() const {
- return width;
+ return _width;
}
-static void _plot_curve(const Vector2 &p_a, const Vector2 &p_b, const Vector2 &p_c, const Vector2 &p_d, float *p_heights, bool *p_useds, int p_width, float p_min, float p_max) {
-
- float geometry[4][4];
- float tmp1[4][4];
- float tmp2[4][4];
- float deltas[4][4];
- double x, dx, dx2, dx3;
- double y, dy, dy2, dy3;
- double d, d2, d3;
- int lastx;
- int newx;
- float lasty;
- float newy;
- int ntimes;
- int i, j;
-
- int xmax = p_width;
-
- /* construct the geometry matrix from the segment */
- for (i = 0; i < 4; i++) {
- geometry[i][2] = 0;
- geometry[i][3] = 0;
+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
}
+}
- geometry[0][0] = (p_a[0] * xmax);
- geometry[1][0] = (p_b[0] * xmax);
- geometry[2][0] = (p_c[0] * xmax);
- geometry[3][0] = (p_d[0] * xmax);
-
- geometry[0][1] = (p_a[1]);
- geometry[1][1] = (p_b[1]);
- geometry[2][1] = (p_c[1]);
- geometry[3][1] = (p_d[1]);
-
- /* subdivide the curve ntimes (1000) times */
- ntimes = 4 * xmax;
- /* ntimes can be adjusted to give a finer or coarser curve */
- d = 1.0 / ntimes;
- d2 = d * d;
- d3 = d * d * d;
-
- /* construct a temporary matrix for determining the forward differencing deltas */
- tmp2[0][0] = 0;
- tmp2[0][1] = 0;
- tmp2[0][2] = 0;
- tmp2[0][3] = 1;
- tmp2[1][0] = d3;
- tmp2[1][1] = d2;
- tmp2[1][2] = d;
- tmp2[1][3] = 0;
- tmp2[2][0] = 6 * d3;
- tmp2[2][1] = 2 * d2;
- tmp2[2][2] = 0;
- tmp2[2][3] = 0;
- tmp2[3][0] = 6 * d3;
- tmp2[3][1] = 0;
- tmp2[3][2] = 0;
- tmp2[3][3] = 0;
-
- /* compose the basis and geometry matrices */
-
- static const float CR_basis[4][4] = {
- { -0.5, 1.5, -1.5, 0.5 },
- { 1.0, -2.5, 2.0, -0.5 },
- { -0.5, 0.0, 0.5, 0.0 },
- { 0.0, 1.0, 0.0, 0.0 },
- };
-
- for (i = 0; i < 4; i++) {
- for (j = 0; j < 4; j++) {
- tmp1[i][j] = (CR_basis[i][0] * geometry[0][j] +
- CR_basis[i][1] * geometry[1][j] +
- CR_basis[i][2] * geometry[2][j] +
- CR_basis[i][3] * geometry[3][j]);
- }
- }
- /* compose the above results to get the deltas matrix */
-
- for (i = 0; i < 4; i++) {
- for (j = 0; j < 4; j++) {
- deltas[i][j] = (tmp2[i][0] * tmp1[0][j] +
- tmp2[i][1] * tmp1[1][j] +
- tmp2[i][2] * tmp1[2][j] +
- tmp2[i][3] * tmp1[3][j]);
+void CurveTexture::set_curve(Ref<Curve> p_curve) {
+ if (_curve != p_curve) {
+ if (_curve.is_valid()) {
+ _curve->disconnect(CoreStringNames::get_singleton()->changed, this, "_update");
}
- }
-
- /* extract the x deltas */
- x = deltas[0][0];
- dx = deltas[1][0];
- dx2 = deltas[2][0];
- dx3 = deltas[3][0];
-
- /* extract the y deltas */
- y = deltas[0][1];
- dy = deltas[1][1];
- dy2 = deltas[2][1];
- dy3 = deltas[3][1];
-
- lastx = CLAMP(x, 0, xmax);
- lasty = y;
-
- p_heights[lastx] = lasty;
- p_useds[lastx] = true;
-
- /* loop over the curve */
- for (i = 0; i < ntimes; i++) {
- /* increment the x values */
- x += dx;
- dx += dx2;
- dx2 += dx3;
-
- /* increment the y values */
- y += dy;
- dy += dy2;
- dy2 += dy3;
-
- newx = CLAMP((Math::round(x)), 0, xmax);
- newy = CLAMP(y, p_min, p_max);
-
- /* if this point is different than the last one...then draw it */
- if ((lastx != newx) || (lasty != newy)) {
- p_useds[newx] = true;
- p_heights[newx] = newy;
+ _curve = p_curve;
+ if (_curve.is_valid()) {
+ _curve->connect(CoreStringNames::get_singleton()->changed, this, "_update");
}
-
- lastx = newx;
- lasty = newy;
+ _update();
}
}
-void CurveTexture::set_points(const PoolVector<Vector2> &p_points) {
-
- points = p_points;
+void CurveTexture::_update() {
PoolVector<uint8_t> data;
- PoolVector<bool> used;
- data.resize(width * sizeof(float));
- used.resize(width);
+ data.resize(_width * sizeof(float));
+
+ // The array is locked in that scope
{
PoolVector<uint8_t>::Write wd8 = data.write();
float *wd = (float *)wd8.ptr();
- PoolVector<bool>::Write wu = used.write();
- int pc = p_points.size();
- PoolVector<Vector2>::Read pr = p_points.read();
-
- for (int i = 0; i < width; i++) {
- wd[i] = 0.0;
- wu[i] = false;
- }
- Vector2 prev = Vector2(0, 0);
- Vector2 prev2 = Vector2(0, 0);
-
- for (int i = -1; i < pc; i++) {
-
- Vector2 next;
- Vector2 next2;
- if (i + 1 >= pc) {
- next = Vector2(1, 0);
- } else {
- next = Vector2(pr[i + 1].x, pr[i + 1].y);
+ 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);
}
- if (i + 2 >= pc) {
- next2 = Vector2(1, 0);
- } else {
- next2 = Vector2(pr[i + 2].x, pr[i + 2].y);
+ } else {
+ for (int i = 0; i < _width; ++i) {
+ wd[i] = 0;
}
-
- /*if (i==-1 && prev.offset==next.offset) {
- prev=next;
- continue;
- }*/
-
- _plot_curve(prev2, prev, next, next2, wd, wu.ptr(), width, min, max);
-
- prev2 = prev;
- prev = next;
}
}
- Ref<Image> image = memnew(Image(width, 1, false, Image::FORMAT_RF, data));
+ 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);
+ 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();
}
-PoolVector<Vector2> CurveTexture::get_points() const {
+Ref<Curve> CurveTexture::get_curve() const {
- return points;
+ return _curve;
}
RID CurveTexture::get_rid() const {
- return texture;
+ return _texture;
}
CurveTexture::CurveTexture() {
-
- max = 1;
- min = 0;
- width = 2048;
- texture = VS::get_singleton()->texture_create();
+ _width = 2048;
+ _texture = VS::get_singleton()->texture_create();
}
CurveTexture::~CurveTexture() {
- VS::get_singleton()->free(texture);
+ VS::get_singleton()->free(_texture);
}
//////////////////
@@ -1602,13 +1479,6 @@ CurveTexture::~CurveTexture() {
#define COLOR_RAMP_SET_COLORS "set_colors"
GradientTexture::GradientTexture() {
- //Set initial color ramp transition from black to white
- points.resize(2);
- points[0].color = Color(0, 0, 0, 1);
- points[0].offset = 0;
- points[1].color = Color(1, 1, 1, 1);
- points[1].offset = 1;
- is_sorted = true;
update_pending = false;
width = 2048;
@@ -1622,32 +1492,33 @@ GradientTexture::~GradientTexture() {
void GradientTexture::_bind_methods() {
- ClassDB::bind_method(D_METHOD("add_point", "offset", "color"), &GradientTexture::add_point);
- ClassDB::bind_method(D_METHOD("remove_point", "offset", "color"), &GradientTexture::remove_point);
-
- ClassDB::bind_method(D_METHOD("set_offset", "point", "offset"), &GradientTexture::set_offset);
- ClassDB::bind_method(D_METHOD("get_offset", "point"), &GradientTexture::get_offset);
-
- ClassDB::bind_method(D_METHOD("set_color", "point", "color"), &GradientTexture::set_color);
- ClassDB::bind_method(D_METHOD("get_color", "point"), &GradientTexture::get_color);
+ ClassDB::bind_method(D_METHOD("set_gradient", "gradient:Gradient"), &GradientTexture::set_gradient);
+ ClassDB::bind_method(D_METHOD("get_gradient:Gradient"), &GradientTexture::get_gradient);
ClassDB::bind_method(D_METHOD("set_width", "width"), &GradientTexture::set_width);
- ClassDB::bind_method(D_METHOD("interpolate", "offset"), &GradientTexture::get_color_at_offset);
-
- ClassDB::bind_method(D_METHOD("get_point_count"), &GradientTexture::get_points_count);
-
ClassDB::bind_method(D_METHOD("_update"), &GradientTexture::_update);
- ClassDB::bind_method(D_METHOD(COLOR_RAMP_SET_OFFSETS, "offsets"), &GradientTexture::set_offsets);
- ClassDB::bind_method(D_METHOD(COLOR_RAMP_GET_OFFSETS), &GradientTexture::get_offsets);
+ 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");
+}
- ClassDB::bind_method(D_METHOD(COLOR_RAMP_SET_COLORS, "colors"), &GradientTexture::set_colors);
- ClassDB::bind_method(D_METHOD(COLOR_RAMP_GET_COLORS), &GradientTexture::get_colors);
+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();
+}
- ADD_PROPERTY(PropertyInfo(Variant::INT, "width"), "set_width", "get_width");
- 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);
+Ref<Gradient> GradientTexture::get_gradient() const {
+ return gradient;
}
void GradientTexture::_queue_update() {
@@ -1660,16 +1531,22 @@ void GradientTexture::_queue_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);
- Color color = 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));
@@ -1695,108 +1572,6 @@ int GradientTexture::get_width() const {
return width;
}
-Vector<float> GradientTexture::get_offsets() const {
- Vector<float> offsets;
- offsets.resize(points.size());
- for (int i = 0; i < points.size(); i++) {
- offsets[i] = points[i].offset;
- }
- return offsets;
-}
-
-Vector<Color> GradientTexture::get_colors() const {
- Vector<Color> colors;
- colors.resize(points.size());
- for (int i = 0; i < points.size(); i++) {
- colors[i] = points[i].color;
- }
- return colors;
-}
-
-void GradientTexture::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];
- }
- is_sorted = false;
- emit_changed();
- _queue_update();
-}
-
-void GradientTexture::set_colors(const Vector<Color> &p_colors) {
- if (points.size() < p_colors.size())
- is_sorted = false;
- points.resize(p_colors.size());
- for (int i = 0; i < points.size(); i++) {
- points[i].color = p_colors[i];
- }
- emit_changed();
- _queue_update();
-}
-
-Vector<GradientTexture::Point> &GradientTexture::get_points() {
- return points;
-}
-
-void GradientTexture::add_point(float p_offset, const Color &p_color) {
-
- Point p;
- p.offset = p_offset;
- p.color = p_color;
- is_sorted = false;
- points.push_back(p);
-
- emit_changed();
- _queue_update();
-}
-
-void GradientTexture::remove_point(int p_index) {
-
- ERR_FAIL_INDEX(p_index, points.size());
- ERR_FAIL_COND(points.size() <= 2);
- points.remove(p_index);
- emit_changed();
- _queue_update();
-}
-
-void GradientTexture::set_points(Vector<GradientTexture::Point> &p_points) {
- points = p_points;
- is_sorted = false;
- emit_changed();
- _queue_update();
-}
-
-void GradientTexture::set_offset(int pos, const float offset) {
- if (points.size() <= pos)
- points.resize(pos + 1);
- points[pos].offset = offset;
- is_sorted = false;
- emit_changed();
- _queue_update();
-}
-
-float GradientTexture::get_offset(int pos) const {
- if (points.size() > pos)
- return points[pos].offset;
- return 0; //TODO: Maybe throw some error instead?
-}
-
-void GradientTexture::set_color(int pos, const Color &color) {
- if (points.size() <= pos) {
- points.resize(pos + 1);
- is_sorted = false;
- }
- points[pos].color = color;
- emit_changed();
- _queue_update();
-}
-
-Color GradientTexture::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 GradientTexture::get_points_count() const {
- return points.size();
+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 07416529ae..9bbbd1d091 100644
--- a/scene/resources/texture.h
+++ b/scene/resources/texture.h
@@ -30,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"
/**
@@ -68,9 +70,9 @@ 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 Ref<Image> get_data() const { return Ref<Image>(); }
@@ -131,9 +133,9 @@ 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;
@@ -167,6 +169,7 @@ 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:
@@ -181,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();
@@ -190,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;
@@ -200,9 +205,9 @@ 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);
@@ -226,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;
@@ -254,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();
@@ -265,7 +270,7 @@ public:
class LargeTexture : public Texture {
GDCLASS(LargeTexture, Texture);
- RES_BASE_EXTENSION("ltex");
+ RES_BASE_EXTENSION("largetex");
protected:
struct Piece {
@@ -302,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();
};
@@ -312,7 +317,7 @@ public:
class CubeMap : public Resource {
GDCLASS(CubeMap, Resource);
- RES_BASE_EXTENSION("cbm");
+ RES_BASE_EXTENSION("cubemap");
public:
enum Storage {
@@ -386,36 +391,33 @@ 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("cvtex");
+ GDCLASS(CurveTexture, Texture)
+ RES_BASE_EXTENSION("curvetex")
private:
- RID texture;
- PoolVector<Vector2> points;
- float min, max;
- int width;
+ RID _texture;
+ Ref<Curve> _curve;
+ int _width;
+
+ void _update();
protected:
static void _bind_methods();
public:
- void set_max(float p_max);
- float get_max() const;
-
- void set_min(float p_min);
- float get_min() const;
-
void set_width(int p_width);
int get_width() const;
- void set_points(const PoolVector<Vector2> &p_points);
- PoolVector<Vector2> get_points() 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;
@@ -443,7 +445,7 @@ public:
//VARIANT_ENUM_CAST( Texture::CubeMapSide );
class GradientTexture : public Texture {
- GDCLASS(GradientTexture, Texture);
+ GDCLASS(GradientTexture, Texture)
public:
struct Point {
@@ -456,8 +458,7 @@ public:
};
private:
- Vector<Point> points;
- bool is_sorted;
+ Ref<Gradient> gradient;
bool update_pending;
RID texture;
int width;
@@ -469,23 +470,8 @@ protected:
static void _bind_methods();
public:
- void add_point(float p_offset, const Color &p_color);
- void remove_point(int p_index);
-
- void set_points(Vector<Point> &points);
- Vector<Point> &get_points();
-
- void set_offset(int pos, const float offset);
- float get_offset(int pos) const;
-
- void set_color(int pos, const Color &color);
- Color get_color(int pos) const;
-
- void set_offsets(const Vector<float> &offsets);
- Vector<float> get_offsets() const;
-
- void set_colors(const Vector<Color> &colors);
- Vector<Color> get_colors() const;
+ void set_gradient(Ref<Gradient> p_gradient);
+ Ref<Gradient> get_gradient() const;
void set_width(int p_width);
int get_width() const;
@@ -497,49 +483,7 @@ public:
virtual void set_flags(uint32_t p_flags) {}
virtual uint32_t get_flags() const { return FLAG_FILTER; }
- _FORCE_INLINE_ Color get_color_at_offset(float p_offset) {
-
- if (points.empty())
- return Color(0, 0, 0, 1);
-
- if (!is_sorted) {
- points.sort();
- is_sorted = true;
- }
-
- //binary search
- int low = 0;
- int high = points.size() - 1;
- int middle;
-
- while (low <= high) {
- middle = (low + high) / 2;
- Point &point = points[middle];
- if (point.offset > p_offset) {
- high = middle - 1; //search low end of array
- } else if (point.offset < p_offset) {
- low = middle + 1; //search high end of array
- } else {
- return point.color;
- }
- }
-
- //return interpolated value
- if (points[middle].offset > p_offset) {
- middle--;
- }
- int first = middle;
- int second = middle + 1;
- if (second >= points.size())
- return points[points.size() - 1].color;
- if (first < 0)
- return points[0].color;
- Point &pointFirst = points[first];
- Point &pointSecond = points[second];
- return pointFirst.color.linear_interpolate(pointSecond.color, (p_offset - pointFirst.offset) / (pointSecond.offset - pointFirst.offset));
- }
-
- int get_points_count() const;
+ virtual Ref<Image> get_data() const;
GradientTexture();
virtual ~GradientTexture();
diff --git a/scene/resources/theme.h b/scene/resources/theme.h
index 1a5cfcf4b2..1dfea7f421 100644
--- a/scene/resources/theme.h
+++ b/scene/resources/theme.h
@@ -43,7 +43,7 @@
class Theme : public Resource {
GDCLASS(Theme, Resource);
- RES_BASE_EXTENSION("thm");
+ RES_BASE_EXTENSION("theme");
static Ref<Theme> default_theme;
diff --git a/scene/resources/tile_set.cpp b/scene/resources/tile_set.cpp
index 76bb1daf94..dc8f6a0a69 100644
--- a/scene/resources/tile_set.cpp
+++ b/scene/resources/tile_set.cpp
@@ -45,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")
@@ -89,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")
@@ -119,12 +133,13 @@ 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, "ShaderMaterial"));
p_list->push_back(PropertyInfo(Variant::COLOR, pre + "modulate"));
@@ -133,8 +148,10 @@ void TileSet::_get_property_list(List<PropertyInfo> *p_list) const {
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));
}
}
@@ -142,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();
}
@@ -160,6 +177,19 @@ Ref<Texture> TileSet::tile_get_texture(int p_id) const {
return tile_map[p_id].texture;
}
+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));
@@ -199,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));
@@ -238,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));
@@ -301,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 {
@@ -333,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;
}
@@ -344,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());
}
@@ -353,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());
}
@@ -382,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();
@@ -404,16 +519,22 @@ void TileSet::_bind_methods() {
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_normal_map", "id", "normal_map:Texture"), &TileSet::tile_set_normal_map);
+ ClassDB::bind_method(D_METHOD("tile_get_normal_map:Texture", "id"), &TileSet::tile_get_normal_map);
ClassDB::bind_method(D_METHOD("tile_set_material", "id", "material:ShaderMaterial"), &TileSet::tile_set_material);
ClassDB::bind_method(D_METHOD("tile_get_material:ShaderMaterial", "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:Shape2D"), &TileSet::tile_set_shape);
+ ClassDB::bind_method(D_METHOD("tile_get_shape:Shape2D", "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:Shape2D", "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);
diff --git a/scene/resources/tile_set.h b/scene/resources/tile_set.h
index 448444d34a..99c506390c 100644
--- a/scene/resources/tile_set.h
+++ b/scene/resources/tile_set.h
@@ -40,14 +40,26 @@ 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;
@@ -56,11 +68,11 @@ class TileSet : public Resource {
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);
@@ -81,17 +93,30 @@ 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_shape_transform(int p_id, int p_shape_id, const Transform2D &p_transform);
+ Transform2D tile_get_shape_transform(int p_id, int p_shape_id) const;
+
+ 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;
@@ -111,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/world.h b/scene/resources/world.h
index 96857a577a..5291b3974b 100644
--- a/scene/resources/world.h
+++ b/scene/resources/world.h
@@ -41,7 +41,7 @@ class VisibilityNotifier;
class World : public Resource {
GDCLASS(World, Resource);
- RES_BASE_EXTENSION("wrd");
+ RES_BASE_EXTENSION("world");
private:
RID space;
diff --git a/scene/resources/world_2d.cpp b/scene/resources/world_2d.cpp
index db72ccd03c..9ec89e4003 100644
--- a/scene/resources/world_2d.cpp
+++ b/scene/resources/world_2d.cpp
@@ -32,7 +32,6 @@
#include "servers/visual_server.h"
//#include "servers/spatial_sound_2d_server.h"
#include "global_config.h"
-#include "global_config.h"
#include "scene/2d/camera_2d.h"
#include "scene/2d/visibility_notifier_2d.h"
#include "scene/main/viewport.h"
@@ -97,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++) {
@@ -220,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;
@@ -360,16 +359,17 @@ 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);
}
diff --git a/scene/resources/world_2d.h b/scene/resources/world_2d.h
index 2b6e7e7383..35c8ce390f 100644
--- a/scene/resources/world_2d.h
+++ b/scene/resources/world_2d.h
@@ -44,7 +44,6 @@ class World2D : public Resource {
RID canvas;
RID space;
- RID sound_space;
SpatialIndexer2D *indexer;
@@ -66,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 c6277dbbb8..ec71333ded 100644
--- a/scene/scene_string_names.cpp
+++ b/scene/scene_string_names.cpp
@@ -44,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");
diff --git a/scene/scene_string_names.h b/scene/scene_string_names.h
index 3e4c80d4f7..0802a73973 100644
--- a/scene/scene_string_names.h
+++ b/scene/scene_string_names.h
@@ -64,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;
diff --git a/servers/audio/effects/audio_effect_compressor.cpp b/servers/audio/effects/audio_effect_compressor.cpp
index 997a620f7c..491e6ecc81 100644
--- a/servers/audio/effects/audio_effect_compressor.cpp
+++ b/servers/audio/effects/audio_effect_compressor.cpp
@@ -32,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));
@@ -66,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;
@@ -125,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) {
@@ -208,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);
@@ -229,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");
@@ -239,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 a624370962..550302056c 100644
--- a/servers/audio/effects/audio_effect_compressor.h
+++ b/servers/audio/effects/audio_effect_compressor.h
@@ -51,7 +51,7 @@ class AudioEffectCompressor : public AudioEffect {
GDCLASS(AudioEffectCompressor, AudioEffect)
friend class AudioEffectCompressorInstance;
- float treshold;
+ float threshold;
float ratio;
float gain;
float attack_us;
@@ -66,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_limiter.cpp b/servers/audio/effects/audio_effect_limiter.cpp
index e049e5d53a..9f39db0440 100644
--- a/servers/audio/effects/audio_effect_limiter.cpp
+++ b/servers/audio/effects/audio_effect_limiter.cpp
@@ -31,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);
@@ -81,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) {
@@ -123,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);
@@ -133,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 a684eccbfa..e15ffe5b34 100644
--- a/servers/audio/effects/audio_effect_limiter.h
+++ b/servers/audio/effects/audio_effect_limiter.h
@@ -49,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;
@@ -58,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_server.cpp b/servers/audio_server.cpp
index 095e66ed37..43f1175c79 100644
--- a/servers/audio_server.cpp
+++ b/servers/audio_server.cpp
@@ -252,7 +252,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;
@@ -515,6 +515,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());
@@ -713,7 +722,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()) {
@@ -958,6 +967,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);
diff --git a/servers/audio_server.h b/servers/audio_server.h
index f4c22c0b33..caa07891f7 100644
--- a/servers/audio_server.h
+++ b/servers/audio_server.h
@@ -113,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;
@@ -215,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/body_sw.cpp b/servers/physics/body_sw.cpp
index 715f93c1c1..1f32c059a8 100644
--- a/servers/physics/body_sw.cpp
+++ b/servers/physics/body_sw.cpp
@@ -706,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;
diff --git a/servers/physics/collision_object_sw.cpp b/servers/physics/collision_object_sw.cpp
index 5eb10a4d09..d673088304 100644
--- a/servers/physics/collision_object_sw.cpp
+++ b/servers/physics/collision_object_sw.cpp
@@ -164,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);
@@ -208,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 0767f88ba1..15082a0551 100644
--- a/servers/physics/collision_object_sw.h
+++ b/servers/physics/collision_object_sw.h
@@ -53,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 {
@@ -134,14 +134,14 @@ public:
_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_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 427a75cf93..128f78e46e 100644
--- a/servers/physics/collision_solver_sat.cpp
+++ b/servers/physics/collision_solver_sat.cpp
@@ -30,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_sw.cpp b/servers/physics/collision_solver_sw.cpp
index 38ce31ec78..32a42bcaf4 100644
--- a/servers/physics/collision_solver_sw.cpp
+++ b/servers/physics/collision_solver_sw.cpp
@@ -166,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;
}
@@ -332,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;
@@ -353,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/joints/cone_twist_joint_sw.cpp b/servers/physics/joints/cone_twist_joint_sw.cpp
index 7e13909592..51bc27ea7d 100644
--- a/servers/physics/joints/cone_twist_joint_sw.cpp
+++ b/servers/physics/joints/cone_twist_joint_sw.cpp
@@ -100,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;
diff --git a/servers/physics/physics_server_sw.cpp b/servers/physics/physics_server_sw.cpp
index 727ff38718..733bd5b63b 100644
--- a/servers/physics/physics_server_sw.cpp
+++ b/servers/physics/physics_server_sw.cpp
@@ -389,12 +389,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) {
@@ -609,21 +609,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) {
@@ -635,7 +635,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);
@@ -665,7 +665,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);
@@ -812,13 +812,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);
diff --git a/servers/physics/physics_server_sw.h b/servers/physics/physics_server_sw.h
index 44f9aff662..a0a1bcf963 100644
--- a/servers/physics/physics_server_sw.h
+++ b/servers/physics/physics_server_sw.h
@@ -130,7 +130,7 @@ public:
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);
@@ -168,14 +168,14 @@ public:
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;
@@ -200,8 +200,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;
diff --git a/servers/physics/shape_sw.cpp b/servers/physics/shape_sw.cpp
index ff7b442442..a5cea8aff7 100644
--- a/servers/physics/shape_sw.cpp
+++ b/servers/physics/shape_sw.cpp
@@ -32,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;
@@ -165,7 +165,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);
@@ -306,7 +306,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;
@@ -350,7 +350,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;
@@ -460,7 +460,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;
@@ -655,7 +655,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();
@@ -685,7 +685,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];
@@ -757,7 +757,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]);
}
@@ -818,7 +818,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++) {
@@ -854,7 +854,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];
@@ -1388,7 +1388,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;
@@ -1504,7 +1504,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/space_sw.cpp b/servers/physics/space_sw.cpp
index a4bf857bd8..2bf98cecfa 100644
--- a/servers/physics/space_sw.cpp
+++ b/servers/physics/space_sw.cpp
@@ -32,12 +32,12 @@
#include "global_config.h"
#include "physics_server_sw.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_type() == CollisionObjectSW::TYPE_AREA)
return p_type_mask & PhysicsDirectSpaceState::TYPE_MASK_AREA;
- if ((p_object->get_layer_mask() & p_layer_mask) == 0)
+ if ((p_object->get_collision_layer() & p_collision_layer) == 0)
return false;
BodySW *body = static_cast<BodySW *>(p_object);
@@ -45,7 +45,7 @@ _FORCE_INLINE_ static bool _match_object_type_query(CollisionObjectSW *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) {
+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);
@@ -67,7 +67,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()))
@@ -123,7 +123,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;
@@ -144,7 +144,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)
@@ -174,13 +174,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);
/*
@@ -204,7 +204,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()))
@@ -295,7 +295,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;
@@ -325,7 +325,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];
@@ -374,7 +374,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);
@@ -391,7 +391,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];
@@ -597,8 +597,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;
@@ -612,8 +612,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 20a2a06862..b0e54f647c 100644
--- a/servers/physics/space_sw.h
+++ b/servers/physics/space_sw.h
@@ -47,11 +47,11 @@ 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 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);
PhysicsDirectSpaceStateSW();
};
@@ -152,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_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; }
diff --git a/servers/physics_2d/area_pair_2d_sw.cpp b/servers/physics_2d/area_pair_2d_sw.cpp
index c98375fc44..184db944da 100644
--- a/servers/physics_2d/area_pair_2d_sw.cpp
+++ b/servers/physics_2d/area_pair_2d_sw.cpp
@@ -32,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) {
@@ -90,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/body_2d_sw.cpp b/servers/physics_2d/body_2d_sw.cpp
index 03ad66d4e9..91b5646ef5 100644
--- a/servers/physics_2d/body_2d_sw.cpp
+++ b/servers/physics_2d/body_2d_sw.cpp
@@ -621,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;
@@ -676,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 23adebbad6..9e5deef3f2 100644
--- a/servers/physics_2d/body_2d_sw.h
+++ b/servers/physics_2d/body_2d_sw.h
@@ -67,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;
@@ -81,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;
@@ -246,17 +242,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 47e9afbde6..484d4503d0 100644
--- a/servers/physics_2d/body_pair_2d_sw.cpp
+++ b/servers/physics_2d/body_pair_2d_sw.cpp
@@ -225,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();
@@ -280,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++) {
@@ -303,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++) {
@@ -390,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/broad_phase_2d_hash_grid.cpp b/servers/physics_2d/broad_phase_2d_hash_grid.cpp
index e39a5b6df1..29f3396a1d 100644
--- a/servers/physics_2d/broad_phase_2d_hash_grid.cpp
+++ b/servers/physics_2d/broad_phase_2d_hash_grid.cpp
@@ -116,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++) {
@@ -214,8 +214,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++) {
@@ -574,8 +574,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++) {
@@ -636,7 +636,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/collision_object_2d_sw.cpp b/servers/physics_2d/collision_object_2d_sw.cpp
index 265b5bb836..8f13f1130a 100644
--- a/servers/physics_2d/collision_object_2d_sw.cpp
+++ b/servers/physics_2d/collision_object_2d_sw.cpp
@@ -37,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();
@@ -169,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);
@@ -214,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 8ca6c92dbc..5e29132e8d 100644
--- a/servers/physics_2d/collision_object_2d_sw.h
+++ b/servers/physics_2d/collision_object_2d_sw.h
@@ -58,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;
@@ -67,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();
@@ -116,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);
@@ -137,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_sw.cpp b/servers/physics_2d/collision_solver_2d_sw.cpp
index e57d1b7044..b482f826c2 100644
--- a/servers/physics_2d/collision_solver_2d_sw.cpp
+++ b/servers/physics_2d/collision_solver_2d_sw.cpp
@@ -203,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/physics_2d_server_sw.cpp b/servers/physics_2d/physics_2d_server_sw.cpp
index 03e0f8a7fd..fe016d4d0c 100644
--- a/servers/physics_2d/physics_2d_server_sw.cpp
+++ b/servers/physics_2d/physics_2d_server_sw.cpp
@@ -352,6 +352,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);
@@ -476,12 +485,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) {
@@ -640,24 +649,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) {
@@ -691,19 +699,19 @@ 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_flags) {
Body2DSW *body = body_owner.get(p_body);
ERR_FAIL_COND(!body);
- body->set_layer_mask(p_flags);
+ body->set_collision_layer(p_flags);
};
-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) {
@@ -845,13 +853,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);
@@ -887,34 +895,6 @@ 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);
diff --git a/servers/physics_2d/physics_2d_server_sw.h b/servers/physics_2d/physics_2d_server_sw.h
index a8d85932ff..da72784b6f 100644
--- a/servers/physics_2d/physics_2d_server_sw.h
+++ b/servers/physics_2d/physics_2d_server_sw.h
@@ -123,6 +123,8 @@ 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);
@@ -136,7 +138,7 @@ public:
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);
@@ -167,8 +169,8 @@ 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, bool p_disabled);
+ virtual void body_set_shape_as_one_way_collision(RID p_body, int p_shape, bool p_enabled);
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;
@@ -176,8 +178,8 @@ public:
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;
@@ -203,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;
@@ -212,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.h b/servers/physics_2d/physics_2d_server_wrap_mt.h
index ddcf31182a..ac9066582e 100644
--- a/servers/physics_2d/physics_2d_server_wrap_mt.h
+++ b/servers/physics_2d/physics_2d_server_wrap_mt.h
@@ -145,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);
@@ -162,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);
@@ -191,8 +192,8 @@ 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);
@@ -203,8 +204,8 @@ public:
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);
@@ -232,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);
diff --git a/servers/physics_2d/shape_2d_sw.cpp b/servers/physics_2d/shape_2d_sw.cpp
index 203a1052b2..e153ee985c 100644
--- a/servers/physics_2d/shape_2d_sw.cpp
+++ b/servers/physics_2d/shape_2d_sw.cpp
@@ -197,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;
@@ -246,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;
@@ -263,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;
}
@@ -337,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;
@@ -400,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;
@@ -547,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;
@@ -621,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) {
@@ -677,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);
@@ -942,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());
@@ -953,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 547ecdcd11..a75a4338e7 100644
--- a/servers/physics_2d/shape_2d_sw.h
+++ b/servers/physics_2d/shape_2d_sw.h
@@ -31,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
/*
@@ -106,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;
@@ -117,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
@@ -513,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);
}
};
@@ -521,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 ac479aab7a..7049a9cf34 100644
--- a/servers/physics_2d/space_2d_sw.cpp
+++ b/servers/physics_2d/space_2d_sw.cpp
@@ -31,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)
@@ -44,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);
@@ -59,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()))
@@ -95,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);
@@ -117,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()))
@@ -175,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;
@@ -192,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()))
@@ -217,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);
/*
@@ -238,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()))
@@ -265,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;
}
@@ -297,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;
@@ -330,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;
@@ -339,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);
@@ -361,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];
@@ -369,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;
@@ -407,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;
@@ -428,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);
@@ -446,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];
@@ -455,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);
@@ -517,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) {
@@ -589,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);
@@ -599,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);
-
- Vector2 cdir = body->get_one_way_collision_direction();
- /*
- if (cdir!=Vector2() && p_motion.dot(cdir)<0)
- continue;
- */
+ if (col_obj->is_shape_set_as_one_way_collision(j)) {
- 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;
@@ -656,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--;
@@ -671,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);
@@ -703,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;
@@ -720,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;
@@ -739,15 +681,16 @@ 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();
+ 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);
@@ -807,7 +750,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);
@@ -816,11 +759,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;
@@ -839,6 +781,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);
@@ -1187,8 +1130,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;
}
@@ -1201,8 +1144,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;
}
@@ -1243,8 +1186,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_threashold_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 46435b1c66..a28233a4a6 100644
--- a/servers/physics_2d/space_2d_sw.h
+++ b/servers/physics_2d/space_2d_sw.h
@@ -47,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();
};
@@ -103,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;
@@ -152,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_server.cpp b/servers/physics_2d_server.cpp
index 43295073aa..fb7e89bd9e 100644
--- a/servers/physics_2d_server.cpp
+++ b/servers/physics_2d_server.cpp
@@ -154,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) {
@@ -204,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);
@@ -217,7 +217,7 @@ void Physics2DShapeQueryParameters::_bind_methods() {
Physics2DShapeQueryParameters::Physics2DShapeQueryParameters() {
margin = 0;
- layer_mask = 0x7FFFFFFF;
+ collision_layer = 0x7FFFFFFF;
object_type_mask = Physics2DDirectSpaceState::TYPE_MASK_COLLISION;
}
@@ -249,7 +249,7 @@ Array Physics2DDirectSpaceState::_intersect_shape(const Ref<Physics2DShapeQueryP
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(psq->shape, psq->transform, psq->motion, psq->margin, sr.ptr(), sr.size(), psq->exclude, psq->collision_layer, psq->object_type_mask);
Array ret;
ret.resize(rc);
for (int i = 0; i < rc; i++) {
@@ -269,7 +269,7 @@ Array Physics2DDirectSpaceState::_intersect_shape(const Ref<Physics2DShapeQueryP
Array Physics2DDirectSpaceState::_cast_motion(const Ref<Physics2DShapeQueryParameters> &psq) {
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(psq->shape, psq->transform, psq->motion, psq->margin, closest_safe, closest_unsafe, psq->exclude, psq->collision_layer, psq->object_type_mask);
if (!res)
return Array();
Array ret;
@@ -312,7 +312,7 @@ Array Physics2DDirectSpaceState::_collide_shape(const Ref<Physics2DShapeQueryPar
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(psq->shape, psq->transform, psq->motion, psq->margin, ret.ptr(), p_max_results, rc, psq->exclude, psq->collision_layer, psq->object_type_mask);
if (!res)
return Array();
Array r;
@@ -325,7 +325,7 @@ Dictionary Physics2DDirectSpaceState::_get_rest_info(const Ref<Physics2DShapeQue
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(psq->shape, psq->transform, psq->motion, psq->margin, &sri, psq->exclude, psq->collision_layer, psq->object_type_mask);
Dictionary r;
if (!res)
return r;
@@ -346,8 +346,8 @@ 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_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:Dictionary", "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: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));
@@ -496,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);
@@ -504,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);
@@ -539,8 +540,8 @@ 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);
@@ -548,8 +549,8 @@ void Physics2DServer::_bind_methods() {
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);
@@ -571,12 +572,6 @@ 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);
@@ -612,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 4ea037e1b4..e396424707 100644
--- a/servers/physics_2d_server.h
+++ b/servers/physics_2d_server.h
@@ -97,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:
@@ -117,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;
@@ -166,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 {
@@ -177,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 {
@@ -196,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();
};
@@ -272,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,
};
@@ -332,6 +332,8 @@ 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_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;
@@ -342,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;
@@ -380,8 +382,8 @@ 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;
@@ -398,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;
@@ -451,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;
@@ -478,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 b19dfc1c68..6b6db1ff8c 100644
--- a/servers/physics_server.cpp
+++ b/servers/physics_server.cpp
@@ -151,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) {
@@ -198,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);
@@ -211,7 +211,7 @@ void PhysicsShapeQueryParameters::_bind_methods() {
PhysicsShapeQueryParameters::PhysicsShapeQueryParameters() {
margin = 0;
- layer_mask = 0x7FFFFFFF;
+ collision_layer = 0x7FFFFFFF;
object_type_mask = PhysicsDirectSpaceState::TYPE_MASK_COLLISION;
}
@@ -274,7 +274,7 @@ Array PhysicsDirectSpaceState::_intersect_shape(const Ref<PhysicsShapeQueryParam
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(psq->shape, psq->transform, psq->margin, sr.ptr(), sr.size(), psq->exclude, psq->collision_layer, psq->object_type_mask);
Array ret;
ret.resize(rc);
for (int i = 0; i < rc; i++) {
@@ -293,7 +293,7 @@ Array PhysicsDirectSpaceState::_intersect_shape(const Ref<PhysicsShapeQueryParam
Array PhysicsDirectSpaceState::_cast_motion(const Ref<PhysicsShapeQueryParameters> &psq, 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(psq->shape, psq->transform, p_motion, psq->margin, closest_safe, closest_unsafe, psq->exclude, psq->collision_layer, psq->object_type_mask);
if (!res)
return Array();
Array ret;
@@ -307,7 +307,7 @@ Array PhysicsDirectSpaceState::_collide_shape(const Ref<PhysicsShapeQueryParamet
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(psq->shape, psq->transform, psq->margin, ret.ptr(), p_max_results, rc, psq->exclude, psq->collision_layer, psq->object_type_mask);
if (!res)
return Array();
Array r;
@@ -320,7 +320,7 @@ Dictionary PhysicsDirectSpaceState::_get_rest_info(const Ref<PhysicsShapeQueryPa
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(psq->shape, psq->transform, psq->margin, &sri, psq->exclude, psq->collision_layer, psq->object_type_mask);
Dictionary r;
if (!res)
return r;
@@ -343,7 +343,7 @@ 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_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_ray:Dictionary", "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: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));
@@ -425,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);
@@ -450,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);
diff --git a/servers/physics_server.h b/servers/physics_server.h
index 95f725b774..21c65a74d0 100644
--- a/servers/physics_server.h
+++ b/servers/physics_server.h
@@ -100,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:
@@ -117,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;
@@ -166,7 +166,7 @@ public:
int shape;
};
- virtual bool intersect_ray(const Vector3 &p_from, const Vector3 &p_to, RayResult &r_result, const Set<RID> &p_exclude = Set<RID>(), uint32_t p_layer_mask = 0xFFFFFFFF, uint32_t p_object_type_mask = TYPE_MASK_COLLISION, bool p_pick_ray = false) = 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;
struct ShapeResult {
@@ -176,7 +176,7 @@ public:
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 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 {
@@ -188,11 +188,11 @@ 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_layer_mask = 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_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 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;
PhysicsDirectSpaceState();
};
@@ -261,8 +261,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,
@@ -332,7 +332,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;
@@ -382,14 +382,14 @@ public:
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 {
@@ -447,8 +447,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;
diff --git a/servers/server_wrap_mt_common.h b/servers/server_wrap_mt_common.h
index f6b78e8f40..e285483e2b 100644
--- a/servers/server_wrap_mt_common.h
+++ b/servers/server_wrap_mt_common.h
@@ -41,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; \
@@ -747,3 +748,30 @@
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.h b/servers/visual/rasterizer.h
index 4b274acd9e..ca80d5e457 100644
--- a/servers/visual/rasterizer.h
+++ b/servers/visual/rasterizer.h
@@ -61,16 +61,24 @@ public:
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;
@@ -127,7 +135,7 @@ public:
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;
@@ -151,6 +159,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;
@@ -184,6 +193,7 @@ 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;
@@ -215,6 +225,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;
@@ -438,6 +450,7 @@ 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;
@@ -447,6 +460,7 @@ public:
virtual void particles_set_process_material(RID p_particles, RID p_material) = 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;
@@ -459,11 +473,15 @@ public:
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,
@@ -474,7 +492,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 */
@@ -493,6 +512,14 @@ public:
virtual void update_dirty_resources() = 0;
+ 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() {}
@@ -506,7 +533,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 {
@@ -532,6 +560,7 @@ public:
float shadow_gradient_length;
VS::CanvasLightShadowFilter shadow_filter;
Color shadow_color;
+ float shadow_smooth;
void *texture_cache; // implementation dependent
Rect2 rect_cache;
@@ -570,6 +599,7 @@ public:
shadow_buffer_size = 256;
shadow_gradient_length = 0;
shadow_filter = VS::CANVAS_LIGHT_FILTER_NONE;
+ shadow_smooth = 0.0;
}
};
@@ -584,12 +614,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,
@@ -607,11 +639,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;
@@ -627,6 +672,7 @@ public:
Rect2 rect;
Rect2 source;
RID texture;
+ RID normal_map;
float margin[4];
bool draw_center;
Color color;
@@ -644,6 +690,7 @@ public:
Vector<Point2> uvs;
Vector<Color> colors;
RID texture;
+ RID normal_map;
float width;
CommandPrimitive() {
@@ -659,6 +706,7 @@ public:
Vector<Point2> uvs;
Vector<Color> colors;
RID texture;
+ RID normal_map;
int count;
CommandPolygon() {
@@ -681,6 +729,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;
@@ -769,9 +827,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);
@@ -786,7 +869,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]);
@@ -797,7 +880,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]);
@@ -808,7 +891,7 @@ public:
const Item::CommandMesh *mesh = static_cast<const Item::CommandMesh *>(c);
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: {
@@ -816,13 +899,22 @@ public:
const Item::CommandMultiMesh *multimesh = static_cast<const Item::CommandMultiMesh *>(c);
Rect3 aabb = RasterizerStorage::base_singleton->multimesh_get_aabb(multimesh->multimesh);
- 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_PARTICLES: {
+
+ 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: {
diff --git a/servers/visual/shader_language.cpp b/servers/visual/shader_language.cpp
index 9fe92f0fec..49f9e161fa 100644
--- a/servers/visual/shader_language.cpp
+++ b/servers/visual/shader_language.cpp
@@ -1357,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 } },
@@ -2549,12 +2546,14 @@ ShaderLanguage::Node *ShaderLanguage::_parse_expression(BlockNode *p_block, cons
} 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;
}
@@ -3185,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;
}
@@ -3196,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();
@@ -3209,6 +3210,35 @@ 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) {
diff --git a/servers/visual/shader_types.cpp b/servers/visual/shader_types.cpp
index 5bacc2ec51..599a6419a7 100644
--- a/servers/visual/shader_types.cpp
+++ b/servers/visual/shader_types.cpp
@@ -52,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;
@@ -103,10 +102,12 @@ 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"]["WORLD_MATRIX"] = ShaderLanguage::TYPE_MAT4;
shader_modes[VS::SHADER_SPATIAL].functions["fragment"]["INV_CAMERA_MATRIX"] = ShaderLanguage::TYPE_MAT4;
@@ -131,7 +132,20 @@ 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_default_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");
/************ CANVAS ITEM **************************/
@@ -146,9 +160,10 @@ ShaderTypes::ShaderTypes() {
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;
@@ -157,8 +172,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;
@@ -166,8 +185,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;
@@ -179,7 +196,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");
@@ -199,12 +216,13 @@ ShaderTypes::ShaderTypes() {
shader_modes[VS::SHADER_PARTICLES].functions["vertex"]["RESTART"] = ShaderLanguage::TYPE_BOOL;
shader_modes[VS::SHADER_PARTICLES].functions["vertex"]["CUSTOM"] = ShaderLanguage::TYPE_VEC4;
shader_modes[VS::SHADER_PARTICLES].functions["vertex"]["TRANSFORM"] = ShaderLanguage::TYPE_MAT4;
- shader_modes[VS::SHADER_PARTICLES].functions["vertex"]["TIME"] = ShaderLanguage::TYPE_VEC4;
+ 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"]["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");
diff --git a/servers/visual/visual_server_canvas.cpp b/servers/visual/visual_server_canvas.cpp
index 3a83ba887d..584f45412e 100644
--- a/servers/visual/visual_server_canvas.cpp
+++ b/servers/visual/visual_server_canvas.cpp
@@ -58,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;
@@ -119,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;
@@ -171,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();
@@ -233,7 +245,6 @@ void VisualServerCanvas::render_canvas(Canvas *p_canvas, const Transform2D &p_tr
}
VSG::canvas_render->canvas_end();
-
}
RID VisualServerCanvas::canvas_create() {
@@ -381,14 +392,14 @@ void VisualServerCanvas::canvas_item_set_draw_behind_parent(RID p_item, bool p_e
canvas_item->behind = p_enable;
}
-void VisualServerCanvas::canvas_item_add_line(RID p_item, const Point2 &p_from, const Point2 &p_to, const Color &p_color, float p_width, bool p_antialiased) {
+void VisualServerCanvas::canvas_item_add_line(RID p_item, const Point2 &p_from, const Point2 &p_to, const Color &p_colors, float p_width, bool p_antialiased) {
Item *canvas_item = canvas_item_owner.getornull(p_item);
ERR_FAIL_COND(!canvas_item);
Item::CommandLine *line = memnew(Item::CommandLine);
ERR_FAIL_COND(!line);
- line->color = p_color;
+ line->color = p_colors;
line->from = p_from;
line->to = p_to;
line->width = p_width;
@@ -398,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);
@@ -426,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);
@@ -457,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);
@@ -471,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;
@@ -489,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);
@@ -502,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;
@@ -516,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);
@@ -524,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;
@@ -533,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);
@@ -556,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;
@@ -566,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);
@@ -594,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;
@@ -628,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);
@@ -917,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);
@@ -1041,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 47b057f96a..48e3186ece 100644
--- a/servers/visual/visual_server_canvas.h
+++ b/servers/visual/visual_server_canvas.h
@@ -63,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 {
@@ -163,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_line, 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);
@@ -209,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_raster.cpp b/servers/visual/visual_server_raster.cpp
index 2fdff29f0a..8d332b3e6c 100644
--- a/servers/visual/visual_server_raster.cpp
+++ b/servers/visual/visual_server_raster.cpp
@@ -74,6 +74,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() {
/*
@@ -92,6 +105,22 @@ 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();
+ }
}
void VisualServerRaster::sync() {
}
@@ -116,7 +145,7 @@ void VisualServerRaster::finish() {
int VisualServerRaster::get_render_info(RenderInfo p_info) {
- return 0;
+ return VSG::storage->get_render_info(p_info);
}
/* TESTING */
@@ -146,6 +175,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);
diff --git a/servers/visual/visual_server_raster.h b/servers/visual/visual_server_raster.h
index 957af7b9dd..1573116c50 100644
--- a/servers/visual/visual_server_raster.h
+++ b/servers/visual/visual_server_raster.h
@@ -61,6 +61,15 @@ class VisualServerRaster : public VisualServer {
bool draw_extra_frame;
RID test_cube;
+ struct FrameDrawnCallbacks {
+
+ ObjectID object;
+ StringName method;
+ Variant param;
+ };
+
+ List<FrameDrawnCallbacks> frame_drawn_callbacks;
+
#if 0
struct Room {
@@ -586,6 +595,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) \
@@ -615,6 +626,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
@@ -632,10 +645,10 @@ public:
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)
@@ -672,6 +685,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 */
@@ -849,6 +863,7 @@ 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)
@@ -858,13 +873,15 @@ public:
BIND2(particles_set_process_material, RID, RID)
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_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
@@ -922,6 +939,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 */
@@ -938,18 +959,21 @@ public:
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
@@ -1019,16 +1043,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)
@@ -1065,6 +1091,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)
@@ -1096,6 +1123,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;
@@ -1116,6 +1145,7 @@ public:
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 b905b230dc..fb1c66d0b9 100644
--- a/servers/visual/visual_server_scene.cpp
+++ b/servers/visual/visual_server_scene.cpp
@@ -1347,6 +1347,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!
@@ -1373,9 +1375,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;
@@ -1386,7 +1390,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]);
@@ -1435,6 +1442,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;
@@ -1493,10 +1506,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);
@@ -2149,6 +2162,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);
@@ -3310,6 +3335,36 @@ 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);
+
+ 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 1aab624654..d13c24ae24 100644
--- a/servers/visual/visual_server_scene.h
+++ b/servers/visual/visual_server_scene.h
@@ -118,7 +118,7 @@ public:
Camera() {
visible_layers = 0xFFFFFFFF;
- fov = 60;
+ fov = 65;
type = PERSPECTIVE;
znear = 0.1;
zfar = 100;
@@ -519,6 +519,7 @@ 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 update_dirty_instances();
diff --git a/servers/visual/visual_server_viewport.cpp b/servers/visual/visual_server_viewport.cpp
index 63ed0ac7c4..433b6e945e 100644
--- a/servers/visual/visual_server_viewport.cpp
+++ b/servers/visual/visual_server_viewport.cpp
@@ -35,23 +35,24 @@
void VisualServerViewport::_draw_viewport(Viewport *p_viewport) {
-/* 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) {
@@ -88,7 +89,7 @@ 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) {
VSG::scene->render_camera(p_viewport->camera, p_viewport->scenario, p_viewport->size, p_viewport->shadow_atlas);
}
@@ -133,7 +134,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()) {
@@ -199,14 +200,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()) {
@@ -229,19 +231,29 @@ 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);
}
@@ -266,14 +278,29 @@ 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::storage->render_target_clear_used(vp->render_target);
+
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();
+
_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());
@@ -283,6 +310,7 @@ void VisualServerViewport::draw_viewports() {
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);
}
}
@@ -409,7 +437,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) {
@@ -518,6 +547,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 118d11a111..f963ce4aa3 100644
--- a/servers/visual/visual_server_viewport.h
+++ b/servers/visual/visual_server_viewport.h
@@ -59,13 +59,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 {
@@ -96,11 +98,15 @@ 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;
+ }
}
};
@@ -164,6 +170,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..fd15633244
--- /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 "global_config.h"
+#include "os/os.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_DEF("memory/servers/thread_rid_prealloc_amount", 20);
+
+ 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..6a1b0f7e46
--- /dev/null
+++ b/servers/visual/visual_server_wrap_mt.h
@@ -0,0 +1,591 @@
+/*************************************************************************/
+/* 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_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)
+
+ 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)
+
+ /* CURSOR */
+ FUNC2(cursor_set_rotation, float, int) // radians
+ FUNC4(cursor_set_texture, RID, const Point2 &, int, const Rect2 &)
+ FUNC2(cursor_set_visible, bool, int)
+ FUNC2(cursor_set_pos, const Point2 &, int)
+
+ /* 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 5df1ca456b..c833f4eabd 100644
--- a/servers/visual_server.cpp
+++ b/servers/visual_server.cpp
@@ -29,7 +29,7 @@
/*************************************************************************/
#include "visual_server.h"
#include "global_config.h"
-#include "method_bind_ext.inc"
+#include "method_bind_ext.gen.inc"
VisualServer *VisualServer::singleton = NULL;
VisualServer *(*VisualServer::create_func)() = NULL;
@@ -137,7 +137,7 @@ void VisualServer::_free_internal_rids() {
if (test_material.is_valid())
free(test_material);
- for (int i = 0; i < 16; i++) {
+ for (int i = 0; i < 32; i++) {
if (material_2d[i].is_valid())
free(material_2d[i]);
}
@@ -284,7 +284,7 @@ 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) {
+RID VisualServer::material_2d_get(bool p_shaded, bool p_transparent, bool p_double_sided, bool p_cut_alpha, bool p_opaque_prepass) {
int version = 0;
if (p_shaded)
@@ -295,6 +295,8 @@ RID VisualServer::material_2d_get(bool p_shaded, bool p_transparent, bool p_cut_
version |= 4;
if (p_opaque_prepass)
version |= 8;
+ if (p_double_sided)
+ version |= 16;
if (material_2d[version].is_valid())
return material_2d[version];
@@ -305,7 +307,7 @@ RID VisualServer::material_2d_get(bool p_shaded, bool p_transparent, bool p_cut_
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_flag(material_2d[version], MATERIAL_FLAG_DOUBLE_SIDED, p_double_sided);
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?*/
@@ -338,8 +340,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();
}
@@ -399,7 +399,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];
@@ -465,7 +465,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),
@@ -770,7 +770,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);
@@ -1233,11 +1233,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();
@@ -1261,9 +1262,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 {
@@ -1293,7 +1294,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();
@@ -1566,6 +1567,10 @@ VisualServer::VisualServer() {
//ERR_FAIL_COND(singleton);
singleton = this;
+ GLOBAL_DEF("rendering/vram_formats/use_s3tc", true);
+ GLOBAL_DEF("rendering/vram_formats/use_etc", false);
+ GLOBAL_DEF("rendering/vram_formats/use_etc2", true);
+ GLOBAL_DEF("rendering/vram_formats/use_pvrtc", false);
}
VisualServer::~VisualServer() {
diff --git a/servers/visual_server.h b/servers/visual_server.h
index aa98d47455..fbd7fc16ac 100644
--- a/servers/visual_server.h
+++ b/servers/visual_server.h
@@ -60,7 +60,7 @@ protected:
RID test_texture;
RID white_texture;
RID test_material;
- RID material_2d[16];
+ RID material_2d[32];
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);
@@ -128,6 +128,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;
@@ -176,6 +177,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 +360,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
};
@@ -478,6 +479,7 @@ 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;
@@ -487,6 +489,7 @@ public:
virtual void particles_set_process_material(RID p_particles, RID p_material) = 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,
@@ -501,6 +504,8 @@ public:
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;
@@ -579,7 +584,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 */
@@ -622,8 +658,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,
@@ -635,9 +670,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;
@@ -749,16 +788,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;
@@ -810,6 +851,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;
@@ -844,6 +886,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;
@@ -872,7 +916,7 @@ public:
/* Materials for 2D on 3D */
- RID material_2d_get(bool p_shaded, bool p_transparent, bool p_cut_alpha, bool p_opaque_prepass);
+ RID material_2d_get(bool p_shaded, bool p_transparent, bool p_double_sided, bool p_cut_alpha, bool p_opaque_prepass);
/* TESTING */
@@ -898,6 +942,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/thirdparty/README.md b/thirdparty/README.md
index 756b31b995..ef4f83d4ad 100644
--- a/thirdparty/README.md
+++ b/thirdparty/README.md
@@ -37,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: ?
@@ -47,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:
@@ -60,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.
@@ -296,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/
@@ -366,3 +367,14 @@ https://github.com/godotengine/godot/commit/37f5e1dcd94611dd5b670f013abf0323e8b4
Files extracted from upstream source:
- all .c and .h files
+
+## zstd
+
+- Upstream: https://github.com/facebook/zstd
+- Version: 1.2.0
+- License: BSD-3-Clause
+
+Files extracted from upstream source:
+
+- all .c and .h under lib/
+- README.md, LICENSE, PATENTS
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/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/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..7caee5fd3f
--- /dev/null
+++ b/thirdparty/zstd/README.md
@@ -0,0 +1,146 @@
+ __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).
+
+|Branch |Status |
+|------------|---------|
+|master | [![Build Status](https://travis-ci.org/facebook/zstd.svg?branch=master)](https://travis-ci.org/facebook/zstd) |
+|dev | [![Build Status](https://travis-ci.org/facebook/zstd.svg?branch=dev)](https://travis-ci.org/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 provide 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 weighting 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..ca42850df3
--- /dev/null
+++ b/thirdparty/zstd/common/bitstream.h
@@ -0,0 +1,446 @@
+/* ******************************************************************
+ 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
+# define assert(condition) ((void)0)
+#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);
+ case 6: bitD->bitContainer += (size_t)(((const BYTE*)(srcBuffer))[5]) << (sizeof(bitD->bitContainer)*8 - 24);
+ case 5: bitD->bitContainer += (size_t)(((const BYTE*)(srcBuffer))[4]) << (sizeof(bitD->bitContainer)*8 - 32);
+ case 4: bitD->bitContainer += (size_t)(((const BYTE*)(srcBuffer))[3]) << 24;
+ case 3: bitD->bitContainer += (size_t)(((const BYTE*)(srcBuffer))[2]) << 16;
+ case 2: bitD->bitContainer += (size_t)(((const BYTE*)(srcBuffer))[1]) << 8;
+ default:;
+ }
+ { 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..b3287245f1
--- /dev/null
+++ b/thirdparty/zstd/common/error_private.c
@@ -0,0 +1,44 @@
+/**
+ * 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 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(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..7873ca3d42
--- /dev/null
+++ b/thirdparty/zstd/common/huf.h
@@ -0,0 +1,283 @@
+/* ******************************************************************
+ 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);
+
+
+
+/* ******************************************************************
+ * 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_decompress4X2_DCtx(HUF_DTable* dctx, void* dst, size_t dstSize, const void* cSrc, size_t cSrcSize); /**< 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 */
+
+
+/* ****************************************
+* 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_readDTableX4 (HUF_DTable* DTable, const void* src, size_t srcSize);
+
+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_decompress1X2_DCtx(HUF_DTable* dctx, void* dst, size_t dstSize, const void* cSrc, size_t cSrcSize); /**< 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_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..4773a8b930
--- /dev/null
+++ b/thirdparty/zstd/common/mem.h
@@ -0,0 +1,373 @@
+/**
+ * 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);
+}
+
+
+/* function safe only for comparisons */
+MEM_STATIC U32 MEM_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;
+ }
+}
+
+#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..e439fe1b0d
--- /dev/null
+++ b/thirdparty/zstd/common/pool.c
@@ -0,0 +1,194 @@
+/**
+ * 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);
+}
+
+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);
+}
+
+#endif /* ZSTD_MULTITHREAD */
diff --git a/thirdparty/zstd/common/pool.h b/thirdparty/zstd/common/pool.h
new file mode 100644
index 0000000000..50cb25b12c
--- /dev/null
+++ b/thirdparty/zstd/common/pool.h
@@ -0,0 +1,56 @@
+/**
+ * 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_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..32d58796a9
--- /dev/null
+++ b/thirdparty/zstd/common/threading.c
@@ -0,0 +1,80 @@
+
+/**
+ * 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..8408a589ae
--- /dev/null
+++ b/thirdparty/zstd/common/zstd_common.c
@@ -0,0 +1,73 @@
+/**
+ * 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 */
+#include "error_private.h"
+#define ZSTD_STATIC_LINKING_ONLY
+#include "zstd.h" /* declaration of ZSTD_isError, ZSTD_getErrorName, ZSTD_getErrorCode, ZSTD_getErrorString, ZSTD_versionNumber */
+
+
+/*-****************************************
+* Version
+******************************************/
+unsigned ZSTD_versionNumber (void) { return ZSTD_VERSION_NUMBER; }
+
+
+/*-****************************************
+* 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
+****************************************************************/
+/* default uses stdlib */
+void* ZSTD_defaultAllocFunction(void* opaque, size_t size)
+{
+ void* address = malloc(size);
+ (void)opaque;
+ return address;
+}
+
+void ZSTD_defaultFreeFunction(void* opaque, void* address)
+{
+ (void)opaque;
+ free(address);
+}
+
+void* ZSTD_malloc(size_t size, ZSTD_customMem customMem)
+{
+ return customMem.customAlloc(customMem.opaque, size);
+}
+
+void ZSTD_free(void* ptr, ZSTD_customMem customMem)
+{
+ if (ptr!=NULL)
+ customMem.customFree(customMem.opaque, ptr);
+}
diff --git a/thirdparty/zstd/common/zstd_errors.h b/thirdparty/zstd/common/zstd_errors.h
new file mode 100644
index 0000000000..3d579d9693
--- /dev/null
+++ b/thirdparty/zstd/common/zstd_errors.h
@@ -0,0 +1,75 @@
+/**
+ * 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 ===== */
+#if defined(__GNUC__) && (__GNUC__ >= 4)
+# define ZSTDERRORLIB_VISIBILITY __attribute__ ((visibility ("default")))
+#else
+# define ZSTDERRORLIB_VISIBILITY
+#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
+******************************************/
+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_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_maxCode
+} ZSTD_ErrorCode;
+
+/*! ZSTD_getErrorCode() :
+ convert a `size_t` function result into a `ZSTD_ErrorCode` enum type,
+ which can be used to compare directly with enum list published into "error_public.h" */
+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..2533333ba8
--- /dev/null
+++ b/thirdparty/zstd/common/zstd_internal.h
@@ -0,0 +1,284 @@
+/**
+ * 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 : 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 */
+
+
+/*-*************************************
+* 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_DICT_MAGIC 0xEC30A437 /* v0.7+ */
+
+#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);
+int ZSTD_isSkipFrame(ZSTD_DCtx* dctx);
+
+/* custom memory allocation functions */
+void* ZSTD_defaultAllocFunction(void* opaque, size_t size);
+void ZSTD_defaultFreeFunction(void* opaque, void* address);
+#ifndef ZSTD_DLL_IMPORT
+static const ZSTD_customMem defaultCustomMem = { ZSTD_defaultAllocFunction, ZSTD_defaultFreeFunction, NULL };
+#endif
+void* ZSTD_malloc(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);
+
+
+#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..fe11aafb8f
--- /dev/null
+++ b/thirdparty/zstd/compress/huf_compress.c
@@ -0,0 +1,684 @@
+/* ******************************************************************
+ 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 !) */
+ while ((nBitsToDecrease<=HUF_TABLELOG_MAX) && (rankLast[nBitsToDecrease] == noSymbol)) /* HUF_MAX_TABLELOG test just to please gcc 5+; but it should not be necessary */
+ 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);
+ case 2 : HUF_encodeSymbol(&bitC, ip[n+ 1], CTable);
+ HUF_FLUSHBITS_1(&bitC);
+ case 1 : HUF_encodeSymbol(&bitC, ip[n+ 0], CTable);
+ HUF_FLUSHBITS(&bitC);
+ case 0 :
+ default: ;
+ }
+
+ 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..c08b315dab
--- /dev/null
+++ b/thirdparty/zstd/compress/zstd_compress.c
@@ -0,0 +1,3598 @@
+/**
+ * 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 <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 */
+
+
+/*-*************************************
+* Debug
+***************************************/
+#if defined(ZSTD_DEBUG) && (ZSTD_DEBUG>=1)
+# include <assert.h>
+#else
+# define assert(condition) ((void)0)
+#endif
+
+#define ZSTD_STATIC_ASSERT(c) { enum { ZSTD_static_assert = 1/(int)(!!(c)) }; }
+
+#if defined(ZSTD_DEBUG) && (ZSTD_DEBUG>=2)
+# include <stdio.h>
+ static unsigned g_debugLevel = ZSTD_DEBUG;
+# define DEBUGLOG(l, ...) if (l<=g_debugLevel) { fprintf(stderr, __FILE__ ": "); fprintf(stderr, __VA_ARGS__); fprintf(stderr, " \n"); }
+#else
+# define DEBUGLOG(l, ...) {} /* disabled */
+#endif
+
+
+/*-*************************************
+* 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
+***************************************/
+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 */
+ U32 forceRawDict; /* Force loading dictionary in "content-only" mode (no header analysis) */
+ ZSTD_compressionStage_e stage;
+ U32 rep[ZSTD_REP_NUM];
+ U32 repToConfirm[ZSTD_REP_NUM];
+ U32 dictID;
+ ZSTD_parameters params;
+ void* workSpace;
+ size_t workSpaceSize;
+ size_t blockSize;
+ U64 frameContentSize;
+ U64 consumedSrcSize;
+ XXH64_state_t xxhState;
+ ZSTD_customMem customMem;
+
+ 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;
+};
+
+ZSTD_CCtx* ZSTD_createCCtx(void)
+{
+ return ZSTD_createCCtx_advanced(defaultCustomMem);
+}
+
+ZSTD_CCtx* ZSTD_createCCtx_advanced(ZSTD_customMem customMem)
+{
+ ZSTD_CCtx* cctx;
+
+ if (!customMem.customAlloc && !customMem.customFree) customMem = defaultCustomMem;
+ if (!customMem.customAlloc || !customMem.customFree) return NULL;
+
+ cctx = (ZSTD_CCtx*) ZSTD_malloc(sizeof(ZSTD_CCtx), customMem);
+ if (!cctx) return NULL;
+ memset(cctx, 0, sizeof(ZSTD_CCtx));
+ cctx->customMem = customMem;
+ return cctx;
+}
+
+size_t ZSTD_freeCCtx(ZSTD_CCtx* cctx)
+{
+ if (cctx==NULL) return 0; /* support free on NULL */
+ ZSTD_free(cctx->workSpace, cctx->customMem);
+ 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 */
+ return sizeof(*cctx) + cctx->workSpaceSize;
+}
+
+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;
+ case ZSTD_p_forceRawDict : cctx->forceRawDict = value>0; return 0;
+ default: return ERROR(parameter_unknown);
+ }
+}
+
+const seqStore_t* ZSTD_getSeqStore(const ZSTD_CCtx* ctx) /* hidden interface */
+{
+ return &(ctx->seqStore);
+}
+
+static ZSTD_parameters ZSTD_getParamsFromCCtx(const ZSTD_CCtx* cctx)
+{
+ return cctx->params;
+}
+
+
+/** ZSTD_checkParams() :
+ ensure param 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)
+{
+# define CLAMPCHECK(val,min,max) { if ((val<min) | (val>max)) return ERROR(compressionParameter_unsupported); }
+ 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_btopt2) return ERROR(compressionParameter_unsupported);
+ return 0;
+}
+
+
+/** 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() :
+ 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(ZSTD_compressionParameters cPar, unsigned long long srcSize, size_t dictSize)
+{
+ 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;
+}
+
+
+size_t ZSTD_estimateCCtxSize(ZSTD_compressionParameters cParams)
+{
+ size_t const blockSize = MIN(ZSTD_BLOCKSIZE_ABSOLUTEMAX, (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 optSpace = ((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 neededSpace = entropySpace + tableSpace + tokenSpace
+ + (((cParams.strategy == ZSTD_btopt) || (cParams.strategy == ZSTD_btopt2)) ? optSpace : 0);
+
+ return sizeof(ZSTD_CCtx) + neededSpace;
+}
+
+
+static U32 ZSTD_equivalentParams(ZSTD_parameters param1, ZSTD_parameters param2)
+{
+ return (param1.cParams.hashLog == param2.cParams.hashLog)
+ & (param1.cParams.chainLog == param2.cParams.chainLog)
+ & (param1.cParams.strategy == param2.cParams.strategy)
+ & ((param1.cParams.searchLength==3) == (param2.cParams.searchLength==3));
+}
+
+/*! ZSTD_continueCCtx() :
+ reuse CCtx without reset (note : requires no dictionary) */
+static size_t ZSTD_continueCCtx(ZSTD_CCtx* cctx, ZSTD_parameters params, U64 frameContentSize)
+{
+ U32 const end = (U32)(cctx->nextSrc - cctx->base);
+ cctx->params = params;
+ cctx->frameContentSize = frameContentSize;
+ cctx->consumedSrcSize = 0;
+ 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, ZSTDcrp_fullReset } ZSTD_compResetPolicy_e;
+
+/*! ZSTD_resetCCtx_internal() :
+ note : `params` must be validated */
+static size_t ZSTD_resetCCtx_internal (ZSTD_CCtx* zc,
+ ZSTD_parameters params, U64 frameContentSize,
+ ZSTD_compResetPolicy_e const crp)
+{
+ if (crp == ZSTDcrp_continue)
+ if (ZSTD_equivalentParams(params, zc->params)) {
+ zc->fseCTables_ready = 0;
+ zc->hufCTable_repeatMode = HUF_repeat_none;
+ return ZSTD_continueCCtx(zc, params, frameContentSize);
+ }
+
+ { size_t const blockSize = MIN(ZSTD_BLOCKSIZE_ABSOLUTEMAX, (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);
+ 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_btopt2)) ? optPotentialSpace : 0;
+ size_t const neededSpace = entropySpace + optSpace + tableSpace + tokenSpace;
+ if (zc->workSpaceSize < neededSpace) {
+ 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->params = params;
+ zc->blockSize = blockSize;
+ zc->frameContentSize = frameContentSize;
+ zc->consumedSrcSize = 0;
+
+ 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_btopt2)) {
+ 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;
+
+ 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 */
+size_t ZSTD_copyCCtx_internal(ZSTD_CCtx* dstCCtx, const ZSTD_CCtx* srcCCtx,
+ ZSTD_frameParameters fParams, unsigned long long pledgedSrcSize)
+{
+ if (srcCCtx->stage!=ZSTDcs_init) return ERROR(stage_wrong);
+
+ memcpy(&dstCCtx->customMem, &srcCCtx->customMem, sizeof(ZSTD_customMem));
+ { ZSTD_parameters params = srcCCtx->params;
+ params.fParams = fParams;
+ DEBUGLOG(5, "ZSTD_resetCCtx_internal : dictIDFlag : %u \n", !fParams.noDictIDFlag);
+ ZSTD_resetCCtx_internal(dstCCtx, params, pledgedSrcSize, ZSTDcrp_noMemset);
+ }
+
+ /* copy tables */
+ { size_t const chainSize = (srcCCtx->params.cParams.strategy == ZSTD_fast) ? 0 : (1 << srcCCtx->params.cParams.chainLog);
+ size_t const hSize = (size_t)1 << srcCCtx->params.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*/ };
+ fParams.contentSizeFlag = pledgedSrcSize>0;
+
+ return ZSTD_copyCCtx_internal(dstCCtx, srcCCtx, fParams, pledgedSrcSize);
+}
+
+
+/*! 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->params.cParams.hashLog;
+ ZSTD_reduceTable(zc->hashTable, hSize, reducerValue); }
+
+ { U32 const chainSize = (zc->params.cParams.strategy == ZSTD_fast) ? 0 : (1 << zc->params.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;
+ default: /*note : should not be necessary : flSize is within {1,2,3} */
+ case 3: /* 2 - 2 - 20 */
+ MEM_writeLE32(ostart, (U32)((U32)set_basic + (3<<2) + (srcSize<<4)));
+ break;
+ }
+
+ 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;
+ default: /*note : should not be necessary : flSize is necessarily within {1,2,3} */
+ case 3: /* 2 - 2 - 20 */
+ MEM_writeLE32(ostart, (U32)((U32)set_rle + (3<<2) + (srcSize<<4)));
+ break;
+ }
+
+ 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->params.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;
+ }
+ default: /* should not be necessary, lhSize is only {3,4,5} */
+ 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;
+ }
+ }
+ 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->params.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;
+}
+
+#if 0 /* for debug */
+# define STORESEQ_DEBUG
+#include <stdio.h> /* fprintf */
+U32 g_startDebug = 0;
+const BYTE* g_start = NULL;
+#endif
+
+/*! 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)
+{
+#ifdef STORESEQ_DEBUG
+ if (g_startDebug) {
+ const U32 pos = (U32)((const BYTE*)literals - g_start);
+ if (g_start==NULL) g_start = (const BYTE*)literals;
+ if ((pos > 1895000) && (pos < 1895300))
+ DEBUGLOG(5, "Cpos %6u :%5u literals & match %3u bytes at distance %6u \n",
+ pos, (U32)litLength, (U32)matchCode+MINMATCH, (U32)offsetCode);
+ }
+#endif
+ /* copy Literals */
+ 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->params.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->params.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->params.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->params.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->params.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->params.cParams.hashLog;
+ U32* const hashSmall = cctx->chainTable;
+ U32 const hBitsS = cctx->params.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->params.cParams.hashLog;
+ U32* const hashSmall = cctx->chainTable;
+ const U32 hBitsS = cctx->params.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->params.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->params.cParams.hashLog;
+ U32* const hashSmall = ctx->chainTable;
+ U32 const hBitsS = ctx->params.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->params.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->params.cParams.hashLog;
+ size_t const h = ZSTD_hashPtr(ip, hashLog, mls);
+ U32* const bt = zc->chainTable;
+ U32 const btLog = zc->params.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->params.cParams.hashLog;
+ size_t const h = ZSTD_hashPtr(ip, hashLog, mls);
+ U32* const bt = zc->chainTable;
+ U32 const btLog = zc->params.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->params.cParams.hashLog;
+ U32* const chainTable = zc->chainTable;
+ const U32 chainMask = (1 << zc->params.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)];
+}
+
+
+
+FORCE_INLINE /* inlining is important to hardwire a hot branch (template emulation) */
+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->params.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->params.cParams.searchLog;
+ U32 const mls = ctx->params.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 */
+ }
+
+ /* catch up */
+ if (offset) {
+ while ( (start > anchor)
+ && (start > base+offset-ZSTD_REP_MOVE)
+ && (start[-1] == start[-1-offset+ZSTD_REP_MOVE]) ) /* 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->params.cParams.searchLog;
+ const U32 mls = ctx->params.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_btopt2(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_btopt2_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
+}
+
+
+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][8] = {
+ { ZSTD_compressBlock_fast, ZSTD_compressBlock_doubleFast, ZSTD_compressBlock_greedy,
+ ZSTD_compressBlock_lazy, ZSTD_compressBlock_lazy2, ZSTD_compressBlock_btlazy2,
+ ZSTD_compressBlock_btopt, ZSTD_compressBlock_btopt2 },
+ { 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_btopt2_extDict }
+ };
+
+ return blockCompressor[extDict][(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->params.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_generic() :
+* 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_generic (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->params.cParams.windowLog;
+
+ if (cctx->params.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->params.cParams.hashLog, cctx->params.cParams.strategy)) - 1;
+ U32 const current = (U32)(ip - cctx->base);
+ U32 const newCurrent = (current & cycleMask) + (1 << cctx->params.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-3 */
+ 0;
+ 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 \n", !params.fParams.noDictIDFlag);
+ DEBUGLOG(5, "ZSTD_writeFrameHeader : dictID : %u \n", dictID);
+ DEBUGLOG(5, "ZSTD_writeFrameHeader : dictIDSizeCode : %u \n", dictIDSizeCode);
+
+ MEM_writeLE32(dst, ZSTD_MAGICNUMBER);
+ op[4] = frameHeaderDecriptionByte; pos=5;
+ if (!singleSegment) op[pos++] = windowLogByte;
+ switch(dictIDSizeCode)
+ {
+ default: /* 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: /* 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;
+
+ 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->params, cctx->frameContentSize, 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_generic (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_getBlockSizeMax(ZSTD_CCtx* cctx)
+{
+ return MIN (ZSTD_BLOCKSIZE_ABSOLUTEMAX, 1 << cctx->params.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_getBlockSizeMax(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->params.cParams.strategy)
+ {
+ case ZSTD_fast:
+ ZSTD_fillHashTable (zc, iend, zc->params.cParams.searchLength);
+ break;
+
+ case ZSTD_dfast:
+ ZSTD_fillDoubleHashTable (zc, iend, zc->params.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->params.cParams.searchLength);
+ break;
+
+ case ZSTD_btlazy2:
+ case ZSTD_btopt:
+ case ZSTD_btopt2:
+ if (srcSize >= HASH_READ_SIZE)
+ ZSTD_updateTree(zc, iend-HASH_READ_SIZE, iend, 1 << zc->params.cParams.searchLog, zc->params.cParams.searchLength);
+ break;
+
+ default:
+ return ERROR(GENERIC); /* strategy doesn't exist; impossible */
+ }
+
+ 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->params.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)
+{
+ if ((dict==NULL) || (dictSize<=8)) return 0;
+
+ /* dict as pure content */
+ if ((MEM_readLE32(dict) != ZSTD_DICT_MAGIC) || (cctx->forceRawDict))
+ return ZSTD_loadDictionaryContent(cctx, dict, dictSize);
+
+ /* dict as 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_parameters params, U64 pledgedSrcSize)
+{
+ ZSTD_compResetPolicy_e const crp = dictSize ? ZSTDcrp_fullReset : ZSTDcrp_continue;
+ assert(!ZSTD_isError(ZSTD_checkCParams(params.cParams)));
+ CHECK_F(ZSTD_resetCCtx_internal(cctx, params, pledgedSrcSize, crp));
+ return ZSTD_compress_insertDictionary(cctx, dict, dictSize);
+}
+
+
+/*! 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, params, pledgedSrcSize);
+}
+
+
+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, params, 0);
+}
+
+
+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;
+
+ 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->params, 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->params.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->params.fParams.contentSizeFlag) { /* control src size */
+ if (cctx->frameContentSize != 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, params, srcSize));
+ 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));
+ memcpy(&ctxBody.customMem, &defaultCustomMem, sizeof(ZSTD_customMem));
+ result = ZSTD_compressCCtx(&ctxBody, dst, dstCapacity, src, srcSize, compressionLevel);
+ ZSTD_free(ctxBody.workSpace, defaultCustomMem); /* can't free ctxBody itself, as it's on stack; free only heap content */
+ return result;
+}
+
+
+/* ===== Dictionary API ===== */
+
+struct ZSTD_CDict_s {
+ void* dictBuffer;
+ const void* dictContent;
+ size_t dictContentSize;
+ ZSTD_CCtx* refContext;
+}; /* typedef'd tp ZSTD_CDict within "zstd.h" */
+
+size_t ZSTD_sizeof_CDict(const ZSTD_CDict* cdict)
+{
+ if (cdict==NULL) return 0; /* support sizeof on NULL */
+ 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;
+}
+
+ZSTD_CDict* ZSTD_createCDict_advanced(const void* dictBuffer, size_t dictSize, unsigned byReference,
+ ZSTD_compressionParameters cParams, ZSTD_customMem customMem)
+{
+ if (!customMem.customAlloc && !customMem.customFree) customMem = defaultCustomMem;
+ 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;
+ }
+
+ if ((byReference) || (!dictBuffer) || (!dictSize)) {
+ cdict->dictBuffer = NULL;
+ cdict->dictContent = dictBuffer;
+ } else {
+ void* const internalBuffer = ZSTD_malloc(dictSize, customMem);
+ if (!internalBuffer) { ZSTD_free(cctx, customMem); ZSTD_free(cdict, customMem); return NULL; }
+ memcpy(internalBuffer, dictBuffer, dictSize);
+ cdict->dictBuffer = internalBuffer;
+ cdict->dictContent = internalBuffer;
+ }
+
+ { ZSTD_frameParameters const fParams = { 0 /* contentSizeFlag */, 0 /* checksumFlag */, 0 /* noDictIDFlag */ }; /* dummy */
+ ZSTD_parameters const params = ZSTD_makeParams(cParams, fParams);
+ size_t const errorCode = ZSTD_compressBegin_advanced(cctx, cdict->dictContent, dictSize, params, 0);
+ if (ZSTD_isError(errorCode)) {
+ ZSTD_free(cdict->dictBuffer, customMem);
+ ZSTD_free(cdict, customMem);
+ ZSTD_freeCCtx(cctx);
+ return NULL;
+ } }
+
+ cdict->refContext = cctx;
+ cdict->dictContentSize = dictSize;
+ return cdict;
+ }
+}
+
+ZSTD_CDict* ZSTD_createCDict(const void* dict, size_t dictSize, int compressionLevel)
+{
+ ZSTD_customMem const allocator = { NULL, NULL, NULL };
+ ZSTD_compressionParameters cParams = ZSTD_getCParams(compressionLevel, 0, dictSize);
+ return ZSTD_createCDict_advanced(dict, dictSize, 0, cParams, allocator);
+}
+
+ZSTD_CDict* ZSTD_createCDict_byReference(const void* dict, size_t dictSize, int compressionLevel)
+{
+ ZSTD_customMem const allocator = { NULL, NULL, NULL };
+ ZSTD_compressionParameters cParams = ZSTD_getCParams(compressionLevel, 0, dictSize);
+ return ZSTD_createCDict_advanced(dict, dictSize, 1, cParams, allocator);
+}
+
+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;
+ }
+}
+
+static 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(GENERIC); /* does not support NULL cdict */
+ DEBUGLOG(5, "ZSTD_compressBegin_usingCDict_advanced : dictIDFlag == %u \n", !fParams.noDictIDFlag);
+ if (cdict->dictContentSize)
+ CHECK_F( ZSTD_copyCCtx_internal(cctx, cdict->refContext, fParams, pledgedSrcSize) )
+ else {
+ ZSTD_parameters params = cdict->refContext->params;
+ params.fParams = fParams;
+ CHECK_F(ZSTD_compressBegin_internal(cctx, NULL, 0, params, pledgedSrcSize));
+ }
+ return 0;
+}
+
+/* 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 \n", !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
+********************************************************************/
+
+typedef enum { zcss_init, zcss_load, zcss_flush, zcss_final } ZSTD_cStreamStage;
+
+struct ZSTD_CStream_s {
+ ZSTD_CCtx* cctx;
+ ZSTD_CDict* cdictLocal;
+ const ZSTD_CDict* cdict;
+ char* inBuff;
+ size_t inBuffSize;
+ size_t inToCompress;
+ size_t inBuffPos;
+ size_t inBuffTarget;
+ size_t blockSize;
+ char* outBuff;
+ size_t outBuffSize;
+ size_t outBuffContentSize;
+ size_t outBuffFlushedSize;
+ ZSTD_cStreamStage stage;
+ U32 checksum;
+ U32 frameEnded;
+ U64 pledgedSrcSize;
+ ZSTD_parameters params;
+ ZSTD_customMem customMem;
+}; /* typedef'd to ZSTD_CStream within "zstd.h" */
+
+ZSTD_CStream* ZSTD_createCStream(void)
+{
+ return ZSTD_createCStream_advanced(defaultCustomMem);
+}
+
+ZSTD_CStream* ZSTD_createCStream_advanced(ZSTD_customMem customMem)
+{
+ ZSTD_CStream* zcs;
+
+ if (!customMem.customAlloc && !customMem.customFree) customMem = defaultCustomMem;
+ if (!customMem.customAlloc || !customMem.customFree) return NULL;
+
+ zcs = (ZSTD_CStream*)ZSTD_malloc(sizeof(ZSTD_CStream), customMem);
+ if (zcs==NULL) return NULL;
+ memset(zcs, 0, sizeof(ZSTD_CStream));
+ memcpy(&zcs->customMem, &customMem, sizeof(ZSTD_customMem));
+ zcs->cctx = ZSTD_createCCtx_advanced(customMem);
+ if (zcs->cctx == NULL) { ZSTD_freeCStream(zcs); return NULL; }
+ return zcs;
+}
+
+size_t ZSTD_freeCStream(ZSTD_CStream* zcs)
+{
+ if (zcs==NULL) return 0; /* support free on NULL */
+ { ZSTD_customMem const cMem = zcs->customMem;
+ ZSTD_freeCCtx(zcs->cctx);
+ zcs->cctx = NULL;
+ ZSTD_freeCDict(zcs->cdictLocal);
+ zcs->cdictLocal = NULL;
+ ZSTD_free(zcs->inBuff, cMem);
+ zcs->inBuff = NULL;
+ ZSTD_free(zcs->outBuff, cMem);
+ zcs->outBuff = NULL;
+ ZSTD_free(zcs, cMem);
+ return 0;
+ }
+}
+
+
+/*====== Initialization ======*/
+
+size_t ZSTD_CStreamInSize(void) { return ZSTD_BLOCKSIZE_ABSOLUTEMAX; }
+
+size_t ZSTD_CStreamOutSize(void)
+{
+ return ZSTD_compressBound(ZSTD_BLOCKSIZE_ABSOLUTEMAX) + ZSTD_blockHeaderSize + 4 /* 32-bits hash */ ;
+}
+
+static size_t ZSTD_resetCStream_internal(ZSTD_CStream* zcs, unsigned long long pledgedSrcSize)
+{
+ if (zcs->inBuffSize==0) return ERROR(stage_wrong); /* zcs has not been init at least once => can't reset */
+
+ DEBUGLOG(5, "ZSTD_resetCStream_internal : dictIDFlag == %u \n", !zcs->params.fParams.noDictIDFlag);
+
+ if (zcs->cdict) CHECK_F(ZSTD_compressBegin_usingCDict_advanced(zcs->cctx, zcs->cdict, zcs->params.fParams, pledgedSrcSize))
+ else CHECK_F(ZSTD_compressBegin_internal(zcs->cctx, NULL, 0, zcs->params, pledgedSrcSize));
+
+ zcs->inToCompress = 0;
+ zcs->inBuffPos = 0;
+ zcs->inBuffTarget = zcs->blockSize;
+ zcs->outBuffContentSize = zcs->outBuffFlushedSize = 0;
+ zcs->stage = zcss_load;
+ zcs->frameEnded = 0;
+ zcs->pledgedSrcSize = pledgedSrcSize;
+ return 0; /* ready to go */
+}
+
+size_t ZSTD_resetCStream(ZSTD_CStream* zcs, unsigned long long pledgedSrcSize)
+{
+
+ zcs->params.fParams.contentSizeFlag = (pledgedSrcSize > 0);
+ DEBUGLOG(5, "ZSTD_resetCStream : dictIDFlag == %u \n", !zcs->params.fParams.noDictIDFlag);
+ return ZSTD_resetCStream_internal(zcs, pledgedSrcSize);
+}
+
+/* ZSTD_initCStream_internal() :
+ * params are supposed validated at this stage
+ * and zcs->cdict is supposed to be correct */
+static size_t ZSTD_initCStream_stage2(ZSTD_CStream* zcs,
+ const ZSTD_parameters params,
+ unsigned long long pledgedSrcSize)
+{
+ assert(!ZSTD_isError(ZSTD_checkCParams(params.cParams)));
+
+ /* allocate buffers */
+ { size_t const neededInBuffSize = (size_t)1 << params.cParams.windowLog;
+ if (zcs->inBuffSize < neededInBuffSize) {
+ zcs->inBuffSize = 0;
+ ZSTD_free(zcs->inBuff, zcs->customMem);
+ zcs->inBuff = (char*) ZSTD_malloc(neededInBuffSize, zcs->customMem);
+ if (zcs->inBuff == NULL) return ERROR(memory_allocation);
+ zcs->inBuffSize = neededInBuffSize;
+ }
+ zcs->blockSize = MIN(ZSTD_BLOCKSIZE_ABSOLUTEMAX, neededInBuffSize);
+ }
+ if (zcs->outBuffSize < ZSTD_compressBound(zcs->blockSize)+1) {
+ size_t const outBuffSize = ZSTD_compressBound(zcs->blockSize)+1;
+ zcs->outBuffSize = 0;
+ ZSTD_free(zcs->outBuff, zcs->customMem);
+ zcs->outBuff = (char*) ZSTD_malloc(outBuffSize, zcs->customMem);
+ if (zcs->outBuff == NULL) return ERROR(memory_allocation);
+ zcs->outBuffSize = outBuffSize;
+ }
+
+ zcs->checksum = params.fParams.checksumFlag > 0;
+ zcs->params = params;
+
+ DEBUGLOG(5, "ZSTD_initCStream_stage2 : dictIDFlag == %u \n", !params.fParams.noDictIDFlag);
+ return ZSTD_resetCStream_internal(zcs, 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, unsigned long long pledgedSrcSize, ZSTD_frameParameters fParams)
+{
+ if (!cdict) return ERROR(GENERIC); /* cannot handle NULL cdict (does not know what to do) */
+ { ZSTD_parameters params = ZSTD_getParamsFromCDict(cdict);
+ params.fParams = fParams;
+ zcs->cdict = cdict;
+ return ZSTD_initCStream_stage2(zcs, 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 /* content */, 0 /* checksum */, 0 /* noDictID */ };
+ return ZSTD_initCStream_usingCDict_advanced(zcs, cdict, 0, fParams);
+}
+
+static size_t ZSTD_initCStream_internal(ZSTD_CStream* zcs,
+ const void* dict, size_t dictSize,
+ ZSTD_parameters params, unsigned long long pledgedSrcSize)
+{
+ assert(!ZSTD_isError(ZSTD_checkCParams(params.cParams)));
+ zcs->cdict = NULL;
+
+ if (dict && dictSize >= 8) {
+ ZSTD_freeCDict(zcs->cdictLocal);
+ zcs->cdictLocal = ZSTD_createCDict_advanced(dict, dictSize, 0 /* copy */, params.cParams, zcs->customMem);
+ if (zcs->cdictLocal == NULL) return ERROR(memory_allocation);
+ zcs->cdict = zcs->cdictLocal;
+ }
+
+ DEBUGLOG(5, "ZSTD_initCStream_internal : dictIDFlag == %u \n", !params.fParams.noDictIDFlag);
+ return ZSTD_initCStream_stage2(zcs, params, pledgedSrcSize);
+}
+
+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) );
+ DEBUGLOG(5, "ZSTD_initCStream_advanced : dictIDFlag == %u \n", !params.fParams.noDictIDFlag);
+ return ZSTD_initCStream_internal(zcs, dict, dictSize, 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);
+ return ZSTD_initCStream_internal(zcs, dict, dictSize, 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, 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, params, 0);
+}
+
+size_t ZSTD_sizeof_CStream(const ZSTD_CStream* zcs)
+{
+ if (zcs==NULL) return 0; /* support sizeof on NULL */
+ return sizeof(*zcs) + ZSTD_sizeof_CCtx(zcs->cctx) + ZSTD_sizeof_CDict(zcs->cdictLocal) + zcs->outBuffSize + zcs->inBuffSize;
+}
+
+/*====== Compression ======*/
+
+typedef enum { zsf_gather, zsf_flush, zsf_end } ZSTD_flush_e;
+
+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;
+}
+
+static size_t ZSTD_compressStream_generic(ZSTD_CStream* zcs,
+ void* dst, size_t* dstCapacityPtr,
+ const void* src, size_t* srcSizePtr,
+ ZSTD_flush_e const flush)
+{
+ U32 someMoreWork = 1;
+ const char* const istart = (const char*)src;
+ const char* const iend = istart + *srcSizePtr;
+ const char* ip = istart;
+ char* const ostart = (char*)dst;
+ char* const oend = ostart + *dstCapacityPtr;
+ char* op = ostart;
+
+ while (someMoreWork) {
+ switch(zcs->stage)
+ {
+ case zcss_init: return ERROR(init_missing); /* call ZBUFF_compressInit() first ! */
+
+ case zcss_load:
+ /* complete 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 ( (zcs->inBuffPos==zcs->inToCompress) || (!flush && (toLoad != loaded)) ) {
+ someMoreWork = 0; break; /* not enough input to get a full block : stop there, wait for more */
+ } }
+ /* compress current block (note : this stage cannot be stopped in the middle) */
+ { void* cDst;
+ size_t cSize;
+ size_t const iSize = zcs->inBuffPos - zcs->inToCompress;
+ size_t oSize = oend-op;
+ if (oSize >= ZSTD_compressBound(iSize))
+ cDst = op; /* compress directly into output buffer (avoid flush stage) */
+ else
+ cDst = zcs->outBuff, oSize = zcs->outBuffSize;
+ cSize = (flush == zsf_end) ?
+ ZSTD_compressEnd(zcs->cctx, cDst, oSize, zcs->inBuff + zcs->inToCompress, iSize) :
+ ZSTD_compressContinue(zcs->cctx, cDst, oSize, zcs->inBuff + zcs->inToCompress, iSize);
+ if (ZSTD_isError(cSize)) return cSize;
+ if (flush == zsf_end) zcs->frameEnded = 1;
+ /* prepare next block */
+ zcs->inBuffTarget = zcs->inBuffPos + zcs->blockSize;
+ if (zcs->inBuffTarget > zcs->inBuffSize)
+ zcs->inBuffPos = 0, zcs->inBuffTarget = zcs->blockSize; /* note : inBuffSize >= blockSize */
+ zcs->inToCompress = zcs->inBuffPos;
+ if (cDst == op) { op += cSize; break; } /* no need to flush */
+ zcs->outBuffContentSize = cSize;
+ zcs->outBuffFlushedSize = 0;
+ zcs->stage = zcss_flush; /* pass-through to flush stage */
+ }
+
+ case zcss_flush:
+ { size_t const toFlush = zcs->outBuffContentSize - zcs->outBuffFlushedSize;
+ size_t const flushed = ZSTD_limitCopy(op, oend-op, zcs->outBuff + zcs->outBuffFlushedSize, toFlush);
+ op += flushed;
+ zcs->outBuffFlushedSize += flushed;
+ if (toFlush!=flushed) { someMoreWork = 0; break; } /* dst too small to store flushed data : stop there */
+ zcs->outBuffContentSize = zcs->outBuffFlushedSize = 0;
+ zcs->stage = zcss_load;
+ break;
+ }
+
+ case zcss_final:
+ someMoreWork = 0; /* do nothing */
+ break;
+
+ default:
+ return ERROR(GENERIC); /* impossible */
+ }
+ }
+
+ *srcSizePtr = ip - istart;
+ *dstCapacityPtr = 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)
+{
+ size_t sizeRead = input->size - input->pos;
+ size_t sizeWritten = output->size - output->pos;
+ size_t const result = ZSTD_compressStream_generic(zcs,
+ (char*)(output->dst) + output->pos, &sizeWritten,
+ (const char*)(input->src) + input->pos, &sizeRead, zsf_gather);
+ input->pos += sizeRead;
+ output->pos += sizeWritten;
+ return result;
+}
+
+
+/*====== Finalize ======*/
+
+/*! ZSTD_flushStream() :
+* @return : amount of data remaining to flush */
+size_t ZSTD_flushStream(ZSTD_CStream* zcs, ZSTD_outBuffer* output)
+{
+ size_t srcSize = 0;
+ size_t sizeWritten = output->size - output->pos;
+ size_t const result = ZSTD_compressStream_generic(zcs,
+ (char*)(output->dst) + output->pos, &sizeWritten,
+ &srcSize, &srcSize, /* use a valid src address instead of NULL */
+ zsf_flush);
+ output->pos += sizeWritten;
+ if (ZSTD_isError(result)) return result;
+ return zcs->outBuffContentSize - zcs->outBuffFlushedSize; /* remaining to flush */
+}
+
+
+size_t ZSTD_endStream(ZSTD_CStream* zcs, ZSTD_outBuffer* output)
+{
+ BYTE* const ostart = (BYTE*)(output->dst) + output->pos;
+ BYTE* const oend = (BYTE*)(output->dst) + output->size;
+ BYTE* op = ostart;
+
+ if (zcs->stage != zcss_final) {
+ /* flush whatever remains */
+ size_t srcSize = 0;
+ size_t sizeWritten = output->size - output->pos;
+ size_t const notEnded = ZSTD_compressStream_generic(zcs, ostart, &sizeWritten,
+ &srcSize /* use a valid src address instead of NULL */, &srcSize, zsf_end);
+ size_t const remainingToFlush = zcs->outBuffContentSize - zcs->outBuffFlushedSize;
+ op += sizeWritten;
+ if (remainingToFlush) {
+ output->pos += sizeWritten;
+ return remainingToFlush + ZSTD_BLOCKHEADERSIZE /* final empty block */ + (zcs->checksum * 4);
+ }
+ /* create epilogue */
+ zcs->stage = zcss_final;
+ zcs->outBuffContentSize = !notEnded ? 0 :
+ /* write epilogue, including final empty block, into outBuff */
+ ZSTD_compressEnd(zcs->cctx, zcs->outBuff, zcs->outBuffSize, NULL, 0);
+ if (ZSTD_isError(zcs->outBuffContentSize)) return zcs->outBuffContentSize;
+ }
+
+ /* flush epilogue */
+ { size_t const toFlush = zcs->outBuffContentSize - zcs->outBuffFlushedSize;
+ size_t const flushed = ZSTD_limitCopy(op, oend-op, zcs->outBuff + zcs->outBuffFlushedSize, toFlush);
+ op += flushed;
+ zcs->outBuffFlushedSize += flushed;
+ output->pos += op-ostart;
+ if (toFlush==flushed) zcs->stage = zcss_init; /* end reached */
+ return toFlush - flushed;
+ }
+}
+
+
+
+/*-===== Pre-defined compression levels =====-*/
+
+#define ZSTD_DEFAULT_CLEVEL 1
+#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" */
+ /* 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, 18, 18, 1, 5, 16, ZSTD_dfast }, /* level 4.*/
+ { 20, 15, 18, 3, 5, 16, ZSTD_greedy }, /* level 5 */
+ { 21, 16, 19, 2, 5, 16, ZSTD_lazy }, /* level 6 */
+ { 21, 17, 20, 3, 5, 16, ZSTD_lazy }, /* level 7 */
+ { 21, 18, 20, 3, 5, 16, ZSTD_lazy2 }, /* level 8 */
+ { 21, 20, 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, 21, 5, 5, 16, ZSTD_btlazy2 }, /* level 15 */
+ { 23, 22, 22, 5, 5, 16, ZSTD_btlazy2 }, /* level 16 */
+ { 23, 21, 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_btopt2 }, /* level 20 */
+ { 26, 26, 23, 7, 3,256, ZSTD_btopt2 }, /* level 21 */
+ { 27, 27, 25, 9, 3,512, ZSTD_btopt2 }, /* 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_btopt2 }, /* level 20.*/
+ { 18, 19, 18, 12, 3,512, ZSTD_btopt2 }, /* level 21.*/
+ { 18, 19, 18, 13, 3,512, ZSTD_btopt2 }, /* 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_btopt2 }, /* level 20.*/
+ { 17, 18, 17, 10, 3,256, ZSTD_btopt2 }, /* level 21.*/
+ { 17, 18, 17, 11, 3,512, ZSTD_btopt2 }, /* 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_btopt2 }, /* level 20.*/
+ { 14, 15, 15, 9, 3,256, ZSTD_btopt2 }, /* level 21.*/
+ { 14, 15, 15, 10, 3,256, ZSTD_btopt2 }, /* level 22.*/
+},
+};
+
+/*! 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 srcSize, size_t dictSize)
+{
+ ZSTD_compressionParameters cp;
+ size_t const addedSize = srcSize ? 0 : 500;
+ U64 const rSize = srcSize+dictSize ? srcSize+dictSize+addedSize : (U64)-1;
+ U32 const tableID = (rSize <= 256 KB) + (rSize <= 128 KB) + (rSize <= 16 KB); /* intentional underflow for srcSizeHint == 0 */
+ if (compressionLevel <= 0) compressionLevel = ZSTD_DEFAULT_CLEVEL; /* 0 == default; no negative compressionLevel yet */
+ if (compressionLevel > ZSTD_MAX_CLEVEL) compressionLevel = ZSTD_MAX_CLEVEL;
+ cp = ZSTD_defaultCParameters[tableID][compressionLevel];
+ if (MEM_32bits()) { /* auto-correction, for 32-bits mode */
+ if (cp.windowLog > ZSTD_WINDOWLOG_MAX) cp.windowLog = ZSTD_WINDOWLOG_MAX;
+ if (cp.chainLog > ZSTD_CHAINLOG_MAX) cp.chainLog = ZSTD_CHAINLOG_MAX;
+ if (cp.hashLog > ZSTD_HASHLOG_MAX) cp.hashLog = ZSTD_HASHLOG_MAX;
+ }
+ cp = ZSTD_adjustCParams(cp, srcSize, dictSize);
+ return cp;
+}
+
+/*! 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 srcSize, size_t dictSize) {
+ ZSTD_parameters params;
+ ZSTD_compressionParameters const cParams = ZSTD_getCParams(compressionLevel, srcSize, 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..5437611912
--- /dev/null
+++ b/thirdparty/zstd/compress/zstd_opt.h
@@ -0,0 +1,921 @@
+/**
+ * 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;
+
+ 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_; \
+ }
+
+
+
+/* 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->params.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->params.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 (MEM_readMINMATCH(match, MINMATCH) == MEM_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->params.cParams.searchLog;
+ const U32 sufficient_len = ctx->params.cParams.targetLength;
+ const U32 mls = ctx->params.cParams.searchLength;
+ const U32 minMatch = (ctx->params.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))
+ && (MEM_readMINMATCH(ip, minMatch) == MEM_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))
+ && (MEM_readMINMATCH(inr, minMatch) == MEM_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->params.cParams.searchLog;
+ const U32 sufficient_len = ctx->params.cParams.targetLength;
+ const U32 mls = ctx->params.cParams.searchLength;
+ const U32 minMatch = (ctx->params.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 */
+ && (MEM_readMINMATCH(ip, minMatch) == MEM_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 */
+ && (MEM_readMINMATCH(inr, minMatch) == MEM_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..fc7f52a290
--- /dev/null
+++ b/thirdparty/zstd/compress/zstdmt_compress.c
@@ -0,0 +1,751 @@
+/**
+ * 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 <stdlib.h> /* malloc */
+#include <string.h> /* memcpy */
+#include "pool.h" /* threadpool */
+#include "threading.h" /* mutex */
+#include "zstd_internal.h" /* MIN, ERROR, ZSTD_*, ZSTD_highbit32 */
+#include "zstdmt_compress.h"
+
+
+/* ====== Debug ====== */
+#if 0
+
+# include <stdio.h>
+# include <unistd.h>
+# include <sys/times.h>
+ static unsigned g_debugLevel = 5;
+# define DEBUGLOGRAW(l, ...) if (l<=g_debugLevel) { fprintf(stderr, __VA_ARGS__); }
+# define DEBUGLOG(l, ...) if (l<=g_debugLevel) { fprintf(stderr, __FILE__ ": "); fprintf(stderr, __VA_ARGS__); fprintf(stderr, " \n"); }
+
+# 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 5
+#define PTHREAD_MUTEX_LOCK(mutex) \
+if (g_debugLevel>=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 DEBUGLOG(l, ...) {} /* disabled */
+# 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;
+ buffer_t bTable[1]; /* variable size */
+} ZSTDMT_bufferPool;
+
+static ZSTDMT_bufferPool* ZSTDMT_createBufferPool(unsigned nbThreads)
+{
+ unsigned const maxNbBuffers = 2*nbThreads + 2;
+ ZSTDMT_bufferPool* const bufPool = (ZSTDMT_bufferPool*)calloc(1, sizeof(ZSTDMT_bufferPool) + (maxNbBuffers-1) * sizeof(buffer_t));
+ if (bufPool==NULL) return NULL;
+ bufPool->totalBuffers = maxNbBuffers;
+ bufPool->nbBuffers = 0;
+ 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++)
+ free(bufPool->bTable[u].start);
+ free(bufPool);
+}
+
+/* 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;
+ free(buf.start); /* size conditions not respected : scratch this buffer and create a new one */
+ }
+ /* create new buffer */
+ { buffer_t buffer;
+ void* const start = malloc(bSize);
+ 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) */
+ free(buf.start);
+}
+
+
+/* ===== CCtx Pool ===== */
+
+typedef struct {
+ unsigned totalCCtx;
+ unsigned availCCtx;
+ 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 */
+ free(pool);
+}
+
+/* ZSTDMT_createCCtxPool() :
+ * implies nbThreads >= 1 , checked by caller ZSTDMT_createCCtx() */
+static ZSTDMT_CCtxPool* ZSTDMT_createCCtxPool(unsigned nbThreads)
+{
+ ZSTDMT_CCtxPool* const cctxPool = (ZSTDMT_CCtxPool*) calloc(1, sizeof(ZSTDMT_CCtxPool) + (nbThreads-1)*sizeof(ZSTD_CCtx*));
+ if (!cctxPool) return NULL;
+ cctxPool->totalCCtx = nbThreads;
+ cctxPool->availCCtx = 1; /* at least one cctx for single-thread mode */
+ cctxPool->cctx[0] = ZSTD_createCCtx();
+ if (!cctxPool->cctx[0]) { ZSTDMT_freeCCtxPool(cctxPool); return NULL; }
+ DEBUGLOG(1, "cctxPool created, with %u threads", nbThreads);
+ return cctxPool;
+}
+
+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;
+ 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(3, "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);
+ if (job->cdict) DEBUGLOG(3, "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(4, "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(3, "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_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_CDict* cdict;
+ ZSTD_CStream* cstream;
+ ZSTDMT_jobDescription jobs[1]; /* variable size (must lies at the end) */
+};
+
+ZSTDMT_CCtx *ZSTDMT_createCCtx(unsigned nbThreads)
+{
+ ZSTDMT_CCtx* cctx;
+ U32 const minNbJobs = nbThreads + 2;
+ U32 const nbJobsLog2 = ZSTD_highbit32(minNbJobs) + 1;
+ U32 const nbJobs = 1 << nbJobsLog2;
+ DEBUGLOG(5, "nbThreads : %u ; minNbJobs : %u ; nbJobsLog2 : %u ; nbJobs : %u \n",
+ nbThreads, minNbJobs, nbJobsLog2, nbJobs);
+ if ((nbThreads < 1) | (nbThreads > ZSTDMT_NBTHREADS_MAX)) return NULL;
+ cctx = (ZSTDMT_CCtx*) calloc(1, sizeof(ZSTDMT_CCtx) + nbJobs*sizeof(ZSTDMT_jobDescription));
+ if (!cctx) return NULL;
+ cctx->nbThreads = nbThreads;
+ cctx->jobIDMask = nbJobs - 1;
+ cctx->allJobsCompleted = 1;
+ cctx->sectionSize = 0;
+ cctx->overlapRLog = 3;
+ cctx->factory = POOL_create(nbThreads, 1);
+ cctx->buffPool = ZSTDMT_createBufferPool(nbThreads);
+ cctx->cctxPool = ZSTDMT_createCCtxPool(nbThreads);
+ if (!cctx->factory | !cctx->buffPool | !cctx->cctxPool) { /* one object was not created */
+ ZSTDMT_freeCCtx(cctx);
+ return NULL;
+ }
+ if (nbThreads==1) {
+ cctx->cstream = ZSTD_createCStream();
+ if (!cctx->cstream) {
+ ZSTDMT_freeCCtx(cctx); return NULL;
+ } }
+ pthread_mutex_init(&cctx->jobCompleted_mutex, NULL); /* Todo : check init function return */
+ pthread_cond_init(&cctx->jobCompleted_cond, NULL);
+ DEBUGLOG(4, "mt_cctx created, for %u threads \n", nbThreads);
+ return cctx;
+}
+
+/* ZSTDMT_releaseAllJobResources() :
+ * Ensure all workers are killed first. */
+static void ZSTDMT_releaseAllJobResources(ZSTDMT_CCtx* mtctx)
+{
+ unsigned jobID;
+ 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 */
+ ZSTDMT_freeCCtxPool(mtctx->cctxPool);
+ ZSTD_freeCDict(mtctx->cdict);
+ ZSTD_freeCStream(mtctx->cstream);
+ pthread_mutex_destroy(&mtctx->jobCompleted_mutex);
+ pthread_cond_destroy(&mtctx->jobCompleted_cond);
+ free(mtctx);
+ return 0;
+}
+
+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(4, "ZSTDMT_p_overlapSectionLog : %u", value);
+ mtctx->overlapRLog = (value >= 9) ? 0 : 9 - value;
+ return 0;
+ default :
+ return ERROR(compressionParameter_unsupported);
+ }
+}
+
+
+/* ------------------------------------------ */
+/* ===== Multi-threaded compression ===== */
+/* ------------------------------------------ */
+
+size_t ZSTDMT_compressCCtx(ZSTDMT_CCtx* mtctx,
+ void* dst, size_t dstCapacity,
+ const void* src, size_t srcSize,
+ int compressionLevel)
+{
+ ZSTD_parameters params = ZSTD_getParams(compressionLevel, srcSize, 0);
+ U32 const overlapLog = (compressionLevel >= ZSTD_maxCLevel()) ? 0 : 3;
+ size_t const overlapSize = (size_t)1 << (params.cParams.windowLog - overlapLog);
+ size_t const chunkTargetSize = (size_t)1 << (params.cParams.windowLog + 2);
+ unsigned const nbChunksMax = (unsigned)(srcSize / chunkTargetSize) + 1;
+ unsigned nbChunks = MIN(nbChunksMax, mtctx->nbThreads);
+ size_t const proposedChunkSize = (srcSize + (nbChunks-1)) / nbChunks;
+ size_t const avgChunkSize = ((proposedChunkSize & 0x1FFFF) < 0xFFFF) ? proposedChunkSize + 0xFFFF : proposedChunkSize; /* avoid too small last block */
+ size_t remainingSrcSize = srcSize;
+ const char* const srcStart = (const char*)src;
+ 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(3, "windowLog : %2u => chunkTargetSize : %u bytes ", params.cParams.windowLog, (U32)chunkTargetSize);
+ DEBUGLOG(2, "nbChunks : %2u (chunkSize : %u bytes) ", nbChunks, (U32)avgChunkSize);
+ params.fParams.contentSizeFlag = 1;
+
+ if (nbChunks==1) { /* fallback to single-thread mode */
+ ZSTD_CCtx* const cctx = mtctx->cctxPool->cctx[0];
+ return ZSTD_compressCCtx(cctx, dst, dstCapacity, src, srcSize, compressionLevel);
+ }
+
+ { 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;
+ 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].fullFrameSize = srcSize;
+ mtctx->jobs[u].params = params;
+ 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(3, "posting job %u (%u bytes)", u, (U32)chunkSize);
+ DEBUG_PRINTHEX(3, mtctx->jobs[u].srcStart, 12);
+ POOL_add(mtctx->factory, ZSTDMT_compressChunk, &mtctx->jobs[u]);
+
+ frameStartPos += chunkSize;
+ dstBufferPos += dstBufferCapacity;
+ remainingSrcSize -= chunkSize;
+ } }
+ /* note : since nbChunks <= nbThreads, all jobs should be running immediately in parallel */
+
+ { unsigned chunkID;
+ size_t error = 0, dstPos = 0;
+ for (chunkID=0; chunkID<nbChunks; chunkID++) {
+ DEBUGLOG(3, "waiting for chunk %u ", chunkID);
+ PTHREAD_MUTEX_LOCK(&mtctx->jobCompleted_mutex);
+ while (mtctx->jobs[chunkID].jobCompleted==0) {
+ DEBUGLOG(4, "waiting for jobCompleted signal from chunk %u", chunkID);
+ pthread_cond_wait(&mtctx->jobCompleted_cond, &mtctx->jobCompleted_mutex);
+ }
+ pthread_mutex_unlock(&mtctx->jobCompleted_mutex);
+ DEBUGLOG(3, "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 already written directly into dst */
+ if (!error)
+ memmove((char*)dst + dstPos, mtctx->jobs[chunkID].dstBuff.start, cSize); /* may overlap if chunk decompressed within dst */
+ if (chunkID >= compressWithinDst) /* otherwise, it decompresses within dst */
+ ZSTDMT_releaseBuffer(mtctx->buffPool, mtctx->jobs[chunkID].dstBuff);
+ mtctx->jobs[chunkID].dstBuff = g_nullBuffer;
+ }
+ dstPos += cSize ;
+ }
+ }
+ if (!error) DEBUGLOG(3, "compressed size : %u ", (U32)dstPos);
+ return error ? error : dstPos;
+ }
+
+}
+
+
+/* ====================================== */
+/* ======= Streaming API ======= */
+/* ====================================== */
+
+static void ZSTDMT_waitForAllJobsCompleted(ZSTDMT_CCtx* zcs) {
+ 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(4, "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++;
+ }
+}
+
+
+static size_t ZSTDMT_initCStream_internal(ZSTDMT_CCtx* zcs,
+ const void* dict, size_t dictSize, unsigned updateDict,
+ ZSTD_parameters params, unsigned long long pledgedSrcSize)
+{
+ ZSTD_customMem const cmem = { NULL, NULL, NULL };
+ DEBUGLOG(3, "Started new compression, with windowLog : %u", params.cParams.windowLog);
+ if (zcs->nbThreads==1) return ZSTD_initCStream_advanced(zcs->cstream, dict, dictSize, params, pledgedSrcSize);
+ if (zcs->allJobsCompleted == 0) { /* previous job not correctly finished */
+ ZSTDMT_waitForAllJobsCompleted(zcs);
+ ZSTDMT_releaseAllJobResources(zcs);
+ zcs->allJobsCompleted = 1;
+ }
+ zcs->params = params;
+ if (updateDict) {
+ ZSTD_freeCDict(zcs->cdict); zcs->cdict = NULL;
+ if (dict && dictSize) {
+ zcs->cdict = ZSTD_createCDict_advanced(dict, dictSize, 0, params.cParams, cmem);
+ if (zcs->cdict == NULL) return ERROR(memory_allocation);
+ } }
+ zcs->frameContentSize = pledgedSrcSize;
+ zcs->targetDictSize = (zcs->overlapRLog>=9) ? 0 : (size_t)1 << (zcs->params.cParams.windowLog - zcs->overlapRLog);
+ DEBUGLOG(4, "overlapRLog : %u ", zcs->overlapRLog);
+ DEBUGLOG(3, "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(3, "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* zcs,
+ const void* dict, size_t dictSize,
+ ZSTD_parameters params, unsigned long long pledgedSrcSize)
+{
+ return ZSTDMT_initCStream_internal(zcs, dict, dictSize, 1, 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->cstream, 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, 1, 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; /* note : zcs->inBuff.filled is presumed >= srcSize + dictSize */
+ zcs->jobs[jobID].params = zcs->params;
+ if (zcs->nextJobID) zcs->jobs[jobID].params.fParams.checksumFlag = 0; /* do not calculate checksum within sections, just keep it in header for first section */
+ 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);
+ 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 filled to %u", (U32)zcs->inBuff.filled);
+ zcs->inBuff.filled -= srcSize + zcs->dictSize - newDictSize;
+ DEBUGLOG(5, "new job : 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 {
+ zcs->inBuff.buffer = g_nullBuffer;
+ zcs->inBuff.filled = 0;
+ zcs->dictSize = 0;
+ zcs->frameEnded = 1;
+ if (zcs->nextJobID == 0)
+ zcs->params.fParams.checksumFlag = 0; /* single chunk : checksum is calculated directly within worker thread */
+ }
+
+ DEBUGLOG(3, "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(4, "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(4, "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 */
+} }
+
+
+size_t ZSTDMT_compressStream(ZSTDMT_CCtx* zcs, ZSTD_outBuffer* output, ZSTD_inBuffer* input)
+{
+ size_t const newJobThreshold = zcs->dictSize + zcs->targetSectionSize + zcs->marginSize;
+ if (zcs->frameEnded) return ERROR(stage_wrong); /* current frame being ended. Only flush is allowed. Restart with init */
+ if (zcs->nbThreads==1) return ZSTD_compressStream(zcs->cstream, output, input);
+
+ /* fill input buffer */
+ { size_t const toLoad = MIN(input->size - input->pos, zcs->inBuffSize - zcs->inBuff.filled);
+ memcpy((char*)zcs->inBuff.buffer.start + zcs->inBuff.filled, input->src, toLoad);
+ input->pos += toLoad;
+ zcs->inBuff.filled += toLoad;
+ }
+
+ if ( (zcs->inBuff.filled >= newJobThreshold) /* filled enough : let's compress */
+ && (zcs->nextJobID <= zcs->doneJobID + zcs->jobIDMask) ) { /* avoid overwriting job round buffer */
+ CHECK_F( ZSTDMT_createCompressionJob(zcs, zcs->targetSectionSize, 0) );
+ }
+
+ /* check for data to flush */
+ CHECK_F( ZSTDMT_flushNextJob(zcs, output, (zcs->inBuff.filled == zcs->inBuffSize)) ); /* block if it wasn't possible to create new job due to saturation */
+
+ /* 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) DEBUGLOG(4, "flushing : %u bytes left to compress", (U32)srcSize);
+ 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 */
+ DEBUGLOG(5, "zcs->doneJobID : %u ; zcs->nextJobID : %u ", zcs->doneJobID, zcs->nextJobID);
+ return ZSTDMT_flushNextJob(zcs, output, 1);
+}
+
+
+size_t ZSTDMT_flushStream(ZSTDMT_CCtx* zcs, ZSTD_outBuffer* output)
+{
+ if (zcs->nbThreads==1) return ZSTD_flushStream(zcs->cstream, output);
+ return ZSTDMT_flushStream_internal(zcs, output, 0);
+}
+
+size_t ZSTDMT_endStream(ZSTDMT_CCtx* zcs, ZSTD_outBuffer* output)
+{
+ if (zcs->nbThreads==1) return ZSTD_endStream(zcs->cstream, output);
+ return ZSTDMT_flushStream_internal(zcs, output, 1);
+}
diff --git a/thirdparty/zstd/compress/zstdmt_compress.h b/thirdparty/zstd/compress/zstdmt_compress.h
new file mode 100644
index 0000000000..27f78ee031
--- /dev/null
+++ b/thirdparty/zstd/compress/zstdmt_compress.h
@@ -0,0 +1,78 @@
+/**
+ * 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 shall be considered experimental.
+ * There is no guarantee of API continuity (yet) on any of these prototypes */
+
+/* === Dependencies === */
+#include <stddef.h> /* size_t */
+#define ZSTD_STATIC_LINKING_ONLY /* ZSTD_parameters */
+#include "zstd.h" /* ZSTD_inBuffer, ZSTD_outBuffer, ZSTDLIB_API */
+
+
+/* === Simple one-pass functions === */
+
+typedef struct ZSTDMT_CCtx_s ZSTDMT_CCtx;
+ZSTDLIB_API ZSTDMT_CCtx* ZSTDMT_createCCtx(unsigned nbThreads);
+ZSTDLIB_API size_t ZSTDMT_freeCCtx(ZSTDMT_CCtx* cctx);
+
+ZSTDLIB_API size_t ZSTDMT_compressCCtx(ZSTDMT_CCtx* cctx,
+ 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_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 */
+
+/* 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);
+
+
+#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..ea35c36201
--- /dev/null
+++ b/thirdparty/zstd/decompress/huf_decompress.c
@@ -0,0 +1,888 @@
+/* ******************************************************************
+ 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 */
+
+
+/*-***************************/
+/* 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 (HUF_DTable* DTable, const void* src, size_t srcSize)
+{
+ BYTE huffWeight[HUF_SYMBOLVALUE_MAX + 1];
+ U32 rankVal[HUF_TABLELOG_ABSOLUTEMAX + 1]; /* large enough for values from 0 to 16 */
+ U32 tableLog = 0;
+ U32 nbSymbols = 0;
+ size_t iSize;
+ void* const dtPtr = DTable + 1;
+ HUF_DEltX2* const dt = (HUF_DEltX2*)dtPtr;
+
+ 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;
+}
+
+
+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 (HUF_DTable* DCtx, void* dst, size_t dstSize, const void* cSrc, size_t cSrcSize)
+{
+ const BYTE* ip = (const BYTE*) cSrc;
+
+ size_t const hSize = HUF_readDTableX2 (DCtx, cSrc, cSrcSize);
+ 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 (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 (HUF_DTable* dctx, void* dst, size_t dstSize, const void* cSrc, size_t cSrcSize)
+{
+ const BYTE* ip = (const BYTE*) cSrc;
+
+ size_t const hSize = HUF_readDTableX2 (dctx, cSrc, cSrcSize);
+ 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 (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 rankVal_t[HUF_TABLELOG_MAX][HUF_TABLELOG_MAX + 1];
+
+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 (HUF_DTable* DTable, const void* src, size_t srcSize)
+{
+ BYTE weightList[HUF_SYMBOLVALUE_MAX + 1];
+ sortedSymbol_t sortedSymbol[HUF_SYMBOLVALUE_MAX + 1];
+ U32 rankStats[HUF_TABLELOG_MAX + 1] = { 0 };
+ U32 rankStart0[HUF_TABLELOG_MAX + 2] = { 0 };
+ U32* const rankStart = rankStart0+1;
+ rankVal_t rankVal;
+ 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;
+
+ 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;
+}
+
+
+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))
+ 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 */
+ } }
+ 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 (HUF_DTable* DCtx, void* dst, size_t dstSize, const void* cSrc, size_t cSrcSize)
+{
+ const BYTE* ip = (const BYTE*) cSrc;
+
+ size_t const hSize = HUF_readDTableX4 (DCtx, cSrc, cSrcSize);
+ 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 (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 (HUF_DTable* dctx, void* dst, size_t dstSize, const void* cSrc, size_t cSrcSize)
+{
+ const BYTE* ip = (const BYTE*) cSrc;
+
+ size_t hSize = HUF_readDTableX4 (dctx, cSrc, cSrcSize);
+ 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 (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)
+{
+ /* 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(dctx, dst, dstSize, cSrc, cSrcSize) :
+ HUF_decompress4X2_DCtx(dctx, dst, dstSize, cSrc, cSrcSize) ;
+ }
+}
+
+size_t HUF_decompress1X_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_decompress1X4_DCtx(dctx, dst, dstSize, cSrc, cSrcSize) :
+ HUF_decompress1X2_DCtx(dctx, dst, dstSize, cSrc, cSrcSize) ;
+ }
+}
diff --git a/thirdparty/zstd/decompress/zstd_decompress.c b/thirdparty/zstd/decompress/zstd_decompress.c
new file mode 100644
index 0000000000..910f9ab783
--- /dev/null
+++ b/thirdparty/zstd/decompress/zstd_decompress.c
@@ -0,0 +1,2376 @@
+/**
+ * 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)
+# 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
+
+/*-*************************************
+* Macros
+***************************************/
+#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 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 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_frameParams 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;
+ BYTE litBuffer[ZSTD_BLOCKSIZE_ABSOLUTEMAX + WILDCOPY_OVERLENGTH];
+ BYTE headerBuffer[ZSTD_FRAMEHEADERSIZE_MAX];
+}; /* typedef'd to ZSTD_DCtx within "zstd.h" */
+
+size_t ZSTD_sizeof_DCtx (const ZSTD_DCtx* dctx) { return (dctx==NULL) ? 0 : sizeof(ZSTD_DCtx); }
+
+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;
+}
+
+ZSTD_DCtx* ZSTD_createDCtx_advanced(ZSTD_customMem customMem)
+{
+ ZSTD_DCtx* dctx;
+
+ if (!customMem.customAlloc && !customMem.customFree) customMem = defaultCustomMem;
+ if (!customMem.customAlloc || !customMem.customFree) return NULL;
+
+ dctx = (ZSTD_DCtx*)ZSTD_malloc(sizeof(ZSTD_DCtx), customMem);
+ if (!dctx) return NULL;
+ memcpy(&dctx->customMem, &customMem, sizeof(customMem));
+ ZSTD_decompressBegin(dctx);
+ return dctx;
+}
+
+ZSTD_DCtx* ZSTD_createDCtx(void)
+{
+ return ZSTD_createDCtx_advanced(defaultCustomMem);
+}
+
+size_t ZSTD_freeDCtx(ZSTD_DCtx* dctx)
+{
+ if (dctx==NULL) return 0; /* support free on NULL */
+ ZSTD_free(dctx, dctx->customMem);
+ return 0; /* reserved as a potential error code in the future */
+}
+
+void ZSTD_copyDCtx(ZSTD_DCtx* dstDCtx, const ZSTD_DCtx* srcDCtx)
+{
+ size_t const workSpaceSize = (ZSTD_BLOCKSIZE_ABSOLUTEMAX+WILDCOPY_OVERLENGTH) + ZSTD_frameHeaderSize_max;
+ memcpy(dstDCtx, srcDCtx, sizeof(ZSTD_DCtx) - workSpaceSize); /* no need to copy workspace */
+}
+
+static void ZSTD_refDDict(ZSTD_DCtx* dstDCtx, const ZSTD_DDict* ddict);
+
+
+/*-*************************************************************
+* 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 */
+static 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_getFrameParams() :
+* decode Frame Header, or require larger `srcSize`.
+* @return : 0, `fparamsPtr` 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_getFrameParams(ZSTD_frameParams* fparamsPtr, 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) {
+ if (srcSize < ZSTD_skippableHeaderSize) return ZSTD_skippableHeaderSize; /* magic number + skippable frame length */
+ memset(fparamsPtr, 0, sizeof(*fparamsPtr));
+ fparamsPtr->frameContentSize = MEM_readLE32((const char *)src + 4);
+ fparamsPtr->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, which 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); /* avoids issue with 1 << windowLog */
+ 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);
+ fparamsPtr->frameContentSize = frameContentSize;
+ fparamsPtr->windowSize = windowSize;
+ fparamsPtr->dictID = dictID;
+ fparamsPtr->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_frameParams fParams;
+ if (ZSTD_getFrameParams(&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_getFrameParams(&(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;
+}
+
+
+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)
+{
+ 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_ABSOLUTEMAX) 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(dctx->entropy.hufTable, dctx->litBuffer, litSize, istart+lhSize, litCSize) :
+ HUF_decompress4X_hufOnly (dctx->entropy.hufTable, dctx->litBuffer, litSize, istart+lhSize, litCSize)) ))
+ 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_ABSOLUTEMAX) 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;
+
+ /* 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);
+
+ /* 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;
+
+ /* 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) {
+ 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);
+ if (ZSTD_isError(oneSeqSize)) return oneSeqSize;
+ op += oneSeqSize;
+ } }
+
+ /* check if reached exact end */
+ 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 windowSize = 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, windowSize);
+ }
+ 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, windowSize);
+ 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;
+
+ if (srcSize >= ZSTD_BLOCKSIZE_ABSOLUTEMAX) return ERROR(srcSize_wrong);
+
+ /* Decode literals section */
+ { size_t const litCSize = ZSTD_decodeLiteralsBlock(dctx, src, srcSize);
+ 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_frameParams fParams;
+
+ size_t const headerSize = ZSTD_frameHeaderSize(ip, remainingSize);
+ if (ZSTD_isError(headerSize)) return headerSize;
+
+ /* Frame Header */
+ { size_t const ret = ZSTD_getFrameParams(&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;
+
+ 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 */
+ ZSTD_refDDict(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 */
+ 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;
+ }
+}
+
+int ZSTD_isSkipFrame(ZSTD_DCtx* dctx) { return dctx->stage == ZSTDds_skipFrame; } /* for zbuff */
+
+/** ZSTD_decompressContinue() :
+* @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)
+{
+ /* Sanity check */
+ if (srcSize != dctx->expected) return ERROR(srcSize_wrong);
+ if (dstCapacity) ZSTD_checkContinuity(dctx, dst);
+
+ switch (dctx->stage)
+ {
+ case ZSTDds_getFrameHeaderSize :
+ if (srcSize != ZSTD_frameHeaderSize_prefix) return ERROR(srcSize_wrong); /* impossible */
+ 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:
+ 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 = 3; /* go directly to next header */
+ dctx->stage = ZSTDds_decodeBlockHeader;
+ }
+ return 0;
+ }
+ case ZSTDds_decompressLastBlock:
+ case ZSTDds_decompressBlock:
+ { size_t rSize;
+ switch(dctx->bType)
+ {
+ 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:
+ { 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(entropy->hufTable, dictPtr, dictEnd-dictPtr);
+ 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_DICT_MAGIC) {
+ 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;
+}
+
+static void ZSTD_refDDict(ZSTD_DCtx* dstDCtx, const ZSTD_DDict* ddict)
+{
+ ZSTD_decompressBegin(dstDCtx); /* init */
+ if (ddict) { /* support refDDict 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;
+ }
+ }
+}
+
+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_DICT_MAGIC) 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;
+}
+
+
+ZSTD_DDict* ZSTD_createDDict_advanced(const void* dict, size_t dictSize, unsigned byReference, ZSTD_customMem customMem)
+{
+ if (!customMem.customAlloc && !customMem.customFree) customMem = defaultCustomMem;
+ 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 ((byReference) || (!dict) || (!dictSize)) {
+ ddict->dictBuffer = NULL;
+ ddict->dictContent = dict;
+ } else {
+ void* const internalBuffer = ZSTD_malloc(dictSize, customMem);
+ if (!internalBuffer) { ZSTD_freeDDict(ddict); return NULL; }
+ memcpy(internalBuffer, dict, dictSize);
+ ddict->dictBuffer = internalBuffer;
+ ddict->dictContent = internalBuffer;
+ }
+ ddict->dictSize = dictSize;
+ ddict->entropy.hufTable[0] = (HUF_DTable)((HufLog)*0x1000001); /* cover both little and big endian */
+ /* parse dictionary content */
+ { size_t const errorCode = ZSTD_loadEntropy_inDDict(ddict);
+ if (ZSTD_isError(errorCode)) {
+ 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);
+}
+
+
+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;
+ }
+}
+
+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_DICT_MAGIC) 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_getFrameParams(), which will provide a more precise error code. */
+unsigned ZSTD_getDictID_fromFrame(const void* src, size_t srcSize)
+{
+ ZSTD_frameParams zfp = { 0 , 0 , 0 , 0 };
+ size_t const hError = ZSTD_getFrameParams(&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
+*====================================*/
+
+typedef enum { zdss_init, zdss_loadHeader,
+ zdss_read, zdss_load, zdss_flush } ZSTD_dStreamStage;
+
+/* *** Resource management *** */
+struct ZSTD_DStream_s {
+ ZSTD_DCtx* dctx;
+ ZSTD_DDict* ddictLocal;
+ const ZSTD_DDict* ddict;
+ ZSTD_frameParams fParams;
+ ZSTD_dStreamStage stage;
+ 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;
+ BYTE headerBuffer[ZSTD_FRAMEHEADERSIZE_MAX]; /* tmp buffer to store frame header */
+ size_t lhSize;
+ ZSTD_customMem customMem;
+ void* legacyContext;
+ U32 previousLegacyVersion;
+ U32 legacyVersion;
+ U32 hostageByte;
+}; /* typedef'd to ZSTD_DStream within "zstd.h" */
+
+
+ZSTD_DStream* ZSTD_createDStream(void)
+{
+ return ZSTD_createDStream_advanced(defaultCustomMem);
+}
+
+ZSTD_DStream* ZSTD_createDStream_advanced(ZSTD_customMem customMem)
+{
+ ZSTD_DStream* zds;
+
+ if (!customMem.customAlloc && !customMem.customFree) customMem = defaultCustomMem;
+ if (!customMem.customAlloc || !customMem.customFree) return NULL;
+
+ zds = (ZSTD_DStream*) ZSTD_malloc(sizeof(ZSTD_DStream), customMem);
+ if (zds==NULL) return NULL;
+ memset(zds, 0, sizeof(ZSTD_DStream));
+ memcpy(&zds->customMem, &customMem, sizeof(ZSTD_customMem));
+ zds->dctx = ZSTD_createDCtx_advanced(customMem);
+ if (zds->dctx == NULL) { ZSTD_freeDStream(zds); return NULL; }
+ zds->stage = zdss_init;
+ zds->maxWindowSize = ZSTD_MAXWINDOWSIZE_DEFAULT;
+ return zds;
+}
+
+size_t ZSTD_freeDStream(ZSTD_DStream* zds)
+{
+ if (zds==NULL) return 0; /* support free on null */
+ { ZSTD_customMem const cMem = zds->customMem;
+ ZSTD_freeDCtx(zds->dctx);
+ zds->dctx = NULL;
+ ZSTD_freeDDict(zds->ddictLocal);
+ zds->ddictLocal = NULL;
+ ZSTD_free(zds->inBuff, cMem);
+ zds->inBuff = NULL;
+ ZSTD_free(zds->outBuff, cMem);
+ zds->outBuff = NULL;
+#if defined(ZSTD_LEGACY_SUPPORT) && (ZSTD_LEGACY_SUPPORT >= 1)
+ if (zds->legacyContext)
+ ZSTD_freeLegacyStreamContext(zds->legacyContext, zds->previousLegacyVersion);
+#endif
+ ZSTD_free(zds, cMem);
+ return 0;
+ }
+}
+
+
+/* *** Initialization *** */
+
+size_t ZSTD_DStreamInSize(void) { return ZSTD_BLOCKSIZE_ABSOLUTEMAX + ZSTD_blockHeaderSize; }
+size_t ZSTD_DStreamOutSize(void) { return ZSTD_BLOCKSIZE_ABSOLUTEMAX; }
+
+size_t ZSTD_initDStream_usingDict(ZSTD_DStream* zds, const void* dict, size_t dictSize)
+{
+ zds->stage = 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->stage = 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)
+{
+ if (zds==NULL) return 0; /* support sizeof NULL */
+ return sizeof(*zds)
+ + ZSTD_sizeof_DCtx(zds->dctx)
+ + ZSTD_sizeof_DDict(zds->ddictLocal)
+ + zds->inBuffSize + zds->outBuffSize;
+}
+
+
+/* ***** 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;
+
+#if defined(ZSTD_LEGACY_SUPPORT) && (ZSTD_LEGACY_SUPPORT>=1)
+ if (zds->legacyVersion)
+ return ZSTD_decompressLegacyStream(zds->legacyContext, zds->legacyVersion, output, input);
+#endif
+
+ while (someMoreWork) {
+ switch(zds->stage)
+ {
+ case zdss_init :
+ ZSTD_resetDStream(zds); /* transparent reset on starting decoding a new frame */
+ /* fall-through */
+
+ case zdss_loadHeader :
+ { size_t const hSize = ZSTD_getFrameParams(&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;
+ 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 */
+ 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 */
+ }
+ 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->dctx, op, oend-op, istart, cSize, zds->ddict);
+ if (ZSTD_isError(decompressedSize)) return decompressedSize;
+ ip = istart + cSize;
+ op += decompressedSize;
+ zds->dctx->expected = 0;
+ zds->stage = zdss_init;
+ someMoreWork = 0;
+ break;
+ } }
+
+ /* Consume header */
+ ZSTD_refDDict(zds->dctx, zds->ddict);
+ { size_t const h1Size = ZSTD_nextSrcSizeToDecompress(zds->dctx); /* == ZSTD_frameHeaderSize_prefix */
+ CHECK_F(ZSTD_decompressContinue(zds->dctx, NULL, 0, zds->headerBuffer, h1Size));
+ { size_t const h2Size = ZSTD_nextSrcSizeToDecompress(zds->dctx);
+ CHECK_F(ZSTD_decompressContinue(zds->dctx, NULL, 0, zds->headerBuffer+h1Size, h2Size));
+ } }
+
+ 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_ABSOLUTEMAX);
+ size_t const neededOutSize = zds->fParams.windowSize + blockSize + WILDCOPY_OVERLENGTH * 2;
+ zds->blockSize = blockSize;
+ if (zds->inBuffSize < blockSize) {
+ ZSTD_free(zds->inBuff, zds->customMem);
+ zds->inBuffSize = 0;
+ zds->inBuff = (char*)ZSTD_malloc(blockSize, zds->customMem);
+ if (zds->inBuff == NULL) return ERROR(memory_allocation);
+ zds->inBuffSize = blockSize;
+ }
+ if (zds->outBuffSize < neededOutSize) {
+ ZSTD_free(zds->outBuff, zds->customMem);
+ zds->outBuffSize = 0;
+ zds->outBuff = (char*)ZSTD_malloc(neededOutSize, zds->customMem);
+ if (zds->outBuff == NULL) return ERROR(memory_allocation);
+ zds->outBuffSize = neededOutSize;
+ } }
+ zds->stage = zdss_read;
+ /* pass-through */
+
+ case zdss_read:
+ { size_t const neededInSize = ZSTD_nextSrcSizeToDecompress(zds->dctx);
+ if (neededInSize==0) { /* end of frame */
+ zds->stage = zdss_init;
+ someMoreWork = 0;
+ break;
+ }
+ if ((size_t)(iend-ip) >= neededInSize) { /* decode directly from src */
+ const int isSkipFrame = ZSTD_isSkipFrame(zds->dctx);
+ size_t const decodedSize = ZSTD_decompressContinue(zds->dctx,
+ 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->stage = zdss_flush;
+ break;
+ }
+ if (ip==iend) { someMoreWork = 0; break; } /* no more input */
+ zds->stage = zdss_load;
+ /* pass-through */
+ }
+
+ case zdss_load:
+ { size_t const neededInSize = ZSTD_nextSrcSizeToDecompress(zds->dctx);
+ 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->dctx);
+ size_t const decodedSize = ZSTD_decompressContinue(zds->dctx,
+ 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->stage = zdss_read; break; } /* this was just a header */
+ zds->outEnd = zds->outStart + decodedSize;
+ zds->stage = 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->stage = 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->dctx);
+ if (!nextSrcSizeHint) { /* frame fully decoded */
+ if (zds->outEnd == zds->outStart) { /* output fully flushed */
+ if (zds->hostageByte) {
+ if (input->pos >= input->size) { zds->stage = zdss_read; return 1; } /* can't release hostage (not present) */
+ input->pos++; /* release hostage */
+ }
+ return 0;
+ }
+ 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 += ZSTD_blockHeaderSize * (ZSTD_nextInputType(zds->dctx) == 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..f8050c1361
--- /dev/null
+++ b/thirdparty/zstd/zstd.h
@@ -0,0 +1,795 @@
+/*
+ * 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 ===== */
+#if defined(__GNUC__) && (__GNUC__ >= 4)
+# define ZSTDLIB_VISIBILITY __attribute__ ((visibility ("default")))
+#else
+# define ZSTDLIB_VISIBILITY
+#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 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 compression with 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.
+ These 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 2
+#define ZSTD_VERSION_RELEASE 0
+
+#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)
+
+#define ZSTD_VERSION_NUMBER (ZSTD_VERSION_MAJOR *100*100 + ZSTD_VERSION_MINOR *100 + ZSTD_VERSION_RELEASE)
+ZSTDLIB_API unsigned ZSTD_versionNumber(void); /**< library version number; to be used when checking dll version */
+
+
+/***************************************
+* 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.
+ * 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_getDecompressedSize() :
+ * NOTE: This function is planned to be obsolete, in favour of ZSTD_getFrameContentSize.
+ * ZSTD_getFrameContentSize functions the same way, returning the decompressed size of a single
+ * frame, but distinguishes empty frames from frames with an unknown size, or errors.
+ *
+ * Additionally, ZSTD_findDecompressedSize can be used instead. It can handle multiple
+ * concatenated frames in one buffer, and so is more general.
+ * As a result however, it requires more computation and entire frames to be passed to it,
+ * as opposed to ZSTD_getFrameContentSize which requires only a single frame's header.
+ *
+ * 'src' is the start of a zstd compressed frame.
+ * @return : content size to be decompressed, as a 64-bits value _if known_, 0 otherwise.
+ * note 1 : decompressed size is an optional field, that may not be present, especially in streaming mode.
+ * When `return==0`, data to decompress could be any size.
+ * In which case, it's necessary to use streaming mode to decompress data.
+ * Optionally, application can still use ZSTD_decompress() while relying on implied limits.
+ * (For example, data may be necessarily cut into blocks <= 16 KB).
+ * 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 : when `return==0`, if precise failure cause is needed, use ZSTD_getFrameParams() to know more. */
+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 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_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);
+
+
+/****************************
+* Fast 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 used by multiple threads concurrently, as its usage is read-only.
+* `dictBuffer` can be released after ZSTD_CDict creation, as 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.
+* Similar to ZSTD_flushStream(), it may not be able to flush the full content if `output->size` is too small.
+* In which case, call again ZSTD_endStream() to complete the flush.
+* @return : nb of bytes still present within internal buffer (0 if it's empty, hence compression completed)
+* or an error code, which can be tested using ZSTD_isError().
+*
+* *******************************************************************/
+
+typedef struct ZSTD_CStream_s ZSTD_CStream;
+/*===== 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 struct ZSTD_DStream_s ZSTD_DStream;
+/*===== 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 */
+
+
+#if defined(ZSTD_STATIC_LINKING_ONLY) && !defined(ZSTD_H_ZSTD_STATIC_LINKING_ONLY)
+#define ZSTD_H_ZSTD_STATIC_LINKING_ONLY
+
+/****************************************************************************************
+ * START OF ADVANCED AND EXPERIMENTAL FUNCTIONS
+ * The definitions in this section are considered experimental.
+ * They should never be used with a dynamic library, as they may change in the future.
+ * They are provided for advanced usages.
+ * Use them only in association with static linking.
+ * ***************************************************************************************/
+
+/* --- Constants ---*/
+#define ZSTD_MAGICNUMBER 0xFD2FB528 /* >= v0.8.0 */
+#define ZSTD_MAGIC_SKIPPABLE_START 0x184D2A50U
+
+#define ZSTD_CONTENTSIZE_UNKNOWN (0ULL - 1)
+#define ZSTD_CONTENTSIZE_ERROR (0ULL - 2)
+
+#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;
+static const size_t ZSTD_frameHeaderSize_min = ZSTD_FRAMEHEADERSIZE_MIN;
+static const size_t ZSTD_frameHeaderSize_max = ZSTD_FRAMEHEADERSIZE_MAX;
+static const size_t ZSTD_skippableHeaderSize = 8; /* magic number + skippable frame length */
+
+
+/*--- Advanced types ---*/
+typedef enum { ZSTD_fast, ZSTD_dfast, ZSTD_greedy, ZSTD_lazy, ZSTD_lazy2, ZSTD_btlazy2, ZSTD_btopt, ZSTD_btopt2 } 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;
+
+/*= 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;
+
+/***************************************
+* Compressed 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 frame pointed to by `src`, suitable to pass to
+ * `ZSTD_decompress` or similar, or an error code if given invalid input. */
+ZSTDLIB_API size_t ZSTD_findFrameCompressedSize(const void* src, size_t srcSize);
+
+/***************************************
+* Decompressed size functions
+***************************************/
+/*! ZSTD_getFrameContentSize() :
+* `src` should point to the start of a ZSTD encoded frame
+* `srcSize` must be at least as large as the frame header. A value greater than or equal
+* to `ZSTD_frameHeaderSize_max` is guaranteed to be large enough in all cases.
+* @return : decompressed size of the 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) */
+ZSTDLIB_API unsigned long long ZSTD_getFrameContentSize(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 `srcSize` bytes after `src`)
+* @return : the decompressed size of all data in the contained frames, as a 64-bit value _if known_
+* - 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.
+* Optionally, application can still use ZSTD_decompress() while relying on implied limits.
+* (For example, data may be necessarily cut into blocks <= 16 KB).
+* 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 efficient 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);
+
+
+/***************************************
+* Advanced compression functions
+***************************************/
+/*! ZSTD_estimateCCtxSize() :
+ * Gives the amount of memory allocated for a ZSTD_CCtx given a set of compression parameters.
+ * `frameContentSize` is an optional parameter, provide `0` if unknown */
+ZSTDLIB_API size_t ZSTD_estimateCCtxSize(ZSTD_compressionParameters cParams);
+
+/*! 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_sizeofCCtx() :
+ * Gives the amount of memory used by a given ZSTD_CCtx */
+ZSTDLIB_API size_t ZSTD_sizeof_CCtx(const ZSTD_CCtx* cctx);
+
+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);
+
+/*! 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_compressionParameters cParams, ZSTD_customMem customMem);
+
+/*! ZSTD_sizeof_CDict() :
+ * Gives the amount of memory used by a given ZSTD_sizeof_CDict */
+ZSTDLIB_API size_t ZSTD_sizeof_CDict(const ZSTD_CDict* cdict);
+
+/*! 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_estimateDCtxSize() :
+ * Gives the potential amount of memory allocated to create a ZSTD_DCtx */
+ZSTDLIB_API size_t ZSTD_estimateDCtxSize(void);
+
+/*! 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_sizeof_DCtx() :
+ * Gives the amount of memory used by a given ZSTD_DCtx */
+ZSTDLIB_API size_t ZSTD_sizeof_DCtx(const ZSTD_DCtx* dctx);
+
+/*! ZSTD_createDDict_byReference() :
+ * Create a digested dictionary, ready to start decompression operation without startup delay.
+ * Dictionary content is simply 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_sizeof_DDict() :
+ * Gives the amount of memory used by a given ZSTD_DDict */
+ZSTDLIB_API size_t ZSTD_sizeof_DDict(const ZSTD_DDict* ddict);
+
+/*! 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_getFrameParams(), 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 size_t ZSTD_sizeof_CStream(const ZSTD_CStream* zcs); /**< size of CStream is variable, depending primarily on compression level */
+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); /**< note: a dict will not be used if dict == NULL or dictSize < 8 */
+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, unsigned long long pledgedSrcSize, ZSTD_frameParameters fParams); /**< 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 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_setDStreamParameter(ZSTD_DStream* zds, ZSTD_DStreamParameter_e paramType, unsigned paramValue);
+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 */
+ZSTDLIB_API size_t ZSTD_sizeof_DStream(const ZSTD_DStream* zds);
+
+
+/*********************************************************************
+* 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_getFrameParams().
+ It fills a ZSTD_frameParams structure which provide important information to correctly decode the frame,
+ such as the minimum rolling buffer size to allocate to decompress data (`windowSize`),
+ and the dictionary ID used.
+ (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 at least 8 MB.
+ Frame parameters are extracted from the beginning of the compressed frame.
+ Data fragment must be large enough to ensure successful decoding, typically `ZSTD_frameHeaderSize_max` bytes.
+ @result : 0 : successful decoding, the `ZSTD_frameParams` 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() or ZSTD_decompressBegin_usingDict().
+ 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_getFrameParams() 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.
+*/
+
+typedef struct {
+ unsigned long long frameContentSize;
+ unsigned windowSize;
+ unsigned dictID;
+ unsigned checksumFlag;
+} ZSTD_frameParams;
+
+/*===== Buffer-less streaming decompression functions =====*/
+ZSTDLIB_API size_t ZSTD_getFrameParams(ZSTD_frameParams* fparamsPtr, const void* src, size_t srcSize); /**< doesn't consume input, see details below */
+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 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);
+
+/**
+ 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_getBlockSizeMax() <= ZSTD_BLOCKSIZE_ABSOLUTEMAX
+ + 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_BLOCKSIZE_ABSOLUTEMAX (128 * 1024) /* define, for static allocation */
+/*===== Raw zstd block functions =====*/
+ZSTDLIB_API size_t ZSTD_getBlockSizeMax(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