summaryrefslogtreecommitdiff
path: root/scene/2d
AgeCommit message (Collapse)Author
2018-10-19Fixing warnings generated by MSVCDualtagh Murray
Fixes #22684.
2018-10-11Fixes Area and Area2D audio bus overrideMrCdK
2018-10-08Ensure CPU particles do not process if not visibleJuan Linietsky
2018-10-07Merge pull request #22712 from groud/fix_animation_finished_signalRémi Verschelde
Fixes AnimatedSprite2D animation_finished signal triggering too early
2018-10-04Fix GCC 8 warnings about potentially unitialized variablesRémi Verschelde
Fixes the following GCC 8 warnings: ``` core/image.cpp:730:44: warning: 'mip1_weight' may be used uninitialized in this function [-Wmaybe-uninitialized] core/image.cpp:293:20: warning: 'mip2' may be used uninitialized in this function [-Wmaybe-uninitialized] core/image.cpp:293:20: warning: 'mip1' may be used uninitialized in this function [-Wmaybe-uninitialized] editor/audio_stream_preview.cpp:58:19: warning: 'vmax' may be used uninitialized in this function [-Wmaybe-uninitialized] editor/audio_stream_preview.cpp:85:19: warning: 'vmin' may be used uninitialized in this function [-Wmaybe-uninitialized] editor/editor_themes.cpp:306:53: warning: 'preset_contrast' may be used uninitialized in this function [-Wmaybe-uninitialized] editor/plugins/animation_blend_space_2d_editor.cpp:459:27: warning: 'prev_idx' may be used uninitialized in this function [-Wmaybe-uninitialized] editor/plugins/animation_blend_space_2d_editor.cpp:443:27: warning: 'prev_idx' may be used uninitialized in this function [-Wmaybe-uninitialized] main/tests/test_oa_hash_map.cpp:57:29: warning: 'value' may be used uninitialized in this function [-Wmaybe-uninitialized] modules/csg/csg.cpp:764:40: warning: 'max_angle' may be used uninitialized in this function [-Wmaybe-uninitialized] modules/csg/csg_shape.cpp:1945:3: warning: 'face_count' may be used uninitialized in this function [-Wmaybe-uninitialized] scene/3d/voxel_light_baker.cpp:1593:8: warning: 'cone_aperture' may be used uninitialized in this function [-Wmaybe-uninitialized] scene/3d/voxel_light_baker.cpp:1592:6: warning: 'cone_dir_count' may be used uninitialized in this function [-Wmaybe-uninitialized] scene/animation/animation_blend_space_2d.cpp:471:8: warning: 'mind' may be used uninitialized in this function [-Wmaybe-uninitialized] core/os/memory.cpp:94: warning: ignoring #pragma clang diagnostic [-Wunknown-pragmas] core/os/memory.cpp:95: warning: ignoring #pragma clang diagnostic [-Wunknown-pragmas] core/os/memory.cpp:98: warning: ignoring #pragma clang diagnostic [-Wunknown-pragmas] ```
2018-10-04Fixes AnimatedSprite2D animation_finished signal triggering too earlygroud
2018-10-04fix enum cast warnings on clangkarroffel
2018-10-02Fix warnings on virtual methods [-Woverloaded-virtual] ↵Rémi Verschelde
[-Wdelete-non-virtual-dtor] Fixes the following Clang 7 warnings: ``` editor/editor_help.h:123:7: warning: 'EditorHelpIndex::popup' hides overloaded virtual function [-Woverloaded-virtual] editor/editor_help.h:95:7: warning: 'EditorHelpSearch::popup' hides overloaded virtual function [-Woverloaded-virtual] editor/editor_help.h:96:7: warning: 'EditorHelpSearch::popup' hides overloaded virtual function [-Woverloaded-virtual] editor/plugins/curve_editor_plugin.h:141:15: warning: 'CurvePreviewGenerator::generate' hides overloaded virtual function [-Woverloaded-virtual] editor/plugins/script_editor_plugin.h:70:7: warning: 'ScriptEditorQuickOpen::popup' hides overloaded virtual function [-Woverloaded-virtual] editor/quick_open.h:69:7: warning: 'EditorQuickOpen::popup' hides overloaded virtual function [-Woverloaded-virtual] main/tests/test_io.cpp:53:15: warning: 'TestIO::TestMainLoop::input_event' hides overloaded virtual function [-Woverloaded-virtual] servers/audio/effects/audio_effect_record.h:69:15: warning: 'AudioEffectRecordInstance::process_silence' hides overloaded virtual function [-Woverloaded-virtual] core/os/memory.h:119:2: warning: destructor called on non-final 'ContextGL_X11' that has virtual functions but non-virtual destructor [-Wdelete-non-virtual-dtor] core/os/memory.h:119:2: warning: destructor called on non-final 'EditorScriptCodeCompletionCache' that has virtual functions but non-virtual destructor [-Wdelete-non-virtual-dtor] core/os/memory.h:119:2: warning: destructor called on non-final 'Engine' that has virtual functions but non-virtual destructor [-Wdelete-non-virtual-dtor] core/os/memory.h:119:2: warning: destructor called on non-final 'PhysicalBone::JointData' that has virtual functions but non-virtual destructor [-Wdelete-non-virtual-dtor] core/os/memory.h:119:2: warning: destructor called on non-final 'VisualServerScene' that has virtual functions but non-virtual destructor [-Wdelete-non-virtual-dtor] core/os/memory.h:119:2: warning: destructor called on non-final 'VisualServerViewport' that has virtual functions but non-virtual destructor [-Wdelete-non-virtual-dtor] ```
2018-09-29Fix warning about functions defined but not used [-Wunused-function]Rémi Verschelde
Fixes the following GCC 5 warnings: ``` core/io/zip_io.h:128:26: warning: 'zlib_filefunc_def zipio_create_io_from_file(FileAccess**)' defined but not used [-Wunused-function] core/script_debugger_remote.cpp:110:17: warning: 'ObjectID safe_get_instance_id(const Variant&)' defined but not used [-Wunused-function] drivers/unix/socket_helpers.h:103:12: warning: 'int _socket_create(IP::Type&, int, int)' defined but not used [-Wunused-function] drivers/unix/socket_helpers.h:45:15: warning: 'size_t _set_sockaddr(sockaddr_storage*, const IP_Address&, int, IP::Type)' defined but not used [-Wunused-function] drivers/unix/socket_helpers.h:76:15: warning: 'size_t _set_listen_sockaddr(sockaddr_storage*, int, IP::Type, IP_Address)' defined but not used [-Wunused-function] editor/editor_fonts.cpp:40:24: warning: 'Ref<BitmapFont> make_font(int, int, int, int, const int*, const Ref<Texture>&)' defined but not used [-Wunused-function] editor/editor_themes.cpp:85:26: warning: 'Ref<StyleBoxFlat> change_border_color(Ref<StyleBoxFlat>, Color)' defined but not used [-Wunused-function] editor/import/editor_import_collada.cpp:493:13: warning: 'void _generate_normals(const PoolVector<int>&, const PoolVector<Vector3>&, PoolVector<Vector3>&)' defined but not used [-Wunused-function] editor/import/editor_import_collada.cpp:524:13: warning: 'void _generate_tangents_and_binormals(const PoolVector<int>&, const PoolVector<Vector3>&, const PoolVector<Vector3>&, const PoolVector<Vector3>&, PoolVector<float>&)' defined but not used [-Wunused-function] editor/pvrtc_compress.cpp:118:13: warning: 'void _compress_etc(Image*)' defined but not used [-Wunused-function] modules/etc/image_etc.cpp:89:13: warning: 'void _decompress_etc1(Image*)' defined but not used [-Wunused-function] modules/etc/image_etc.cpp:93:13: warning: 'void _decompress_etc2(Image*)' defined but not used [-Wunused-function] modules/gdscript/editor/gdscript_highlighter.cpp:46:13: warning: 'bool _is_whitespace(CharType)' defined but not used [-Wunused-function] scene/2d/cpu_particles_2d.cpp:510:14: warning: 'float rand_from_seed_m1_p1(uint32_t&)' defined but not used [-Wunused-function] scene/3d/cpu_particles.cpp:474:14: warning: 'float rand_from_seed_m1_p1(uint32_t&)' defined but not used [-Wunused-function] scene/resources/default_theme/default_theme.cpp:123:20: warning: 'Ref<Shader> make_shader(const char*, const char*, const char*)' defined but not used [-Wunused-function] scene/resources/default_theme/default_theme.cpp:130:24: warning: 'Ref<BitmapFont> make_font(int, int, int, int, const int*, const Ref<Texture>&)' defined but not used [-Wunused-function] ``` Had to split `core/io/zip_io.h` into header and .cpp file without 'static' keyword. Not fixed yet (static definition in header used in some files but not all): ``` modules/websocket/lws_helper.h:111:13: warning: 'void _lws_make_protocols(void*, int (*)(lws*, lws_callback_reasons, void*, void*, size_t), PoolVector<String>, _LWSRef**)' defined but not used [-Wunused-function] ``` Also fixed a couple other warnings missed in previous commits.
2018-09-28SCons: Build thirdparty code in own env, disable warningsRémi Verschelde
Also remove unnecessary `Export('env')` in other SCsubs, Export should only be used when exporting *new* objects.
2018-09-27Fix warnings about set but unused variables [-Wunused-but-set-variable]Rémi Verschelde
Fixes the following GCC 5 warnings: ``` drivers/gles2/rasterizer_canvas_gles2.cpp:814:8: warning: variable 'rt_size' set but not used [-Wunused-but-set-variable] drivers/gles2/rasterizer_scene_gles2.cpp:2270:11: warning: variable 'vp_height' set but not used [-Wunused-but-set-variable] drivers/gles2/rasterizer_scene_gles2.cpp:2673:22: warning: variable 'e' set but not used [-Wunused-but-set-variable] drivers/gles2/rasterizer_scene_gles2.cpp:715:7: warning: variable 'no_cull' set but not used [-Wunused-but-set-variable] drivers/gles2/shader_gles2.cpp:693:14: warning: variable 'cc' set but not used [-Wunused-but-set-variable] drivers/gles3/rasterizer_canvas_gles3.cpp:1226:8: warning: variable 'rt_size' set but not used [-Wunused-but-set-variable] drivers/gles3/rasterizer_scene_gles3.cpp:3039:10: warning: variable 'contrib' set but not used [-Wunused-but-set-variable] drivers/gles3/rasterizer_scene_gles3.cpp:4504:32: warning: variable 'vp_height' set but not used [-Wunused-but-set-variable] editor/editor_inspector.cpp:272:9: warning: variable 'guide_color' set but not used [-Wunused-but-set-variable] editor/editor_themes.cpp:1067:14: warning: variable 'alpha3' set but not used [-Wunused-but-set-variable] editor/editor_themes.cpp:263:8: warning: variable 'script_bg_color' set but not used [-Wunused-but-set-variable] editor/plugins/collision_shape_2d_editor_plugin.cpp:326:11: warning: variable 'cpoint' set but not used [-Wunused-but-set-variable] editor/plugins/mesh_editor_plugin.cpp:72:9: warning: variable 'size' set but not used [-Wunused-but-set-variable] editor/plugins/shader_editor_plugin.cpp:471:12: warning: variable 'mpos' set but not used [-Wunused-but-set-variable] editor/plugins/shader_editor_plugin.cpp:89:8: warning: variable 'basetype_color' set but not used [-Wunused-but-set-variable] editor/plugins/shader_editor_plugin.cpp:90:8: warning: variable 'type_color' set but not used [-Wunused-but-set-variable] editor/plugins/shader_editor_plugin.cpp:92:8: warning: variable 'string_color' set but not used [-Wunused-but-set-variable] modules/visual_script/visual_script_editor.cpp:2521:7: warning: variable 'seq_connect' set but not used [-Wunused-but-set-variable] platform/android/export/export.cpp:580:12: warning: variable 'styles_count' set but not used [-Wunused-but-set-variable] platform/android/export/export.cpp:584:12: warning: variable 'styles_offset' set but not used [-Wunused-but-set-variable] platform/osx/export/export.cpp:464:9: warning: variable 'zerr' set but not used [-Wunused-but-set-variable] scene/2d/tile_map.cpp:260:10: warning: variable 'tcenter' set but not used [-Wunused-but-set-variable] scene/3d/light.cpp:166:7: warning: variable 'editor_ok' set but not used [-Wunused-but-set-variable] scene/3d/navigation.cpp:566:11: warning: variable 'closest_navmesh' set but not used [-Wunused-but-set-variable] scene/gui/rich_text_label.cpp:869:8: warning: variable 'size' set but not used [-Wunused-but-set-variable] scene/main/viewport.cpp:705:14: warning: variable 'xform' set but not used [-Wunused-but-set-variable] scene/main/viewport.cpp:706:8: warning: variable 'ss' set but not used [-Wunused-but-set-variable] scene/main/viewport.cpp:726:14: warning: variable 'xform' set but not used [-Wunused-but-set-variable] scene/main/viewport.cpp:727:8: warning: variable 'ss' set but not used [-Wunused-but-set-variable] scene/resources/material.cpp:430:7: warning: variable 'using_world' set but not used [-Wunused-but-set-variable] servers/visual/shader_language.cpp:2026:7: warning: variable 'all_const' set but not used [-Wunused-but-set-variable] servers/visual/visual_server_scene.cpp:1383:28: warning: variable 'z_max_cam' set but not used [-Wunused-but-set-variable] ``` Also fixes two [-Wunused-value] warnings: ``` scene/gui/text_edit.cpp:4405:20: warning: statement has no effect [-Wunused-value] servers/visual/visual_server_scene.cpp:905:48: warning: value computed is not used [-Wunused-value] ``` Some of those are bugs and need further work, they are identified with `// FIXME` comments.
2018-09-20Merge pull request #22047 from DualMatrix/better_nav_2DRémi Verschelde
Better heuristic for the shortest path algorithm for navigation2D
2018-09-20Better heuristic for the shortest path algorithm for navigation2D and ↵DualMatrix
navigation. Better heuristic for the shortest path algorithm for navigation2D and navigation. It now will use the shortest distance to the polygon as cost instead of the distance to the center.
2018-09-13Merge pull request #21982 from luzpaz/misc-typosRémi Verschelde
Misc. typos
2018-09-12Misc. typosluz.paz
Found via `codespell -q 3 -I ../godot-word-whitelist.txt --skip="./thirdparty,*.po"`
2018-09-13Revert "Drop deprecated compatibility methods from AnimatedSprite"Rémi Verschelde
2018-09-12Merge pull request #21780 from akien-mga/animatedsprite-deprecatedRémi Verschelde
Drop deprecated compatibility methods from AnimatedSprite
2018-09-12Make core/ includes absolute, remove subfolders from include pathRémi Verschelde
This allows more consistency in the manner we include core headers, where previously there would be a mix of absolute, relative and include path-dependent includes.
2018-09-09Drop deprecated compatibility methods from AnimatedSpriteRémi Verschelde
They were deprecated in 2.1, but never properly identified as such and thus never removed. Fixes #21765.
2018-09-06Add a function to force transform update, fixes #17628Juan Linietsky
2018-09-06Only allow StreamTexture, ImageTexture in Light2D, closes #15194Juan Linietsky
2018-09-04Move ParticlesMaterial code to its own resource fileRémi Verschelde
It's shared by both 2D and 3D particles (+ CPU ones), so it makes sense to have as a common resource. It also allowed to disable compilation of Particles (3D) when using 'disable_3d'. Also cleaned up includes in SpatialEditorGizmos and some other places, as well as dropped dead code in material_editor_plugin.cpp.
2018-09-02PhysicsBody: Don't create PhysicsMaterial override for default friction/bounceRémi Verschelde
And don't save physics_material_override if null.
2018-09-01Improve ClassDB information for some some signal parametersKelly Thomas
2018-08-30RayCast2D: Fix reporting old collider after collision endedRémi Verschelde
It now behaves the same as RayCast (3D). Fixed documentation accordingly and documented new configuration options. Supersedes and closes #20567.
2018-08-29Add missing copyright headersRémi Verschelde
2018-08-29Ported CPU particles to 2DJuan Linietsky
2018-08-29Physics: Properly obsolete friction and bounce propertiesRémi Verschelde
Without this change any new PhysicsBody would show deprecation warnings due to default values for friction and bounce being defined. It also enforced a physics material override even when using default values.
2018-08-29Unexpose TileMap set_celldMarcelo Fernandez
2018-08-29Fix operator precedence in PhysicsBody2D::set_weightRémi Verschelde
Fixes #16038.
2018-08-24Particles: Allow speed_scale at 0 in property hint, equivalent to pauseRémi Verschelde
Supersedes and closes #21193.
2018-08-24Merge pull request #21110 from natrim/particles2d_editorRémi Verschelde
Particles2D: fix editing Visibility Rect from new inspector
2018-08-24Make some debug prints verbose-only, remove othersRémi Verschelde
2018-08-23Added a function to cache texture opacity at a pixel, and modified editor to ↵Juan Linietsky
use it. Provides massive speedups to selecting objects, still awaiting for @MarianoGNU to do fixes to the region editor to improve performance.
2018-08-23Revert "Take CanvasLayer transform into account for 2D physics"Rémi Verschelde
This reverts commit 4839e5f6d9ed1c0afee933009ab44b9913310d27. Fixes #21289.
2018-08-23Fix transform not being applied properly after toggling remote node, fixes ↵Juan Linietsky
#17671
2018-08-23Fix properly keep scale in RemoteTransform2D, fixes #17692, closes #17690Juan Linietsky
2018-08-22Restrict set_pitch_scale to positive scales for AudioStreamPlayer*Chaosus
Fixes #20459. Co-authored-by: Tiago José Sousa Magalhães <crakylps@gmail.com>
2018-08-21Merge pull request #21245 from RandomShaper/fix-physics-canvas-xformRémi Verschelde
Take CanvasLayer transform into account for 2D physics
2018-08-21Changes to ClippedCamera, RayCast,Raycast2D and 2D physics API to add ↵Juan Linietsky
ability to choose between bodies and areas when colliding.
2018-08-21Optimize CanvasLayer::get_global_transform_with_canvasPedro J. Estébanez
So it takes advantage of the `get_global_transform` cached data.
2018-08-21Take CanvasLayer transform into account for 2D physicsPedro J. Estébanez
Fixes #18073.
2018-08-21Deprecate incorrect Color::gray()Rémi Verschelde
This average is not a proper approximation of a grayscale value, get_v() is better suited for that. If we want a real to_grayscale() conversion, it's somewhat more involved: https://en.wikipedia.org/wiki/Grayscale Remove the deprecated Gray() from C# bindings as it conflicts with new named color constants.
2018-08-21Fix arg name in docs, some copy-paste errorsPoommetee Ketson
2018-08-19Added ray shape and move_and_slide with snapping on 3D.Andrea Catania
Added stop_on_slope on 2d part
2018-08-17Particles2D: fix editing Visibility Rect from inspectorNatrim
+ renamed generate_aabb to generate_visibility_rect to prevent future confusions
2018-08-16Lift 1440 limit in rotation_degrees hint rangeRémi Verschelde
Fixes #15947.
2018-08-14Merge pull request #18096 from aaronfranke/masterJuan Linietsky
[Core] Split up math_2d.h
2018-08-13Merge pull request #20587 from groud/fix_2deditor_scrollable_zoneRémi Verschelde
Fixes bugs on the 2D editor scrollable area
2018-08-10[Core] Change math_2d includes to vector2 includes where relevantAaron Franke