Commit Graph

880 Commits

Author SHA1 Message Date
Fabio Alessandrelli c26094fd84 Fix InputEvent marshalling 2018-07-28 17:17:39 +02:00
Fabio Alessandrelli 497bc7d5fd Fix marshalls size checks.
Yesterday, when playing around with my network code, I realized there is
a security issue in decode_variant, at least when decoding PoolArrays.
Basically, the size of the PoolArray is encoded in a uint32_t, when
decoding it, that value is cast to int when comparing if the packet is
actually that size causing numbers with MSB=1 to be interpreted as
negative thus always passing the check. That same value though, is used
as uint32_t again to resize the output vector.  For this reason, sending
a malformed packet with declared type PoolByteArray and size of 2^31(+x)
causes the engine to try to allocate 2+GB of pool memory, causing the
engine to crash.

This patch is a backport of the one initially written for the master
branch.
2018-07-28 17:17:36 +02:00
Rémi Verschelde bb13fa896e Style: Format code with clang-format 6.0.1 2018-07-18 17:56:12 +02:00
Bojidar Marinov 7a4b8c82f9
Fix crash when deallocating named colors map
Fixes #18216
2018-07-18 11:36:43 +03:00
Rhody Lugo 57ae75876f add NoCache wrapper to Command 2018-06-21 03:40:24 -04:00
dns fd55fd8961 return integer for set_output_buffer_max_size() & set_input_buffer_max_size(int) 2018-05-15 19:11:23 +07:00
Xavier Sellier 4fe2b05401 Change "env['ndk_platform']" to "ndk_platform" and add "can_vectorize = True" 2018-04-26 09:29:28 -04:00
Hein-Pieter van Braam 2085bcce3b Allow inlining of all parts of safe_refcount
Differences with this aren't huge but the effort is minimal, in some
workloads gain a couple of percent of performance.
2018-04-25 17:49:10 -04:00
Rémi Verschelde 0b180a0732 Last -Wc++11-narrowing fix for clang 6.0
Was meant to be in b29b35c but forgot to amend it.
Fixes #17944.
2018-04-03 15:59:57 +02:00
Rémi Verschelde b29b35cee5 Fix more -Wc++11-narrowing errors with clang
Follow-up to and fixes #17725 (again).
2018-04-03 13:09:53 +02:00
Xavier Sellier 0332719b91 Add encrypt_text/decrypt_text function using aes256 algorithm 2018-03-20 10:38:51 -04:00
Rémi Verschelde 6a180a6983
Merge pull request #15565 from RandomShaper/adpod-topmost-2.1
Add new window setting: always-on-top (2.1)
2018-02-14 16:43:20 +01:00
Rémi Verschelde 4e46b0b668
Merge pull request #13930 from marcelofg55/center_window_2.1
Added OS::center_window to center the window precisely on desktop platforms
2018-02-14 00:15:07 +01:00
Rhody Lugo 7b25a33762 add Colemak layout 2018-01-23 03:15:45 -04:00
Juan Linietsky 6dced62187 Print error if a resource can't load from script, fixes #15313
(cherry picked from commit b1ab44aa05)
2018-01-05 22:53:48 +01:00
Pedro J. Estébanez 554ffdcde7 Add new window setting: always on top
Implemented for Windows and Linux.
2018-01-05 21:28:56 +01:00
Rémi Verschelde 3102dc17ee
Merge pull request #13437 from xsellier/bugfix/mouse-cursor-lag
Implement hardware cursor acceleration for Godot Engine 2.1
2018-01-03 08:36:44 +01:00
James 010a3433df resolve_hostname_addresses: retrieve every addresses associated with a hostname 2018-01-02 11:28:48 +01:00
Rémi Verschelde 2712014744 Update copyright statements to 2018
Happy new year to the wonderful Godot community!
2018-01-02 11:27:24 +01:00
Hein-Pieter van Braam f856eb0781
Merge pull request #13433 from xsellier/bugfix/vector2-and-vector3-not-properly-parsed
Vector2 and Vector3 are not properly parsed
2017-12-16 17:37:27 +01:00
Xavier Sellier 377fdc1e33 Hardware cursor implementation for Godot Engine 2.1
- Remove all references to the variable 'custom_mouse_cursor_hotspot' and 'custom_mouse_cursor' from the project settings.
- Indeed, to implement a custom cursor we need to define a sprite for each 'state' of the cursor. Using those variables in the projects settings would define only the _main_ cursor.
- Cleanup the VirtualServer (Remove references to cursor_set_visible, cursor_set_texture and cursor_set_pos)
- Cleanup the Input (set_mouse_in_window should not be used anymore)
- Update the documentation
- Implement it for windows, X11, Javascript, BB 10, OSx, iOS, server, android
- NOT IMPLEMENTED FOR WINRT (As of today, I'm not able to implement this one, this post might help)
- NOT IMPLEMENTED FOR HAIKU (Support of this platform seems perfunctory)
- Build it for Windows, Android and OSX
2017-12-15 11:37:36 -05:00
Xavier Sellier 487773ed24 Remove funny output during when exporting a project or loading Godot Engine 2017-12-11 11:13:04 -05:00
Rémi Verschelde 6a4e7198c5 Style: apply clang-format (5.0.0) to current source 2017-12-11 15:31:49 +01:00
Pedro J. Estébanez c356fbe05f Fix Windows-to-Linux export error
Now chmod() returns ERR_UNAVAILABLE by default, to signal the caller the problem is lack of support instead of a failed operation.
2017-12-06 20:28:00 +01:00
marcelofg55 129e0f34d0 Added OS::center_window to center the window precisely on desktop platforms 2017-12-03 17:13:26 -03:00
Xavier Sellier eb8952e995 Vector2 and Vector3 are not properly parsed
This commit should solve https://github.com/godotengine/godot/issues/13425
It has been tested manually and it works like a charm
2017-11-30 21:53:50 -05:00
Rhody Lugo 714e02c0f6 disable caching for targets using helper functions 2017-11-28 16:14:24 -04:00
Rhody Lugo 388249c386 use the same cache for all branches for appveyor 2017-11-28 03:23:51 -04:00
Rémi Verschelde 980f5b36a4
Merge pull request #12947 from volzhs/remove-printline
Remove print spam when using encrypted script

[ci skip]
2017-11-15 12:44:04 +01:00
volzhs 28dfd82734 Remove print spam when using encrypted script 2017-11-15 20:37:57 +09:00
sersoong 875fd90467 Add more template to Script_Create_dialog.cpp 2017-11-13 14:31:51 +08:00
Matthias Hoelzl fb236045de Make build scripts Scons 3.0/Python3 compatible
- Cherry picked #10662 and fixed merge conflicts.
- Manualy merged the change from #11904.
- Did not merge #12236 since I'm not sure whether the issue
  affects Godot 2.1 and I don't have VS2013 to test.
- Did not merge #11843 since it doesn't seem relevant (the
  code is only needed for creating DONORS.md, etc.).
- Did not merge #10727 and #11752 since they seem to be
  already included in #11742.
- The Windows and Linux builds have been tested with Scons 3.0
  using Python 3.
- OSX and iOS should hopefully work but are not tested since
  I don't have a Mac.
- Builds using SCons 2.5 and Python 2 should not be impacted.
2017-10-24 06:41:32 +02:00
Pedro J. Estébanez 303c823588 Fix formatting of debug log overflow
Fixes #12087.

(cherry picked from commit d645b80e46)
2017-10-20 19:56:26 +02:00
Marcelo Fernandez b0d5596738 Added OS::move_path_to_trash function, implemented only on OS X for now. 2017-09-21 17:45:32 -03:00
Marcelo Fernandez 253db95cba OS::execute can now read from stderr too when executing with a pipe. 2017-09-21 17:44:53 -03:00
Rémi Verschelde 1391269a78 Merge pull request #10124 from marcelofg55/handle_sigsegv
Added a SIGSEGV handler that dumps the stacktrace to ease reporting
2017-09-21 11:30:40 +02:00
Marcelo Fernandez ad37dbfec2 Fix base _chmod return value 2017-09-19 20:38:59 -03:00
Marcelo Fernandez 60cf34b968 Added a crash handler to dump the backtrace on Windows, Linux and OS X 2017-09-19 19:56:24 -03:00
Marcelo Fernandez b48704c620 Fix x11 exported executables not getting the +x flag 2017-09-16 22:38:32 -03:00
Rémi Verschelde b61462268e Revert "Display the Y angle properly when rotating from gizmo, partially helps #1479"
This reverts commit 641135ba21.
2017-08-27 18:25:12 +02:00
Rémi Verschelde 9d598833d2 Use HTTPS URL for Godot's website in the headers 2017-08-27 14:11:45 +02:00
Rémi Verschelde 886c7d82d0 Re-apply clang-format to all files
Some badly formatted code has managed to pass through our CI...
2017-08-27 14:11:11 +02:00
Poommetee Ketson 3629f23d81 Fix double single quotes in `connect` error print
(cherry picked from commit 4950ef7478)
2017-08-27 13:03:38 +02:00
Juan Linietsky e8fb68e038 simplify the way window is allowed to steal focus, no longer relying on project.godot. Closes #9459
(cherry picked from commit 533014b88c)
2017-08-27 12:53:45 +02:00
Sipaha a6b160660c Move wait_for_flush out of queue lock
(cherry picked from commit f6ee4cac39)
2017-08-27 12:49:09 +02:00
Rémi Verschelde 3e397586bb Merge pull request #10521 from RandomShaper/fix-double-parsing-2.1
Fix tokenization of doubles (2.1)
2017-08-22 15:03:33 +02:00
Pedro J. Estébanez c97435cfa5 Fix tokenization of doubles
(cherry picked from commit 6759a28050)
2017-08-22 00:01:04 +02:00
Hein-Pieter van Braam 364f2e8082 Correct hash behavior for floating point numbers
This backports the work in #7815 and the subsequent fixes in #8393

The following program now works as expected in this branch in both
release_debug and debug mode:

```gdscript
        print(sqrt(-1))
        print(sqrt(-1))

        var simple1=asin(10.0)
        var simple2=acos(10.0)
        print(simple1)
        print(simple2)
```

And successfully prints -nan 4 times

This fixes #9580 and fixes #8925
2017-08-20 23:44:28 +02:00
Marcelo Fernandez 647c4ae5bf Add closest_power_of_2 func and implement mix_rate/latency on OS X 2017-08-18 12:10:21 -03:00
Juan Linietsky 641135ba21 Display the Y angle properly when rotating from gizmo, partially helps #1479
(cherry picked from commit cd9539f85d)
2017-08-13 20:29:46 +02:00