Commit Graph

246 Commits

Author SHA1 Message Date
20a3bb9c48 Merge pull request #30226 from lawnjelly/interpolate
Add access to interpolation fraction for fixed timestep interpolation
2019-07-18 15:44:14 +02:00
bf6c301b9c Add access to interpolation fraction for fixed timestep interpolation
Addresses #30068

This is a prerequisite for allowing proper support for fixed timestep interpolation, exposing the interpolation fraction to the engine, modules and gdscript.

The interpolation fraction is the fraction through the current physics tick at the time of the current frame.
2019-07-11 08:25:26 +01:00
4e4697b1c4 Added release function to PoolVector::Access.
For clarity, assign-to-release idiom for PoolVector::Read/Write
replaced with a function call.
Existing uses replaced (or removed if already handled by scope)
2019-07-06 12:04:27 +01:00
24c52f1c2e Add b64 to string helper in CryptoCore 2019-07-03 18:42:46 +02:00
e9d624d7ce Merge pull request #30239 from Faless/crypto/crypto_core
CryptoCore class to access to base crypto utils.
2019-07-02 14:52:43 +02:00
564d93ff10 CryptoCore class to access to base crypto utils.
Godot core needs MD5/SHA256/AES/Base64 which used to be provided by
separate libraries.
Since we bundle mbedtls in most cases, and we can easily only include
the needed sources if we so desire, let's use it.

To simplify library changes in the future, and better isolate header
dependencies all functions have been wrapped around inside a class in
`core/math/crypto_base.h`.

If the mbedtls module is disabled, we only bundle the needed source
files independently of the `builtin_mbedtls` option.
If the module is enabled, the `builtin_mbedtls` option works as usual.

Also remove some unused headers from StreamPeerMbedTLS which were
causing build issues.
2019-07-02 12:36:27 +02:00
c486b8dac0 Merge pull request #30223 from qarmin/properly_delete_thread
Remove thread to prevent memory leak
2019-07-02 11:26:29 +02:00
6edd06e566 Remove thread to prevent memory leak 2019-07-01 15:07:06 +02:00
b0ce9401ff Merge pull request #30126 from qarmin/remove_unnecessary_code
Remove unnecessary code and add some error explanations
2019-07-01 14:32:04 +02:00
3c154eb93b Remove unnecessary code and add some error explanations 2019-07-01 12:59:42 +02:00
0db138a621 doc: Enforce default values for OS properties
Otherwise we end up fetching values from the current OS instance
when running doctool, so they would change based on the system or
even simply due to changes to the system clipboard.
2019-06-30 13:58:07 +02:00
eaaff9da31 Merge pull request #29941 from qarmin/redundant_code_and_others
Remove redundant code, possible NULL pointers and others
2019-06-27 01:05:18 +02:00
6f2233d13a Bind is_point_in_polygon in Geometry singleton 2019-06-27 00:20:22 +03:00
4e5310cc60 Some code changed with Clang-Tidy 2019-06-26 15:08:25 +02:00
b924fb97d6 Add ability to limit maximum/minimum window size. 2019-06-15 09:49:11 +03:00
06633a8074 Merge pull request #26462 from SubSage/master
Fixes OS.execute; stderr was silenced; adds missing quote from exe args (windows)
2019-05-28 14:26:57 +02:00
e8fbb28e20 Merge pull request #29119 from bruvzg/native_icon_support
Add native window/taskbar icon support for Windows and macOS.
2019-05-27 12:09:42 +02:00
2b9ed68d6a Add native window/taskbar icon support for Windows and macOS.
Co-authored-by: Markus Törnqvist <mjt@nysv.org>
2019-05-24 14:23:57 +03:00
24e9a881c0 Expose 2D Delaunay triangulation in Geometry singleton
Can be used via scripting as `Geometry.triangulate_delaunay_2d(points)`

The interface is the same as in `Triangulate` library, returning indices
into triangulated points.
2019-05-24 13:10:13 +03:00
883ef8570a Expose 2D polygon boolean operations in Geometry singleton
Clipper 6.4.2 is used internally to perform polypaths clipping, as well
as inflating/deflating polypaths. The following methods were added:

```
Geometry.merge_polygons_2d(poly_a, poly_b) # union
Geometry.clip_polygons_2d(poly_a, poly_b) # difference
Geometry.intersect_polygons_2d(poly_a, poly_b) # intersection
Geometry.exclude_polygons_2d(poly_a, poly_b) # xor

Geometry.clip_polyline_with_polygon_2d(poly_a, poly_b)
Geometry.intersect_polyline_with_polygon_2d(poly_a, poly_b)

Geometry.offset_polygon_2d(polygon, delta) # inflate/deflate
Geometry.offset_polyline_2d(polyline, delta) # returns polygons

// This one helps to implement CSG-like behaviour:
Geometry.transform_points_2d(points, transform)
```

All the methods return an array of polygons/polylines. The resulting
polygons could possibly be holes which could be checked with
`Geometry.is_polygon_clockwise()` which was exposed to scripting as well.
2019-05-22 17:12:39 +03:00
c8994b56f9 Style: Apply new changes from clang-format 8.0
It seems to stay compatible with formatting done by clang-format 6.0 and 7.0,
so contributors can keep using those versions for now (they will not undo those
changes).
2019-04-09 17:09:48 +02:00
ebe2f4ea09 core_bind: Use the appropriate enum instead of int 2019-04-07 18:52:39 +02:00
e7f22ebdcd Enable warnings=extra on clang and GCC testers.
And remove 2 warnings from warnings=extra.
2019-04-02 17:14:47 +02:00
393e62b98a Add object encoding param to serialization methods
Network peers get_var/put_var
File get_var/store_var
GDScript/Mono/VisualScript bytes2var/var2bytes
Add MultiplayerAPI.allow_object_decoding member which deprecates PacketPeer.allow_object_decoding.

Break ABI compatibaility (API compatibility for GDNative).
2019-04-01 15:53:19 +02:00
b22cf46fdb Request Android record permission when needed 2019-03-08 12:38:36 -03:00
9e465c9fd0 Fixes stderr silence; adds missing quote from exe args(windows)
8d117b214f/core/bind/core_bind.cpp (L452)
This function calls the bottom function

8d117b214f/drivers/unix/os_unix.cpp (L312)

OS.execute doesn't send out a value to stderr, so stderr defaults to
false, which will invoke this bottom line and always silence stderr.

8d117b214f/drivers/unix/os_unix.cpp (L315)

Some programs, such as FFmpeg, will print out to stderr with valuable
and vital information. This fixes stderr always being silenced, user can
now opt to have it be read as normal.
2019-03-05 17:07:00 -06:00
7a79eee523 Expose OS::get_current_video_driver to scripting languages 2019-02-16 14:41:07 +01:00
496d8f19fc Let memory stat functions return uint64_t 2019-01-30 19:07:46 +01:00
2caaa7c97d Fix error explanation in core_bind Thread::_start_func 2019-01-11 10:12:13 +07:00
b16c309f82 Update copyright statements to 2019
Happy new year to the wonderful Godot community!
2019-01-01 12:58:10 +01:00
2e39e38c10 doc: Sync classref with current source
Fix various code formatting issues and argument names.
2018-12-27 11:10:18 +01:00
84d060c768 Added OS.get_system_time_msecs() 2018-12-20 18:50:50 +09:00
4554c682e6 Changes IME input to use notification instead of callback, exposes IME methods to gdscript/gdnative. 2018-11-23 14:07:48 +02:00
48166a9f3c Add store_csv_line method for File 2018-11-16 11:09:05 +01:00
f2e54057ae -Moved EditorDefaultValue to ClassDB, made it core
-Removed one and zero hints for properties, replaced by default value
2018-11-08 11:30:59 -03:00
4de0cbba15 Expose OS::move_window_to_foreground 2018-11-07 11:51:15 -03:00
31f6fad90e Bind missing subresource flag in ResourceSaver 2018-10-18 17:58:44 +03:00
37386f112b Remove redundant "== true" code
If it can be compared to a boolean, it can be evaluated as one in-place.
2018-10-06 16:12:36 -04:00
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
c6b340ea98 Merge pull request #20712 from marcelofg55/midi_open_close
Add OS::open_midi_inputs and OS::close_midi_inputs
2018-08-24 12:17:14 -03:00
43825dce47 fix #20390 :get_unix_time_from_datetime and get_date_time_from_unix_time can handle time before year 1970 now 2018-08-13 15:37:27 +08:00
d29ea4337f Fix ResourceLoader::exists() false negative and readd deprecated has() 2018-08-12 12:44:38 +02:00
852378109f Added function ResourceLoader.exists(), to check if a resource exists. Closes #19140 2018-08-10 15:57:43 -03:00
ea3d997f9d Revert "added get_creation_time function for gdscript" 2018-08-10 13:29:49 -03:00
275e0d5ee4 Merge pull request #18914 from notwarp/master
added get_creation_time function for gdscript
2018-08-10 13:28:47 -03:00
05fc12ddb6 Add OS::open_midi_inputs and OS::close_midi_inputs 2018-08-04 10:07:46 -03:00
7a5f9fc08e Added a new MIDIDriver class 2018-07-21 09:09:42 -03:00
4705dc4f00 Expose OS.get_ticks_usec() 2018-06-18 21:03:55 +02:00
c5bdb5b1d8 IME context detection. 2018-06-11 17:22:11 +01:00
f392650be2 Improve return value of OS.execute in blocking/non-blocking variants
Initialized the PID to -2, which will be the value returns in blocking-
mode where the PID is not available. (-1 was already taken to signify an
execution failure).

OS::execute will now properly return a non-OK error code when it fails
to execute the target file.

The documentation was rewritten to be very clear about the differences
between blocking and non-blocking mode.

Fixes #19056.
2018-05-30 12:55:17 +02:00