Commit graph

3458 commits

Author SHA1 Message Date
Marcel Admiraal
ce263c4ff6 Ensure assignment operators return by reference to avoid unnecessary copies. 2020-09-04 09:18:19 +01:00
bruvzg
80b8eff6aa
[Complex Test Layouts] Change String to use UTF-32 encoding on all platforms. 2020-09-03 19:56:24 +03:00
Marcel Admiraal
f6ad1954f7 Ensure header guards enclose entire header. 2020-09-03 11:29:42 +01:00
Rémi Verschelde
f57ade8f80
Merge pull request #41460 from Calinou/improve-resource-load-fail-message
Improve the resource loading error message to mention the need to import
2020-09-03 11:31:27 +02:00
Rémi Verschelde
4a5138bb99
Merge pull request #40400 from Arivval/load-resourcepack-with-offset
Added PCK file loading with offset feature
2020-09-03 07:33:19 +02:00
Yilin Ma
c524d50444 added load resource pack with offset feature
updated variables to use size_t

removed line break to make code style more consistent

added conditional check to return an error if offset field is used when loading a ZIP package

fixed typo

formatted file

added commit regarding self contained exe files

handled error loging for load zip file with offset

spelling tweak

updated conditional statement for magic check

udpated error message when load Zip file with offset is called

fix CI

Trying to fix CI

fix CI done

Added error message for loading self-contained exe with offset.

Updated documentation.

Fix indent

final fix indent

Updated documentation.

fix indents

Updated doc based on suggestion

Final fix

fixed format
2020-09-02 17:57:01 -05:00
Adam Brown
6584db1538 HTTPRequest now accepts gzip
Added request_raw to HttpRequest
Added decompress_dynamic to Compression class
Added decompress_dynamic to BytePoolArray

Merge doc fix

revert
2020-09-02 12:59:59 -07:00
George Marques
1a29e94c52
Add VariantInternal class
This is used to get a direct pointer for the data inside a Variant.
Added as another class instead of in Variant directly because this
should only be used in special cases, so use must be explicit.
2020-09-02 16:23:57 -03:00
Andrii Doroshenko (Xrayez)
0cc05c5a31 Register GDScript test tools as test commands to run via command-line 2020-09-02 01:43:26 +03:00
Rémi Verschelde
1e49a86884
Fix invalid CSV in SDL2 controller mappings DB
Follow-up to a61cae1469.
2020-09-01 20:53:51 +02:00
Rémi Verschelde
8ce02caf40
Merge pull request #41669 from strank/hardcoded-op-max
Fix hard-coded OP_MAX in variant_op.cpp
2020-09-01 19:51:23 +02:00
Rémi Verschelde
eac32f082a
Merge pull request #40868 from aaronfranke/color-html-rgba
Change Color HTML conversion from ARGB to RGBA
2020-09-01 10:44:36 +02:00
Rémi Verschelde
a61cae1469
Sync controller mappings DB with SDL2 community repo
Synced with gabomdq/SDL_GameControllerDB@d148c6ce49.
2020-09-01 10:23:16 +02:00
strank
447b140671 Fix hard-coded OP_MAX in variant_op.cpp 2020-09-01 03:17:42 -04:00
Aaron Franke
a6ff389a55
Simplify html_is_valid and allow it to work with 3 and 4 hex digits 2020-09-01 02:07:35 -04:00
Aaron Franke
ecd6a893b4
Change Color HTML conversion from ARGB to RGBA
Also add support for 3 and 4 digit values in C#. Now it actually matches the HTML/CSS spec.
2020-09-01 02:07:35 -04:00
Rémi Verschelde
37443bf04d
Merge pull request #41635 from jkb0o/master
Clear missed remaps on deinitialization
2020-08-31 15:29:17 +02:00
Yakov Borevich
604bd75438 [funexpected] clear missed remaps on deinitialization, fixes godotengine/godot#34221 2020-08-31 16:04:46 +03:00
Rémi Verschelde
a276e6fc36
Merge pull request #40955 from Calinou/test-add-expression
Add a test suite for Expression
2020-08-31 11:12:34 +02:00
Hugo Locurcio
d5ffa42cd2
Add a test suite for Expression
This also makes the first parameter of `Expression::execute()` optional
from C++. Previously, it was only optional in the scripting API.
2020-08-27 15:16:09 +02:00
simpu
ea2eaf8c27 Added debugger plugin support
Changes:
* EngineDebugger is exposed to gdscript. Game side of communication can be implemented through it.
* EditorDebuggerPlugin is added which handles the editor side of communication.
2020-08-26 11:24:51 +05:30
Rémi Verschelde
f13207254c
Revert "Check if global class file still exists before registering it"
And revert follow-up regression fix "Remap script path when registering class."

After the regression fix, the original issue is valid again so it's better
to go back to the previous state.

This reverts commits e264ae20d2 and
fceb64827e.
2020-08-25 13:02:03 +02:00
Rémi Verschelde
9d8f3496e8
Merge pull request #40443 from SkyLucilfer/PluralsSupport
Added plurals and context support to Translation
2020-08-25 12:11:56 +02:00
Hugo Locurcio
58ed3037c0
Improve the resource loading error message to mention the need to import
This is a common pitfall when setting up projects in a headless
environment.
2020-08-22 22:19:08 +02:00
Marcel Admiraal
5f092cf7bb Fix new black style check failures in various files. 2020-08-21 16:51:30 +01:00
Rémi Verschelde
989a4deb2f Fix warning using ERR_FAIL_INDEX on unsigned int
This method starting being used in 079ca220e1,
which now triggers this warning from GCC 10:
```
./core/error_macros.h:151:25: error: comparison of unsigned expression in '< 0' is always false [-Werror=type-limits]
```
2020-08-19 14:41:46 +02:00
SkyJJ
ce3461dc88 Update GDScriptTranslationParserPlugin to use GDSriptParser instead of RegEx. 2020-08-19 03:10:51 +02:00
SkyJJ
0ef758eaee Updated Translation architecture to have TranslationPO, did some commit fixes and updated class Reference. 2020-08-19 03:01:53 +02:00
SkyJJ
c0d837a2ea Added plurals and context support to Translation 2020-08-19 03:01:51 +02:00
Eric M
8f54e8bfb5 Fixed issues with adding custom project settings and added confirmation dialog when deleting settings. 2020-08-18 09:12:02 +10:00
Rémi Verschelde
d2d4c1c957 Update AUTHORS and DONORS list
New contributors added to AUTHORS:
@hinlopen, @naithar, @rrcore, @SkyLucilfer, @TwistedTwigleg

Thanks to all contributors and donors for making Godot possible!

---

Also changes to relevant code that parses the DONORS.md to match
the new tiers.
2020-08-14 00:06:51 +02:00
Juan Linietsky
079ca220e1 Added volumetric fog effect. 2020-08-13 11:28:45 -03:00
Rémi Verschelde
d3b5c0948c
Merge pull request #41025 from Faless/gdscript/fix_class_name
Remap script path when registering class.
2020-08-11 20:02:35 +02:00
Rémi Verschelde
a32b427f99
Merge pull request #41043 from ShivamMukherjee/fix-variant-call
Fix Vector3i and Vector2i AXIS_* constants
2020-08-10 19:30:39 +02:00
Stijn Hinlopen
5563722628 Rewrite ProjectSettings editor advanced options
- New layout: advanced options hidden by default, error labels added.
 - Disallow adding invalid new settings, or overwriting built-in settings.
2020-08-10 17:32:01 +02:00
Vivraan
8629cfdb08 Fix Vector3i and Vector2i AXIS_* constants 2020-08-05 14:15:28 +05:30
Fabio Alessandrelli
fceb64827e Remap script path when registering class.
Was causing `class_name`-defined scripts to not being loaded in exported
games due to the remap from `*.gd` to `*.gdc`/`*.gde`.
2020-08-04 15:46:40 +02:00
Andrea Catania
9fb587b702
Fixes issue with LocalVector remove function 2020-07-31 13:49:15 +02:00
Wilson E. Alvarez
e264ae20d2
Check if global class file still exists before registering it 2020-07-28 09:25:34 -04:00
Aaron Franke
56e2c6c704
Make all String float conversion methods be 64-bit 2020-07-27 18:38:53 -04:00
Andrii Doroshenko (Xrayez)
d86de6c98e SCons: Refactor running commands through builders
A new `env.Run` method is added which allows to control the verbosity
of builders output automatically depending on whether the "verbose"
option is set. It also allows to optionally run any SCons commands in a
subprocess using the existing `run_in_subprocess` method, unifying
the interface. `Action` objects wrap all builder functions to include a
short build message associated with any action.

Notably, this removes quite verbose output generated by `make_doc_header`
and `make_editor_icons_action` builders.
2020-07-28 00:09:21 +03:00
Rémi Verschelde
33d423e240
Merge pull request #39898 from Meriipu/master_gdscript
GDScript: Clarified/fixed inaccuracies in the built-in function docs.
2020-07-26 17:12:13 +02:00
Rémi Verschelde
b2096ba53e
Merge pull request #40670 from vnen/remove-multilevel-call
Remove multilevel calls
2020-07-26 17:09:41 +02:00
Sergey Minakov
7ee268c2c7 Core Variant: switch from 'real' to 'float' to allow building with NEED_LONG_INT 2020-07-25 21:55:10 +02:00
Sergey Minakov
8e9a07c401 Core Callable: fixed variant call caster
Use same call to VariantCaster in release build as used in VariantCasterAndValidate::call method
2020-07-25 21:55:08 +02:00
Meriipu
7f9bfee0ac GDScript: Clarified/fixed inaccuracies in the built-in function docs.
The input to smoothstep is not actually a weight, and the decscription
of smoothstep was pretty hard to understand and easy to misinterpret.

Clarified what it means to be approximately equal.

nearest_po2 does not do what the descriptions says it does. For one,
it returns the same power if the input is a power of 2. Second, it
returns 0 if the input is negative or 0, while the smallest possible
integral power of 2 actually is 1 (2^0 = 1). Due to the implementation
and how it is used in a lot of places, it does not seem wise to change
such a core function however, and I decided it is better to alter the
description of the built-in.

Added a few examples/clarifications/edge-cases.
2020-07-25 20:26:02 +02:00
Rémi Verschelde
6f292f906e
Merge pull request #38900 from bruvzg/docs_ignore_os_spec_def_vals
Docs: Ignore OS specific values (constants, project settings, properties)
2020-07-25 18:54:25 +02:00
Wilson E. Alvarez
1cd02ef600
Show errors on Object.call_deferred 2020-07-24 21:47:01 -04:00
George Marques
2b9d9bc364
Remove multilevel calls
In general they are more confusing to users because they expect
inheritance to fully override parent methods. This behavior can be
enabled by script writers using a simple super() call.
2020-07-24 14:13:58 -03:00
RevoluPowered
579342810f t Add unit testing to Godot using DocTest and added to GitHub Actions CI
Implements exit codes into the engine so tests can return their statuses.
Ideally we don't do this, and we use FIXUP logic to 'begin' and 'end' the engine execution for tests specifically.

Since realistically we're initialising the engine here we don't want to do that, since String should not require an engine startup to test a single header.

This lowers the complexity of running the unit tests and even for
physics should be possible to implement such a fix.
2020-07-24 13:05:33 +01:00
Rémi Verschelde
3811fb919e
Merge pull request #40598 from vnen/gdscript-2.0
GDScript 2.0 (again)
2020-07-24 01:04:57 +02:00
Adam Bates
8f84dfa91d issue-40396 - Added missing error strings to JSON parsing when array or object is never closed. 2020-07-22 15:06:57 -04:00
Rémi Verschelde
a5fb445121
Merge pull request #40450 from asmaloney/spelling
Fix spelling & grammar in comments, docs, and messages
2020-07-21 22:14:04 +02:00
Andy Maloney
4dda62f591 Fix spelling & grammar in comments, docs, and messages 2020-07-21 15:17:23 -04:00
Aaron Franke
83e324d670
Update core documentation to match recent C# changes
Also a few minor API changes like adding AABB.abs()

Co-authored-by: Rémi Verschelde <rverschelde@gmail.com>
2020-07-21 14:44:53 -04:00
George Marques
95c0909290
Add warning checks in GDScript analyzer
Reenable checking those when validating code.
2020-07-20 11:38:40 -03:00
Rémi Verschelde
818bfbc5b5
Merge pull request #40161 from vnen/classdb-info-methods
Add methods in ClassDB to get property/method/constant/enum info
2020-07-20 16:29:33 +02:00
Rémi Verschelde
0e1c235d95
Merge pull request #40468 from asmaloney/spelling-code
Fix spelling of a var, a struct, and some message output
2020-07-20 15:51:05 +02:00
Nathan Franke
210ccb3a75
Fix Directory make_dir and make_dir_recursive 2020-07-20 06:38:10 -05:00
Andy Maloney
8b949918b1 Fix spelling of a var, a struct, and message output 2020-07-17 12:02:06 -04:00
bruvzg
0181c3dde1
Docs: Ignore OS specific values (constants, project settings, properties). 2020-07-15 12:24:59 +03:00
Rémi Verschelde
9bdcfc4e87
Merge pull request #40374 from Faless/udp/server_abstraction
UDPServer uses single socket, abstract clients.
2020-07-14 16:31:19 +02:00
Fabio Alessandrelli
147bbe2155 UDPServer handles PacketPeerUDP-client association
UDPServer now uses a single socket which is shared with the
PacketPeerUDP it creates and has a new `poll` function to read incoming
packets on that socket and delivers them to the appropriate peer.
PacketPeerUDP created this way never reads from the socket, but are
allowed to write on it using sendto.

This is needed because Windows (unlike Linux/BSD) does not support
packet routing when multiple sockets are bound on the same address/port.
2020-07-14 14:10:18 +02:00
Rémi Verschelde
47cc202972 PO loader: Fix unclosed files and error messages
Trying to get `f->get_path()` after deleting `f` was not super clever :)

Fixes #40324.
2020-07-14 13:39:46 +02:00
Rémi Verschelde
ca5958d180
Merge pull request #38440 from Paulb23/syntax_highlighter_refactor
Syntax highlighter refactor
2020-07-14 09:49:02 +02:00
Aaron Franke
9986439352
Commit other files changed by file_format.sh 2020-07-13 14:14:11 -04:00
Andrii Doroshenko (Xrayez)
1f73469b50 Fix overriding compression related settings 2020-07-13 14:38:35 +03:00
Paulb23
bc4cee4458 Extract Syntax highlighting from TextEdit and add EditorSyntaxHighlighter
- Extacted all syntax highlighting code from text edit
- Removed enable syntax highlighting from text edit
- Added line_edited_from signal to text_edit
- Renamed get/set_syntax_highlighting to get/set_syntax_highlighter
- Added EditorSyntaxHighligher
2020-07-11 17:09:58 +01:00
Paulb23
be119c5c47 Add core types to ScriptLanguage 2020-07-11 15:19:02 +01:00
Marcel Admiraal
26fcf2b04c Add override keywords. 2020-07-10 13:56:54 +01:00
Rémi Verschelde
aeccd1e287
Merge pull request #40121 from Calinou/enable-file-logging
Enable file logging by default on desktops to help with troubleshooting
2020-07-10 11:02:57 +02:00
Nathan Franke
6952458538
Follow-Up Fix Directory Open 2020-07-10 02:56:37 -05:00
PouleyKetchoupp
b2d27214aa Keep debug & verbose options after loading project from project manager 2020-07-09 09:51:32 +02:00
Hugo Locurcio
20af28ec06
Enable file logging by default on desktops to help with troubleshooting
- Use the `.log` file extension (recognized on Windows out of the box)
  to better hint that generated files are logs. Some editors provide
  dedicated syntax highlighting for those files.
- Use an underscore to separate the basename from the date and
  the date from the time in log filenames. This makes the filename
  easier to read.
- Keep only 5 log files by default to decrease disk usage in case
  messages are spammed.
2020-07-08 18:57:25 +02:00
Aaron Franke
af80bcd2f8
Add sort and has methods to PackedArrays 2020-07-06 22:16:39 -04:00
Rémi Verschelde
141ce4d1f9
Merge pull request #40151 from nathanfranke/fix-directory-open-check
Fix Directory Open Check
2020-07-07 01:28:11 +02:00
George Marques
14e85b762e
Add methods in ClassDB to get property/method/constant/enum info
Without the need to iterate the whole list.
2020-07-06 19:27:05 -03:00
Nathan Franke
09aeb7706b
Fix Directory Open Check 2020-07-06 11:32:05 -05:00
George Marques
9654365547
Add a map of autoloads to ProjectSettings
So places that need to look into it can use the list instead of parsing
ProjectSettings details (like checking "*" in path for testing if it's
singleton).
2020-07-06 12:35:51 -03:00
Rémi Verschelde
7e38e8fdb0
Merge pull request #40138 from neikeq/error-macros-use-bool-literals
Fix 'modernize-use-bool-literals' clang-tidy warnings in error macros
2020-07-05 22:33:13 +02:00
Ignacio Etcheverry
ea632a5007 Fix 'modernize-use-bool-literals' clang-tidy warnings in error macros 2020-07-05 19:22:26 +02:00
Maganty Rushyendra
de46c92711 Fix natural sort comparison for strings with large numbers
Fix errors when comparing strings with large numbers (> INT64_MAX).
Comparisons now occur by comparing individual digits, instead of
converting to int64_t first.
2020-07-04 07:42:02 +08:00
Rémi Verschelde
c020eea184
Merge pull request #40092 from hinlopen/remove-find-last
Remove String::find_last (same as rfind)
2020-07-04 01:38:01 +02:00
Stijn Hinlopen
929b98d24b Remove String::find_last (same as rfind) 2020-07-03 15:26:22 +02:00
Rémi Verschelde
b5488def47 Image: Improve error messages for invalid creation size 2020-07-03 12:57:23 +02:00
Rémi Verschelde
fd5b6e1db2
Merge pull request #40009 from mrushyendra/ustring_overflow_master
Fix overflow and underflow checks for string conversion to int
2020-07-02 16:32:27 +02:00
Rémi Verschelde
c069f5f5ca
Merge pull request #34028 from nekomatata/list-erase-not-found
Removed errors when List::erase() can't find the value
2020-07-02 13:32:57 +02:00
Maganty Rushyendra
687b127fc5 Fix overflow and underflow checks for string conversion to int
Current error checks for to_int and to_int64 do not issue overflow error
messages for INT64_MAX + 1, INT64_MAX + 2, and other numbers close to the
integer limits. Likewise, error checks for hex_to_int, hex_to_int64 and
bin_to_int64 issue false positive error messages for INT64_MIN or INT32_MIN.
This commit fixes these error checks.
2020-07-02 09:58:23 +08:00
Rémi Verschelde
6cf416dafc
Merge pull request #33061 from madmiraal/nullpointerdereference
Call CRASH_COND_MSG if key not found in HashMap get(key) functions.
2020-07-01 18:20:23 +02:00
Rémi Verschelde
a8a2769bb6
Merge pull request #38713 from aaronfranke/string-64bit
Make all String integer conversion methods be 64-bit
2020-07-01 16:01:05 +02:00
Marcel Admiraal
1b05f449f0 Call CRASH_COND_MSG if key not found in HashMap get function. 2020-07-01 10:50:13 +01:00
PouleyKetchoupp
45445e1b31 Removed errors when List::erase() can't find the value
This change makes the behavior consistent when the value
is not found between erasing from an empty list
(no error, just returning false) and erasing from a non-empty list
(previously displaying triggering an error and returning false).

Error message previously triggered:
ERROR: erase: Condition ' !p_I ' is true. returned: false
   At: ./core/list.h:157.
2020-07-01 10:17:27 +02:00
Fabio Alessandrelli
1b6e3458b2 Move frame delaying functions from Main to OS.
Will allow specific platforms to override it and avoid blocking on the
main/GUI thread.
2020-06-30 19:39:09 +02:00
Rémi Verschelde
5f2295f2df
Merge pull request #39986 from reduz/app-inout-notification
Add a separate application focus/in notification
2020-06-30 16:58:46 +02:00
Rémi Verschelde
f3c5f12e39
Merge pull request #38920 from paulherman/tga
Expose loading TGA images in Image.
2020-06-30 16:40:28 +02:00
Juan Linietsky
438c380458 Add a separate application focus/in notification out from Window focus notification. 2020-06-30 10:40:06 -03:00
simpu
bfadb882b1 Added Custom Performance Monitor and feature to read intermediate values of Monitor
Custom monitors can be added/removed/checked using `Performance.add_custom_monitor`/`Performance.remove_custom_monitor`/`Performance.has_custom_monitor`

The value can be viewed in the `Monitor` tab of Debugger.

Text before `/` is used to categorize the custom monitor.

`EditorPerformanceProfiler` class is created to separate logic from `ScriptEditorDebugger`

User can click on the graph of monitors to read the value at that point.

Graph includes intermediate base lines.
2020-06-29 17:20:29 +05:30
Maganty Rushyendra
aae5f246ff Fix weekday calculation in get_datetime_from_unix_time for negative times
Fix calculation for negative times to ensure Sundays are wrapped around to '0'
instead of '7', making it consistent with the output for positive times.
2020-06-29 14:27:10 +08:00
Juan Linietsky
201d606b3d Addition of SDFGI for open world global illumination
Move GI to a deferred pass
2020-06-26 11:06:48 -03:00
Rémi Verschelde
23f7f86914 Style: Fix copyright headers 2020-06-25 16:33:44 +02:00