Commit graph

284 commits

Author SHA1 Message Date
Rémi Verschelde
95131e6f23 Fix warnings on release builds (not DEBUG_ENABLED)
Fixes the following Clang 5 warnings:
```
modules/bmp/image_loader_bmp.cpp:46:60: warning: comparison of unsigned expression < 0 is always false [-Wtautological-compare]
modules/bmp/image_loader_bmp.cpp:48:61: warning: comparison of unsigned expression < 0 is always false [-Wtautological-compare]
drivers/png/image_loader_png.cpp:231:20: warning: comparison of unsigned expression >= 0 is always true [-Wtautological-compare]
scene/gui/graph_edit.cpp:1045:8: warning: comparison of constant 0 with expression of type 'bool' is always false [-Wtautological-constant-out-of-range-compare]

core/class_db.cpp:812:13: warning: unused variable 'check' [-Wunused-variable]
core/io/file_access_pack.cpp:172:11: warning: unused variable 'ver_rev' [-Wunused-variable]
core/math/bsp_tree.cpp:195:13: warning: unused variable 'plane' [-Wunused-variable]
core/math/bsp_tree.cpp:168:6: warning: unused variable 'plane_count' [-Wunused-variable]
modules/gdscript/gdscript_function.cpp:685:10: warning: unused variable 'ok' [-Wunused-variable]
modules/gdscript/gdscript_function.cpp:706:10: warning: unused variable 'ok' [-Wunused-variable]
modules/gdscript/gdscript_function.cpp:755:19: warning: unused variable 'var_type' [-Wunused-variable]
modules/gdscript/gdscript_function.cpp:1306:12: warning: unused variable 'err' [-Wunused-variable]

modules/gdscript/gdscript_function.cpp:158:15: warning: unused function '_get_var_type' [-Wunused-function]
modules/gdscript/gdscript_parser.cpp:750:20: warning: unused variable 'lv' [-Wunused-variable]
modules/gdscript/gdscript_parser.cpp:59:15: warning: unused function '_find_function_name' [-Wunused-function]
scene/main/node.cpp:2489:13: warning: unused function '_Node_debug_sn' [-Wunused-function]
```
2018-10-03 17:34:55 +02:00
Rémi Verschelde
b4c1d40869
Merge pull request #21492 from Maykeye/astar
Changed A* exit condition, added 2 tests for it
2018-10-02 10:30:12 +02:00
Rémi Verschelde
34dec26a50 Add support for '.[0-9]' numbers in Expression
Fixes #21874, supersedes #22065.
2018-10-01 16:06:21 +02:00
Rémi Verschelde
a9e17af09a SCons: Build core's thirdparty code in own environment
Also move Zlib and Zstd's build instructions to core/SCsub.
2018-09-28 11:40:41 +02:00
DualMatrix
f483460e38 Removed obsoleted core/helper/value_evaluator.h and moved math_fieldwise to core/math/
Removed obsoleted core/helper/value_evaluator.h and moved math_fieldwise to core/math/
2018-09-23 14:58:15 +02:00
Aaron Franke
5f4f9ca4a5 Fix: Strip integer part in "decimals"
Note: Core only.
2018-09-19 23:47:33 -04: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
9eb4d4ab2d Add missing copyright headers 2018-08-29 22:41:17 +02:00
Maykeye
40562a67c8 Changed A* exit condition, added 2 tests for it
A* now exits when next node from open set with least cost happens to be end_point,
not when node with least cost has end_point as a neigbour.

Added two tests for astar:
* ABC tests case where start and end node are
neigbours
* ABCX tests case with intermediate nodes
2018-08-28 19:48:07 +06:00
Ignacio Etcheverry
78bb53f85d
Merge pull request #21205 from KellyThomas/c-sharp-feature-parity-quat
[Mono] Quat - add some missing constructors and methods
2018-08-27 16:18:09 +02:00
Rémi Verschelde
52466d57e9 Make some debug prints verbose-only, remove others 2018-08-24 14:59:01 +02:00
Kelly Thomas
a941684590 mono: Quat - add some missing constructors and methods 2018-08-24 07:56:54 +08:00
Rémi Verschelde
92aafa898f
Merge pull request #21305 from Mr-Slurpy/expression-fix
Fixed bugs in expression class
2018-08-23 12:10:54 +02:00
Daniel Eliasinski
fb3506d796 Fixed bugs in expression class 2018-08-23 01:29:24 -04:00
Aaron Franke
434973fb83 [Mono] Vector2/3 Project methods 2018-08-22 13:27:35 -04:00
Hein-Pieter van Braam
33669a8bca Remove faces in in QuickHull::build() that we don't need anymore
We delete the faces for consideration in this loop but we can still
sometimes find an edge that connects to this face. We now interate over
all edges and disconnect edges connecting to this face.

This fixes #16560 and fixes #17569
2018-08-20 00:22:47 +02:00
Thomas Herzog
037f4638ab add project method to Vector2/3 2018-08-16 12:52:38 +02:00
Aaron Franke
cf136a91d6 [Core] Completely kill math_2d.h, change includes 2018-08-11 03:08:34 -05:00
Aaron Franke
14fe7230f4 [Core] Move Vector2i and Rect2i out of math_2d.h 2018-08-11 00:33:01 -05:00
Aaron Franke
2eb8a9749e [Core] Move Rect2 and Transform2D to their own files
Math2D includes Transform2D, which includes Rect2, which includes Vector2.
2018-08-10 23:40:50 -05:00
Aaron Franke
9170d932e3 [Core] Grammar, move defs to defs
Math constant definitions belong in `math_defs.h`. Also, the grammer in these files really needed some updating.
2018-08-10 22:42:02 -05:00
Aaron Franke
28fc195339 [Core] Change math_2d includes to vector2 includes where relevant 2018-08-10 14:59:29 -05:00
Aaron Franke
9d1b5f4e3b [Core] Move Vector2 to its own file
Makes 2D math code easier to read and makes Vector2 consistent with Vector3. In the future, we may move other things out of math_2d as well.
2018-08-10 14:59:29 -05:00
Marcelo Fernandez
da1f1619fe Fix clang compile error 2018-08-09 08:50:06 -03:00
Juan Linietsky
a71a5fc0c3 Ability to pass custom variables to expression. 2018-08-08 17:47:51 -03:00
Juan Linietsky
934c641a15 -Add Expression class, used to evaluate expressions
-Added expression evaluation to EditorSpinSlider, fixes #20813, fixes #18932
2018-08-08 17:35:23 -03:00
Rémi Verschelde
5c8919aac6
Merge pull request #18955 from tagcup/fix_set_scale
Removed incorrect Basis::set_scale().
2018-07-26 10:37:03 +02:00
Hein-Pieter van Braam
0e29f7974b Reduce unnecessary COW on Vector by make writing explicit
This commit makes operator[] on Vector const and adds a write proxy to it.  From
now on writes to Vectors need to happen through the .write proxy. So for
instance:

Vector<int> vec;
vec.push_back(10);
std::cout << vec[0] << std::endl;
vec.write[0] = 20;

Failing to use the .write proxy will cause a compilation error.

In addition COWable datatypes can now embed a CowData pointer to their data.
This means that String, CharString, and VMap no longer use or derive from
Vector.

_ALWAYS_INLINE_ and _FORCE_INLINE_ are now equivalent for debug and non-debug
builds. This is a lot faster for Vector in the editor and while running tests.
The reason why this difference used to exist is because force-inlined methods
used to give a bad debugging experience. After extensive testing with modern
compilers this is no longer the case.
2018-07-26 00:54:16 +02:00
Wilson E. Alvarez
a22e746bc3 Removed unnecessary assignments 2018-07-24 09:51:03 +02:00
Max Hilbrunner
c538f2ff80
Merge pull request #19279 from aaronfranke/core-fposmod-fix
[Core] [Math] Fix fposmod() function
2018-07-05 00:35:46 +02:00
Max Hilbrunner
045944f83a
Merge pull request #19819 from MetaSaval/master
Change the neighbours vector to a set in AStar
2018-07-03 15:32:15 +02:00
Danny
9b60bb2c7c Change the neighbours vector to a set in AStar
This fixes an issue where one could not disconnect two points that were connected more than once.
2018-06-27 22:36:38 -07:00
Juan Linietsky
ad4666f8e0
Merge pull request #19193 from tagcup/quat_norm
Fixed Basis -> Quat conversions, added a few safety checks.
2018-06-25 10:58:04 -03:00
Juan Linietsky
2365fe472b Added auto triangle generation in blend space, using Delaunay. 2018-06-21 22:48:47 -03:00
JFonS
9cd1c20f6a Polished 3D selection 2018-06-13 17:52:37 +02:00
Aaron Franke
eebe41b1b0 [Core] [Math] Fix fposmod() function
ffff


meth
2018-06-10 15:06:44 -05:00
Andrea Catania
0b7c4db5ee Added functions to get trimesh info 2018-06-07 15:46:17 +02:00
Rémi Verschelde
43b7ebf0a0 Style: Apply clang-format (5.0) to some missed files 2018-05-31 09:00:37 +02:00
tagcup
9d41161596 Fixed Basis -> Quat conversions, added a few safety checks.
Fixes #19027.
2018-05-27 14:15:47 -04:00
tagcup
1bba6eeeb9 Removed incorrect Basis::set_scale().
Also added a missing constructor in Basis, and fixed usage of inverse and affine inverse in Transform.
2018-05-17 19:39:04 -04:00
tagcup
ed7aadcd87 Add SLERP to Vector{2,3}, optimize Quat's Vector3 rotation.
Also even out Basis and Quat APIs a little.
2018-05-12 13:05:04 -04:00
Juan Linietsky
69a96ff4a6
Merge pull request #15943 from poke1024/geometry-line-line
Add Geometry::line_intersects_line_2d()
2018-05-07 17:54:33 -03:00
Alexander Alekseev
26963473a9 Vector3::round, Vector2::round & Vector2::ceil methods were added.
Now both structs (Vector2 & Vector3) have round, floor & ceil methods.
(see #18603)
2018-05-04 12:43:50 +03:00
Rémi Verschelde
bf7ca623a6 Fix Coverity reports of uninitialized scalar variable
Fixes most current reports on Coverity Scan of uninitialized scalar
variable (CWE-457): https://cwe.mitre.org/data/definitions/457.html

These happen most of the time (in our code) when instanciating structs
without a constructor (or with an incomplete one), and later returning
the instance. This is sometimes intended though, as some parameters are
only used in some situations and should not be double-initialized for
performance reasons (e.g. `constant` in ShaderLanguage::Token).
2018-04-19 15:20:45 +02:00
tagcup
a5e0bb447c Avoid converting Quat to Euler angles when not necessary.
Also ensure that get_scale doesn't arbitrarlity change the signs of scales, ensuring that the combination of get_rotation and get_scale gives the correct basis.

Added various missing functions and constructors.

Should close #17968.
2018-04-14 15:53:25 -04:00
Chaosus
ac4c340a45 Small performance fix to wrapf 2018-04-13 13:50:17 +03:00
Crazy-P
ae7a9df292 Resolves Inccorect Quaternion Conversion
Fixes https://github.com/godotengine/godot/issues/18025
2018-04-09 14:48:03 +08:00
Juan Linietsky
cef01f1f49
Merge pull request #16495 from Chaosus/is_point_in_triangle_fix
Fix is_point_in_triangle function
2018-04-08 18:18:19 -03:00