Commit graph

910 commits

Author SHA1 Message Date
Rémi Verschelde cda5b0bfe1 Fix warnings about unused variables [-Wunused-variable]
Fixes the following GCC 5 warnings:
```
drivers/gles2/rasterizer_scene_gles2.cpp:1139:15: warning: unused variable 'offset' [-Wunused-variable]
drivers/gles2/rasterizer_scene_gles2.cpp:1205:39: warning: unused variable 'multi_mesh' [-Wunused-variable]
drivers/gles2/rasterizer_storage_gles2.cpp:359:7: warning: unused variable 'srgb' [-Wunused-variable]
drivers/gles2/shader_gles2.cpp:1016:45: warning: unused variable 'texture_hints' [-Wunused-variable]
editor/animation_track_editor.cpp:776:9: warning: unused variable 'keys_to' [-Wunused-variable]
editor/editor_inspector.cpp:273:7: warning: unused variable 'vs_height' [-Wunused-variable]
editor/editor_themes.cpp:202:10: warning: unused variable 'begin_time' [-Wunused-variable]
editor/editor_themes.cpp:239:10: warning: unused variable 'end_time' [-Wunused-variable]
editor/plugins/animation_blend_tree_editor_plugin.cpp:726:17: warning: unused variable 'an' [-Wunused-variable]
editor/plugins/script_text_editor.cpp:1278:8: warning: unused variable 'fold_state' [-Wunused-variable]
main/main.cpp:132:13: warning: 'use_vsync' defined but not used [-Wunused-variable]
modules/cvtt/image_compress_cvtt.cpp:231:8: warning: unused variable 'y_end' [-Wunused-variable]
modules/cvtt/image_compress_cvtt.cpp:311:6: warning: unused variable 'shift' [-Wunused-variable]
modules/gdscript/gdscript_editor.cpp:58:7: warning: unused variable 'th' [-Wunused-variable]
modules/gridmap/grid_map.cpp:1084:6: warning: unused variable 'ofs' [-Wunused-variable]
modules/theora/video_stream_theora.cpp:442:9: warning: unused variable 'tr' [-Wunused-variable]
modules/visual_script/visual_script_editor.cpp:2606:6: warning: unused variable 'count' [-Wunused-variable]
modules/visual_script/visual_script_editor.cpp:2829:6: warning: unused variable 'seq_count' [-Wunused-variable]
modules/visual_script/visual_script_editor.cpp:2844:24: warning: unused variable 'vnode_function' [-Wunused-variable]
modules/websocket/lws_peer.cpp:122:12: warning: unused variable 'peer_data' [-Wunused-variable]
modules/websocket/lws_peer.cpp:135:12: warning: unused variable 'peer_data' [-Wunused-variable]
modules/websocket/lws_peer.cpp:63:12: warning: unused variable 'peer_data' [-Wunused-variable]
modules/websocket/lws_peer.cpp:91:12: warning: unused variable 'peer_data' [-Wunused-variable]
platform/android/export/export.cpp:763:16: warning: unused variable 'node_size' [-Wunused-variable]
scene/gui/rich_text_label.cpp:850:10: warning: unused variable 'x_ofs' [-Wunused-variable]
scene/gui/text_edit.cpp:653:8: warning: unused variable 'tab_w' [-Wunused-variable]
scene/resources/bit_mask.cpp:186:6: warning: unused variable 'i' [-Wunused-variable]
scene/resources/mesh.cpp:549:20: warning: '_array_name' defined but not used [-Wunused-variable]
servers/audio/audio_rb_resampler.cpp:107:10: warning: unused variable 'v2' [-Wunused-variable]
servers/audio/audio_rb_resampler.cpp:108:10: warning: unused variable 'v3' [-Wunused-variable]
servers/audio/audio_rb_resampler.cpp:109:10: warning: unused variable 'v4' [-Wunused-variable]
servers/audio/audio_rb_resampler.cpp:110:10: warning: unused variable 'v5' [-Wunused-variable]
servers/audio/audio_rb_resampler.cpp:111:10: warning: unused variable 'v0n' [-Wunused-variable]
servers/audio/audio_rb_resampler.cpp:112:10: warning: unused variable 'v1n' [-Wunused-variable]
servers/audio/audio_rb_resampler.cpp:113:10: warning: unused variable 'v2n' [-Wunused-variable]
servers/audio/audio_rb_resampler.cpp:114:10: warning: unused variable 'v3n' [-Wunused-variable]
servers/audio/audio_rb_resampler.cpp:115:10: warning: unused variable 'v4n' [-Wunused-variable]
servers/audio/audio_rb_resampler.cpp:116:10: warning: unused variable 'v5n' [-Wunused-variable]
servers/visual/default_mouse_cursor.xpm:2:21: warning: 'default_mouse_cursor_xpm' defined but not used [-Wunused-variable]
```
2018-09-27 16:25:24 +02:00
Rémi Verschelde e5bbcb8bcf Fix warnings for comparison between signed and unsigned integers [-Wsign-compare]
Also turn off -Wsign-compare warnings in the future, we do not consider them important.

Fixes the following GCC 5 warnings:
```
core/node_path.cpp:279:24: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
core/oa_hash_map.h:169:21: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
core/oa_hash_map.h:314:21: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
drivers/gles2/shader_gles2.cpp:985:23: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
drivers/gles3/rasterizer_storage_gles3.cpp:1075:25: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
drivers/pulseaudio/audio_driver_pulseaudio.cpp:343:34: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
editor/editor_plugin.cpp:525:21: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
editor/editor_properties_array_dict.cpp:747:25: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
editor/plugins/spatial_editor_plugin.cpp:2078:20: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
editor/plugins/spatial_editor_plugin.cpp:4096:27: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
editor/plugins/sprite_editor_plugin.cpp💯20: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
modules/cvtt/image_compress_cvtt.cpp:122:23: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
modules/cvtt/image_compress_cvtt.cpp:134:77: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
modules/cvtt/image_compress_cvtt.cpp:339:25: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
modules/etc/image_etc.cpp:222:34: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
modules/gdnative/register_types.cpp:242:21: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
modules/gdnative/register_types.cpp:258:21: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
modules/opensimplex/simplex_noise.cpp:200:13: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
modules/opensimplex/simplex_noise.cpp:222:13: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
modules/opensimplex/simplex_noise.cpp:246:13: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
platform/android/export/export.cpp:1085:21: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
platform/android/export/export.cpp:1489:23: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
platform/android/export/export.cpp:1623:22: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
platform/iphone/export/export.cpp:206:20: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
platform/iphone/export/export.cpp:356:20: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
platform/iphone/export/export.cpp:406:20: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
platform/iphone/export/export.cpp:493:21: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
scene/3d/audio_stream_player_3d.cpp:420:23: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
scene/resources/audio_stream_sample.cpp:565:22: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
scene/resources/audio_stream_sample.cpp:571:22: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
servers/audio/audio_rb_resampler.cpp:156:36: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
```

The following warnings were not fixed, as they implied casting for no gain:
```
core/io/packet_peer.cpp:228:38: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
core/io/resource_format_binary.cpp:109:11: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
drivers/gles2/rasterizer_scene_gles2.cpp:144:57: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
drivers/unix/file_access_unix.cpp:249:46: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
scene/3d/voxel_light_baker.cpp:889:14: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
scene/3d/voxel_light_baker.cpp:1020:14: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
scene/3d/voxel_light_baker.cpp:1154:14: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
scene/3d/voxel_light_baker.cpp:2255:38: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
scene/resources/bit_mask.cpp:336:25: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
servers/audio/audio_stream.cpp:141:49: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
servers/audio/audio_stream.cpp:150:19: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
servers/audio/audio_stream.cpp:154:19: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
servers/audio_server.cpp:86:21: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
servers/audio_server.cpp:89:17: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
```
2018-09-27 16:25:23 +02:00
Rémi Verschelde 2b084352b9 Fix warnings on non-static data member initializers (C++11 feature)
We're not formally using C++11 yet so those trigger compilation warnings
(at least with GCC 5):

./main/input_default.h:122:30: warning: non-static data member initializers only available with -std=c++11 or -std=gnu++11
  CursorShape default_shape = CURSOR_ARROW;
                              ^

Note: We may allow those eventually (especially for non-int static const),
but most of current occurrences were inconsistent with all other classes.

See also http://www.stroustrup.com/C++11FAQ.html#member-init
2018-09-27 10:29:48 +02:00
Juan Linietsky 65fd37c149 -Rewrote GLES2 lighting and shadows and optimized state changes, did many optimizations, added vertex lighting.
-Did some fixes to GLES3 too
2018-09-23 12:14:50 -03:00
Chaosus 16e5ef6894 Added missed min/max shader overloads 2018-09-21 20:10:03 +03:00
Ibrahn Sahir bff864818f Fixed an access after free in ShaderLanguage::_reduce_expression.
Passing an element reference of a vector to a push_back call to
that same vector can cause an access after free. This is because push_back
will resize the vector, reallocating if necessary, leaving the reference
referring to the freed memory.
Removed an instance of this usage here.
2018-09-19 14:28:19 +01:00
JFonS 3cedec5f75 Set uniform default values in inspector 2018-09-13 23:05:33 +02:00
Rémi Verschelde 1a16dabfb5
Merge pull request #21982 from luzpaz/misc-typos
Misc. typos
2018-09-13 10:59:00 +02:00
luz.paz 08bde5b2de Misc. typos
Found via `codespell -q 3 -I ../godot-word-whitelist.txt --skip="./thirdparty,*.po"`
2018-09-12 21:39:17 -04:00
Rémi Verschelde 277b24dfb7 Make core/ includes absolute, remove subfolders from include path
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-12 09:52:22 +02:00
Rémi Verschelde 5e900ebf29 PhysicsServer: Add validity checks for shape query parameters
Fixes #17439.
2018-09-10 16:30:16 +02:00
JFonS f495cede0b Fix handling of shader constants that caused crash, closes #15166 2018-08-31 19:24:48 +02:00
Juan Linietsky cf834a22dc Ported CPU particles to 2D 2018-08-29 16:48:55 -03:00
thfrwn d37e9ef95d log to console if falling back to dummy audio driver 2018-08-27 05:35:59 -07:00
Rémi Verschelde 52466d57e9 Make some debug prints verbose-only, remove others 2018-08-24 14:59:01 +02:00
elasota 35f6ba5c5d BPTC support 2018-08-21 22:56:04 -04:00
Chaosus 27731a86d2 Restrict set_pitch_scale to positive scales for AudioStreamPlayer*
Fixes #20459.

Co-authored-by: Tiago José Sousa Magalhães <crakylps@gmail.com>
2018-08-22 00:11:53 +02:00
Juan Linietsky ee07fb5ebe Changes to ClippedCamera, RayCast,Raycast2D and 2D physics API to add ability to choose between bodies and areas when colliding. 2018-08-21 15:31:23 -03:00
Andrea Catania 0b98834b77 Added ray / shape / point / motion / rest cast exclusion of area and or body 2018-08-21 18:51:08 +02:00
Rémi Verschelde 912131fe03
Merge pull request #20101 from panzergame/shape_margin
Expose bullet shape margin to UI.
2018-08-21 16:17:11 +02:00
Rémi Verschelde ad8a6b10b5
Merge pull request #21220 from Noshyaar/import-crash
Fix crash while importing corrupt wav
2018-08-21 00:10:06 +02:00
Rémi Verschelde 35d232b100
Merge pull request #21228 from Noshyaar/docs-bind
Fix arg name in docs, some copy-paste errors
2018-08-21 00:08:05 +02:00
Juan Linietsky d88d0d457d Fixes to move and slide and ray separation, implement separation in Godot physics 2018-08-20 17:31:55 -03:00
Poommetee Ketson ec68822cd7 Fix crash while importing corrupted wav
Line 199 does division with 'bits per sample' but the check for
0 is missing.
2018-08-21 02:06:22 +07:00
Poommetee Ketson 76adef2704 Fix arg name in docs, some copy-paste errors 2018-08-21 01:51:19 +07:00
Juan Linietsky 1b66b08fdb
Merge pull request #20908 from AndreaCatania/kiSlope
Improved move_and_slide function stay on slope
2018-08-20 13:24:28 -03:00
Chaosus 37f5cc5b63 Added FRAGCOORD to spatial light processing 2018-08-20 09:35:47 +03:00
Chaosus 9634d74d31 Allow matrixes in varyings 2018-08-19 15:36:58 +03:00
Andrea Catania 0010d9c82a Added ray shape and move_and_slide with snapping on 3D.
Added stop_on_slope on 2d part
2018-08-19 13:45:23 +02:00
Tristan Porteries e5bfa98d0f Expose bullet shape margin to UI.
The margin value is exposed into the UI for shape ressource.
This value can be modified through set_margin and get from get_margin
or by using the property margin. Each time the margin is modified
the associated collision shape is recreated and the margin value is
used in ShapeBullet::prepare.
2018-08-16 16:58:15 +02:00
Thomas Herzog 037f4638ab add project method to Vector2/3 2018-08-16 12:52:38 +02:00
Juan Linietsky 4e55835e48
Merge pull request #18096 from aaronfranke/master
[Core] Split up math_2d.h
2018-08-14 18:58:32 -03:00
Marcelo Fernandez 14fa843735 Add Dummy AudioDriver into the AudioDriverManager list 2018-08-13 18:11:24 -03:00
Rémi Verschelde 73cf0fd305
Merge pull request #19106 from SaracenOne/audio_mic
[WIP] Experimental microphone support
2018-08-11 15:24:41 +02:00
Aaron Franke cf136a91d6 [Core] Completely kill math_2d.h, change includes 2018-08-11 03:08:34 -05:00
Juan Linietsky 0fc1c4eda8
Merge pull request #20149 from Overblob/shader_float_typing
Shader language - Add optional float typings
2018-08-10 18:21:28 -03:00
Juan Linietsky 978505a90a
Merge pull request #20727 from muiroc/fix_sw_sat_table
fixed godotphysics sat dispatch table
2018-08-08 09:49:48 -03:00
Juan Linietsky 14fd797c53
Merge pull request #20381 from AndreaCatania/phymat_2
Improved Physics material
2018-08-07 15:31:26 -03:00
Andrea Catania 5e65e28eed Removed physics material combination mode. Added rough and absorbent parameter to material. Fixed 'change' signal connection 2018-08-07 19:38:04 +02:00
muiroc 14a227e9e7 fixed godotphysics sat dispatch table 2018-08-05 00:02:14 +02:00
Saracen 59b703c4f8 Add extra latency to microphone playback to reduce clipping. 2018-07-31 04:46:29 +01:00
Thomas Herzog b4d3f541e7 add 3D textures 2018-07-30 12:20:27 +02:00
Juan Linietsky 95a9e51975 Remove pointless check for no texture, fixes #7298 2018-07-29 20:47:20 -03:00
Juan Linietsky 7b63c6323d Clear color was not correctly being set, fixes #4939 2018-07-29 15:09:42 -03:00
Juan Linietsky d2aaf460fb Manually fix, merge and close #15168 2018-07-29 12:18:37 -03:00
Marcelo Fernandez 597301db34 Renamed AudioDriver audio_input_* vars to input_* 2018-07-27 15:09:03 -03:00
Saracen aca6e291d6 Fixed audio clipping on WASAPI by fixing argument order on AudioClient
Initialize method ensuring a larger capture buffer and adding bounds
to the capture and stream.
2018-07-27 16:50:12 +01:00
Marcelo Fernandez 2cf8da9d9f Implemented capture device selection for CoreAudio 2018-07-27 16:50:11 +01:00
Marcelo Fernandez 061358d838 Modified Microphone implementation to handle only one device at a time (WIP) 2018-07-27 16:50:10 +01:00
Saracen 76fd9d215c Fixes for microphone clipping and latency (marcelofg55) 2018-07-27 16:50:10 +01:00