Ensures that we have a configuration that is currently usable.
Some changes for the `3.2` branch as it's unmaintained:
- No cache
- No artifacts upload
- Uses clang-format 10
- No JavaScript linting
InterpolatedCamera has already been removed from the `master` branch.
This adds a deprecation notice to inform people about the upcoming removal
in Godot 4.0.
Its functionality could be replicated in a GDScript add-on with relative
ease.
When generating certificates with
`Crypto.generate_self_signed_certificate` we generate the PEM in a
buffer via `mbedtls_x509write_crt_pem`.
Since version 2.16.8, mbedtls adds spurious data at the end of the
buffer due to internal optimizations, this breaks our logic when we try
to immediately parse it and return a proper `X509Certificate` object.
This commit updates the code to find the actual PEM length to parse
using `strlen`, takes extra caution always adding the terminator to the
buffer, and slightly improve error messages.
(cherry picked from commit 60687ce778)
When NormalizePath was called with an absolute
path (with drive letter) on Windows, it would
prepend a file path separator to the path, e.g.:
'\C:\Program Files\'.
Apparently this was still accepted as a valid
path by DotNetGlob and it stopped working when
we switched to MSBuildGlob.
(cherry picked from commit 1db0395950)
Fixes#41006 (regression from #39164).
The original alignment fix was limited to PROCESS_DRAW mode, which
caused some discrepancies with PROCESS_POINTER mode.
Now only PROCESS_CACHE is excluded with a condition a few lines above.
(cherry picked from commit b783fa1416)
The previous max worked OK for audio data, but stb_vorbis recently gained support
for Vorbis comments, which can embed up to 2^32-1 bytes of data (e.g. cover art
encoded as base64).
We use 2^30 as max which should be sufficient for most files.
Fixes#41913.
(cherry picked from commit d16f5a57c1)
At least on Windows there seems to be issues if
the solution has no BOM and contains a project
with cyrillic chars.
(cherry picked from commit 1c74fa4242)
LineEdit should not return early when processing KEY_ENTER, so it can
consume the event properly.
Regression introduced by mistake while fixing enter events for Android
(PR #40487 - c0b394572f)
(cherry picked from commit 5c63dec36e)
MSBuild Item returns empty strings if an attribute isn't set (which
caused an IndexOutOfRangeException in NormalizePath).
We were treating Excludes incorrectly, Remove directives provide the
intended behaviour in the auto-including csproj format.
First, compile the engine normally with:
```
scons custom_modules="path/to/your/modules" vsproj=yes
```
Then run the Visual Studio project. You can now rebuild the engine if
you need to make changes to custom modules directly within IDE.
(cherry picked from commit 6eb4b89eef)
This error was normally being printed when
trying to open the project assembly while
the project was not yet built.
The error should not be printed. It's the job
of this method's caller to decide whether to
print an error or not if loading failed.
Previously VS::INSTANCE_NONE was returned for Lightmap data, this caused `visual_server_scene.cpp` to assert in `instance_set_use_lightmap()`
Now `dummy_rasterizer.h` returns `VS::INSTANCE_LIGHTMAP_CAPTURE` for lightmap capture data thus satisfying `visual_server_scene`
Updated set_max_length() function to actually pull a substring of the current text so it's not all thrown away when the new max length is shorter than the current length.
(cherry picked from commit 71febfd6e2)
This also improves the HTTPClient class documentation to be easier
to read and more informative.
This closes#40564.
(cherry picked from commit 2f577facc9)
The constant is already exposed in GDScript, but not in C++.
This information is useful for implementing animated texture
resource importers via modules.
(cherry picked from commit 528056a3c5)
They've been moved to the @godotengine organization's .github
repository, which works as a fallback for all repositories in the
organization. This way, the Sponsor button is automatically displayed
on all repositories.
This closes#40972.
(cherry picked from commit f516dc1198)
Fixes#34509 where the theme editor would push away the inspector
if something like "hseperation" is really high.
Now `set_enable_h_scroll` is true which fixes this.
(cherry picked from commit d602be077d)
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.
(cherry picked from commit f13207254c)
Changed CPU velocity calculation for EMISSION_SHAPE_DIRECTED_POINTS
to follow the same logic as in the GPU version:
mat2 rotm;
rotm[0] = texelFetch(emission_texture_normal, emission_tex_ofs, 0).xy;
rotm[1] = rotm[0].yx * vec2(1.0, -1.0);
VELOCITY.xy = rotm * VELOCITY.xy;
Now both CPUParticles2D & CPUParticles3D (z disabled) show the same results
as their GPU counterparts and take the initial velocity settings into account.
(cherry picked from commit 1c231cacb3)
The editor wasn't clearing the debugger agent
settings properly after a processing a play
request from an IDE. This caused consequent play
attempts to fail if not launched from the IDE,
as the game would still attempt and fail to
connect to the debugger.
The concrete cause: Forgetting to clear the
`GODOT_MONO_DEBUGGER_AGENT` environment variable.
(cherry picked from commit 6e7da72648)
This is a cherry-pick of
ced77b1e9b
with several 3.2 specific alterations.
There are a lot of build issues coming from
old style projects. At this point fixing every
single one of those would require adding patch
after patch to the project file, which is a
considerable amount work and makes the csproj
even more bloated than it already is.
As such I decided this effort would be better
spent back-porting the Sdk style support that's
already available in 4.0-dev to the 3.2 branch.
This will prevent many issues, but it will also
introduce other benefits, among them:
- While target framework stays as .NET Framework
v4.7.2, it can be changed to .NET Standard 2.0
or greater if desired.
- It makes it much easier to add future patches.
They are added to Godot.NET.Sdk and the only
change required in Godot code is to update the
Sdk version to use.
- Default Godot define constants are also
backported, which fixes IDE issues with the
preprocessor.
There are a few differences in the changes
applied during patching of the csproj compared
to 4.0 with the purpose of preventing breaking
builds:
- 'TargetFramework' stays net472 both for new
projects and when importing old ones. It can
be manually changed to netstandard 2.0+ if
desired though.
The following features are enabled by default for
new projects. Enabling them in imported projects
may result in errors that must be fixed manually:
- 'EnableDefaultCompileItems' is disabled as it
can result in undesired C# source files being
included. Existing include items are kept.
As long as 'EnableDefaultCompileItems' remains
disabled, Godot will continue taking care of
adding and removing C# files to the csproj.
- 'GenerateAssemblyInfo' is disabled as it
guarantees a build error because of conflicts
between the existing 'AssemblyInfo.cs' and the
auto-generated one.
- 'Deterministic' is disabled because it doesn't
like wildcards in the assembly version (1.0.*)
that was in the old 'AssemblyInfo.cs'.
Of importance:
This is a breaking change. A great effort was
put in avoiding build errors after upgrading a
project, but there may still be exceptions.
This also breaks forward compatibility. Projects
opened with Godot 3.2.3 won't work out of the box
with older Godot versions. This was already the
case with changes introduced in 3.2.2.
Albeit C# support in 3.2.x was still labeled as
alpha, we've been trying to treat it as stable
for some time. Still the amount of problems this
change solves justifies it, but no more changes
that break project compatibility are to be
introduced from now on (at least for 3.x).
This upgrade is needed in order to support
reading and editing project files that use Sdks
as well as other new features. A common example
in 3.2 is having to specify a PackageReference
version with a child element rather than the
attribute. This is no longer the case now.
Partial cherry-pick of f3bcd5f8dd
Most of the other changes from that commit were already partially
cherry-picked in 3928fe200f.
Not sure if we should check revision too, but this is good enough for what we want.
This will be needed to load the correct Microsoft.Build when we switch to the nuget version.
Manual cherry-pick of af4acb5b11 (relevant parts)
By default 'add_ios_framework' would not embed a framework to save previous behavior.
New 'add_ios_embedded_framework' would embed framework on export.
In rare circumstances an item would issue multiple transform commands before a (non rect) draw command. The command syncronization would incorrectly start from first transform, instead of the current transform in these circumstances, which could have the result of missing drawing some commands from the end of the batch.
This had been shown in the wild occuring in debug collision polys. It was a benign error (sometimes visual elements would be lost), but did not cause any serious problems.
This PR fixes this synchronization error.
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.
(cherry picked from commit d2d4c1c957)
Description;
> Applies morphological dilation to the bitmap. The first argument is the dilation amount, Rect2 is the area where the dilation will be applied.
(cherry picked from commit 1c61c8ab55)
Ensures that the editor preview when placing a tile on a TileMap takes
into account the transformation of the TileMap. Previously, only the
origin of the Tile was transformed, but not its orientation or
scaling.
(cherry picked from commit cf04aabef1)
Editor now changes a color in the inspector only when it is different
from the current one.
Solves fake unsaved changes in editor after using the ColorPicker.
Resolves: #40879
(cherry picked from commit f3626364fc)
Previously `joypad_count` was used as the index into the d_joypads array when initializing a new gamepad.
This caused the accidental override of an already connected device when a gamepad with a lower id was disconnected and connected again.
fixes#17566
(cherry picked from commit 802a0316c5)
- Use the SVG version of the logo.
- Mention console support in the first paragraph.
- Point contributors to the `#godotengine-devel` IRC channel.
- Improve formatting for better readability.
- Add more links when needed.
- Fix warnings reported by markdownlint.
(cherry picked from commit b0713e9e6c)
Was causing `class_name`-defined scripts to not being loaded in exported
games due to the remap from `*.gd` to `*.gdc`/`*.gde`.
(cherry picked from commit fceb64827e)
Compiler is usually in the best position to decide whether to inline functions. Great care must be taken using FORCE_INLINE because it can have unforeseen consequences with recursion, loops and bloat to the executable.
Here some FORCE_INLINES are removed in order to allow the compiler to make best choice and remove a compilation warning where unable to inline during a recursive function.
Fixes#41226
Adding support for disabling virtual keyboard on mobile platforms, in
order to make it consistent with LineEdit.
It allows implementing a custom virtual keyboard.
See: https://github.com/godotengine/godot/pull/41139
It's too hard to get compatibility between GNU and BSD sed,
so let's just use perl oneliners.
And improve it to also remove trailing tabs, not just spaces.
(cherry picked from commit c71e189efd)
This removes:
```
ERROR: get_breakpoints: Condition ' base.begins_with("local://")
```
while running a project with blank scripts caused by deleting
or moving, or built-in scripts which are not yet saved within a scene
on running a project.
(cherry picked from commit 1c70a33d9c)
Add any leftover fractional pixels to an error accumulator. When the
accumulator is greater or equal to one, add one pixel to the current
Node's size and subtract one from the accumulator.
Closes#36522
(cherry picked from commit 04ea6ec88d)
This gesture recognizer will prevent GLView from processing unwanted gestures.
Emulates UIScrollView behavior
Fires delayed touches on significant movement
1. Disable virtual keyboard focus adjustment on Android
The default adjustment setting was causing the view to pan down in order
to adjust the focus on the text content.
We don't need any focus adjustment since we're using a fixed size window
for our application.
Documentation:
https://developer.android.com/reference/android/view/WindowManager.LayoutParams#SOFT_INPUT_ADJUST_NOTHING
2. Fix virtual keyboard height regression
Disabling virtual keyboard focus adjustement caused get_keyboard_height
to always return 0 because it was calculated when the view is resized.
In order to fix it, a PopupWindow is now created on top of the main view
and is set for focus adjustments so the keyboard size can be calculated
based on this popup without affecting the main view.
Removes AppVeyor and all Travis jobs but the iOS one, which hasn't been ported
to GitHub Actions yet (should be done soon).
Backports new style scripts from `master` branch too to do the same checks.
Methods were being called with InputEventMouseMotion instead of InputEventPanGesture, and they were null.
Fixesgodotengine/godot#16181 on the master branch
(cherry picked from commit 394a7826be)
Its last use was removed in Godot 3.0, so it no longer makes sense to define.
Also removed `D3D_DEBUG_INFO` for Windows as it's likely a left over from a
long time ago pre-opensourcing when Godot had some form of Direct3D 9 support?
(cherry picked from commit dcf902df85)
It took me a bit to figure this out, as I was initially doing something
more complicated like this before I realized I just had to pass
get_mesh_arrays directly to add_surface_from_arrays.
```
var arr_mesh = ArrayMesh.new()
var arrays = []
arrays.resize(ArrayMesh.ARRAY_MAX)
arrays[ArrayMesh.ARRAY_VERTEX] = c.get_mesh_arrays()
arr_mesh.add_surface_from_arrays(Mesh.PRIMITIVE_TRIANGLES, arrays)
```
(cherry picked from commit 933bf96523)
A static function is added to EditorNode which allows for filename
disambiguation given a list of filenames and the corresponding list of
absolute paths for those files. This function is then used to
disambiguate scene and script tabs in the editor.
(cherry picked from commit 4285211f40)
This means clicking on an EditorSpinSlider to edit its value will
no longer cause the number to be visually offset while it's
being edited.
(cherry picked from commit cc615fee5f)
Depending on the device implementation, editor actions could be
received with different action ids or not at all for multi-line.
Added a parameter to virtual keyboards to properly handle single-line
and multi-line cases in all situations.
Single-line:
Input type set to text without multiline to make sure actions are sent.
IME options are set to DONE action to force action id consistency.
Multi-line:
Input type set to text and multiline to make sure enter triggers new lines.
Actions are disabled by the multiline flag, so '\n' characters are
handled in text changed callbacks.
These classes have dozens of open bugs and missing features
which may not be fixed anytime soon.
It's probably better to document it upfront at this point.
(cherry picked from commit 0493e7c106)
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.
(cherry picked from commit 147bbe2155)
My initial attempt changed this in the gdscript code, which resulted in
a duplicate warning name in the builtin editor. We should just append
the warning name in the LSP instead.
This uses parens to match what is shown in the builtin editor.
(cherry picked from commit 8dcc39ec91)
Due to `user://` returning the current working directory when no
project is open, this caused logs to be written to `$HOME`
most of the time.
This closes#40305.
(cherry picked from commit b89dc6ae00)
On platforms that don't report support for GL_REPEAT for non power of two textures, the FORCE_REPEAT conditional is used instead. However for rect batches, the conditional was being set AFTER binding the shader, which meant it wasn't being activated.
This PR simply shifts setting the conditional to before the shader bind.
This was based on quarmin's initial configuration, we had compile issues with AppVeyor being super slow and GitHub actions will take less time and also manage a full rebuild in 30 minutes.
This adds cache handling and will work with MSVC and scons 4.0, it will build for every PR submitted to the Godot Engine, and also for the branches specified. I have tested the caching and it seems to be working.
I left the 'publish artefacts' disabled until we can request more storage from Microsoft, 5 GB is far to low for us and we would eat this limit very fast. (it is tested and works fine)
Co-authored-by: Rafał Mikrut <mikrutrafal54@gmail.com>
(cherry picked from commit 04592af5a4)
Emit `node_selected` and `node_deselected` signals where appropriate
when selecting or unselecting multiple GraphEdit nodes at once.
(cherry picked from commit c1d5c7727c)
- 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.
(cherry picked from commit 20af28ec06)
Add optional parameter to specify whether applying rotation to the
PathFollow3D's Transform is necessary, preventing erroneous updates.
(cherry picked from commit be3a1769fe)
This reverts commit 920639511d.
The changes are good, this revert is only done for release management reasons
as we want this feature to get more testing before making it in a stable build,
but a 3.2.3 release is imminent to handle some regressions in 3.2.2.
This will be re-committed in a 3.2-based feature branch, and we'll merge it
again once we're confident about it (probably for 3.2.4).
1. Removed errors in mesh_surface_get_array as it's supported now
2. More accurate errors in mesh_surface_get_blend_shapes
(cherry picked from commit e19a3df98f)
Occasionally you want to ignore a warning with a `warning-ignore`
comment, and you have to go into the settings to look up what the
actual name of the warning is. This patch appends the warning name to
the end of the warning so you know what string to use to ignore it,
similar to other linters like pylint.
For example
```
"The signal 'blah' is declared but never emitted.";
```
is now
```
"The signal 'blah' is declared but never emitted. (UNUSED_SIGNAL)";
```
(cherry picked from commit de3ad3b30e)
The Online Tutorials section of InputMap in the editor's built-in
documentation viewer contains this link:
docs.godotengine.org/en/latest/tutorials/inputs/inputevent.html#inputmap
The macOS implementation for opening a link percent-encodes it before
sending it to the browser, resulting in a 404. This is to fix#13422
where filenames with special characters could not be opened in Finder.
However, this breaks URLS so I added a check to see if the resource
scheme is file:// and if so, only then is it escaped. This allows other
schemes like `http`, `ftp`, and `mailto` to be used.
(cherry picked from commit b8e6ff9a7f)
`ConvexPolygonShape2D` and `ConcavePolygonShape2D` are only meant to be
used directly in code and not in the editor for physics-based use cases
specifically.
Developers are advised to use `CollisionPolygon2D` instead, which does
generate those shapes under the hood, handling polygon convexivity,
proper orientation etc.
(cherry picked from commit dc446203be)
Fix to ensure that undo/redo works when painting bones in the Polygon2D
UV editor. Previously, bone painting would continue silently in the
background, because a mouse click signalling the end of an edit would
not be appropriately dealt with.
(cherry picked from commit 6e60aa3876)
Current error checks for to_int and to_int64 do not issue overflow error
messages for INT64_MAX + 1, INT64_MAX + 2, and others close to the
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.
New contributors added to AUTHORS:
@mrushyendra, @mbrlabs, @MCrafterzz
Thanks to all contributors and donors for making Godot possible!
(cherry picked from commit 49feec7dc0)
fix crash when pass null in print array in GD.print 2
fix crash when pass null in print array in GD.print 3
fix space
(cherry picked from commit d2461bad63)
This fixes issue #39844, where the confirmation dialog when a user
attempts to close an unsaved script did not actually save it even after
clicking "Save."
(cherry picked from commit d2a5b92e9b)
This reverts commit 481dbceed0.
Current fuzzy search implementation results in too many
non-useful results.
Could be re-added after result sort/filter/score functionality
is added. See #30072 for example existing implementation.
Fixes: #39128
Reverts: #32043
Fixed format style conflicts:
editor/editor_help_search.cpp
(cherry picked from commit 55d706c352)
In set_stream() we write to 'playback' while accessing the same object
in _mix_audio() in audio thread. Protect the 'write' part in
set_stream() to avoid possible crash in _mix_audio() function.
(cherry picked from commit e435d57758)
The method is used to either inflate or deflate a polygon.
For translating/transforming a polygon, use `Transform2D.xform`.
(cherry picked from commit 19b72da35d)
Fixes a small memory leak reported by lsan:
```
Direct leak of 73 byte(s) in 1 object(s) allocated from:
#0 0x7f29825f3e70 in malloc (/lib64/liblsan.so.0+0xee70)
#1 0x7f29824a5729 in XGetWindowProperty (/lib64/libX11.so.6+0x29729)
```
Ensures that closure of Polygon2D in the editor takes into account
Grid Snap if enabled. Does this by comparing the polygon start with
grid snap applied to mouse click location. Note: transformation is
applied in order to deal with different editor zoom levels.
(cherry picked from commit b8d55b244a)
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.
(cherry picked from commit aae5f246ff)
This release includes many bugfixes, UX enhancements but also a number
of new features such as C# support on iOS, 2D batching for GLES2, a new
plugin system for Android, and DTLS support!
Thanks to all contributors! <3
The existing theme editor icon could be unintentionally set for any
global class with matching name (`Group` icon, `Group` class_name etc),
which would only show up in the "Create Dialog" context, but not the
scene tree dock.
This change prevents this behavior, and ensures that the icon can be
actually overidden by explicit icon path in `class_name`, if there's any
custom icon to begin with.
The correct built-in type's icon is fetched for child classes if there
are no custom icons detected throughout base classes as well, so it
isn't left empty for those cases.
(cherry picked from commit c177308f80)
For some reason `mono_unhandled_exception` is not
printing the exception as its comment claims.
Use `mono_print_unhandled_exception` instead.
(cherry picked from commit f87ae395ee)
The Low Processor Usage Mode Sleep Usec setting is now used as a
FPS limiter rather than a constant sleep duration.
This will increase CPU/GPU usage slightly due to the higher
effective FPS, but the increase in overall smoothness is worth it.
If both Force Fps and Low Processor Usage Mode settings are enabled
in the project settings, only the setting that causes the highest
sleep duration will be retained.
This closes#11030.
(cherry picked from commit 1c28b269d8)
`get_global_class_name` for `GDScriptLanguage` is slow because
it forces to parse an entire script each time. This patch ensures
that the icon is actually fetched from the EditorData where they
are loaded beforehand.
This change also makes the behavior consistent with the existing
`get_object_icon` method in EditorNode.
(cherry picked from commit 4a86e2bb76)
Modifies polygon auto-completion based on UV editor scale, in order
to enable finer grained control for the user. Enables selection of
points closer than the current threshold of 8 pixels.
(cherry picked from commit 69d0d89214)
Sometimes Visual Studio documents have the root path all in upper case.
Since Godot doesn't support loading resource files with a case insensitive path,
this makes script resource loading to fail when the Godot editor gets code
completion requests from Visual Studio.
This fix allows the resource path part of the path to be case insensitive. It
still doesn't support cases where the rest of the path is also case insensitive.
For that we would need a proper API for comparing paths. However, this fix
should be enough for our current cases.
For textures that were imported as wrapping, the legacy renderer relied on GL repeat state being set as a once off during load, and didn't alter the GL wrapping state at runtime.
Batching was setting wrapping according to the CANVAS_RECT_TILE flag on rects, however this reset GL wrapping to clamp after use, which was conflicting with later drawcalls that relied on the default wrapping being preserved.
In this PR we only set the wrapping in GL if the texture has not been imported with wrapping. This duplicates the logic in the legacy renderer and solves the state bug.
This reverts commit 7f61710183.
See #38868, in its current implementation a small skew value might end up
serialized to scene files due to floating point precision errors, which is
detrimental to VCS.
This can be cherry-picked anew once a fix for #38868 has been found.
The Haiku port now resides at:
https://github.com/godotengine/godot-haiku-platform
While we're happy to support as many Free and Open Source platforms as we can,
we need to put the main focus on the platforms that we can reasonably maintain,
and for Haiku we have been lacking maintainers ever since the port was first
merged in 2015.
The Haiku code has not been compiling and much less working at least since the
release of Godot 3.0, and while some attempts have been made at fixing things,
it's still not functional today in the `3.2` branch (and much less in `master`,
understandably).
Having it in an external repository should hopefully enable Haiku contributors
to fix issues in their own time, and possibly tag versions compatible with
past Godot releases once they are ready.
(cherry picked from commit efcc508ee5)
Ensures that behavior when export_presets.cfg file is edited manually
while editor is running remains identical to before commit 44094b0.
(cherry picked from commit 4a7c19e719)
The missing file type in file attributes was causing the file to lose
executable permissions when unzipped with some softwares.
(cherry picked from commit 4501771fd8)
Using the operator += in a shader is classified as an 'assign', and so is classified as a write rather than a read. This means that we need to prevent vertex baking on either a write or read (i.e. on usage), rather than just on reads.
Make command-backspace in line edit work like other macOS applications.
If there is a selection, command-backspace deletes the selection.
If there isn't a selection, command-backspace deletes from the cursor to the beginning of the line edit.
This addresses part of godotengine/godot#23548
Ensures no error is issued when attempting to preview a resource that
may be scaled down to <1 pixel when resizing to fit the thumbnail.
(cherry picked from commit c7a8dc7bb9)
Occurred when selecting polygon collision mode, then drawing a single point, then selecting rectangle mode, and finally trying to select a rectangle.
(cherry picked from commit 7850d0316f)
Ensures that when the `Selection Only` option is selected, the Replace
tool replaces occurrences of the search phrase only within the selected
region, and in order of occurrence.
(cherry picked from commit 2be3a33cc3)
MSDN says:
> When you write .dds files, you should set the DDSD_CAPS and
> DDSD_PIXELFORMAT flags, and for mipmapped textures you should also
> set the DDSD_MIPMAPCOUNT flag. However, when you read a .dds file,
> you should not rely on the DDSD_CAPS, DDSD_PIXELFORMAT, and
> DDSD_MIPMAPCOUNT flags being set because some writers of such a file
> might not set these flags.
https://docs.microsoft.com/en-us/windows/win32/direct3ddds/dds-header
¯\_(ツ)_/¯
Fixes#39516.
(cherry picked from commit 0f21249a2d)
Now that the 3D editor grid is infinite and adjusts its step automatically,
this helps people get a better sense of scale when moving around in the
3D viewport.
This also fixes the indicator bar drawing on hiDPI displays.
(cherry picked from commit eaae50fe4a)
- Fixed floating point issue on the old one.
- Fixed the equation on the get_euler_yxz function.
- Added unit tests.
This work has been kindly sponsored by IMVU.
(cherry picked from commit 2331300989)
Since projects started from the editor or exported in debug mode
run slower than those exported in release mode, this should be
clearly presented to the user.
This partially addresses #20219.
(cherry picked from commit a9c60007a9)
- Refactored the Engine code, splitted across files.
- Use MODULARIZE option to build emscripten code into it's own closure.
- Optional closure compiler run for JS and generated code.
- Enable lto support (saves ~2MiB in release).
- Can now build with tools=yes (not much to see yet).
- Dropped some deprecated code for older toolchains.
- Add onExit, and onExecute JS function.
- Add files drag and drop support.
- Add support for low precessor usage mode (via offscreen render, swap).
Reverts `latest_client_id` back to 0, as I misunderstood how the client
IDs are assigned and, without further testing and debugging, I can't
say if this was a bug or a valid default value.
Similarly, a `latest_client_id` of -1 is no longer raising an error.
Fixes#39548.
(cherry picked from commit 786f4ada35)
The Image.create_from_data doc describes the "use_mipmaps" argument as a
way to generate mipmaps, but this method only allocates and loads data.
This can cause confusion, where this function reads more or less data
than expected. Update the doc to be more specific that create_from_data
is loading the mipmaps from the raw data.
(cherry picked from commit 09b324b5b6)
- The repaint code was moved outside of set_current_tab() and to a "_repaint()" private function
- _on_theme_changed() will now only call _repaint() and update()
This means _on_theme_changed() will do only what it needs (repainting the TabContainer to account for the new theme)
fixes#39498
(cherry picked from commit 5123006f06)
Opaque objects are rendered using the depth buffer, so the end result
appears sorted, but the opaque objects themselves are not sorted.
(cherry picked from commit 608bc8f3dc)
Reduce repeated iteration through the full text
when counting the number of occurrences of whole
words while searching a file in the editor.
(cherry picked from commit 2433287871)
Make the first iteration as soon as the canvas is setup, avoiding a
black screen before the next animation frame is requested.
Also create OS and do setup before syncing FS to avoid crash when IDBFS
access is denied.
The old logic was incorrect, the first item with lights would prevent joining the next item in case it didn't have lights. Now the check is deferred so that items without lights check to see if the previous item had lights, and if so they prevent a join.
Build PCRE2 thirdparty library with unicode support. RegEx objects
in Godot can now be used to recognize unicode strings.
(cherry picked from commit 9f10f6779c)
Ensure that presets are updated with the latest files when
starting up or opening the Project Export dialog. Fixes the
error where Godot would attempt to export deleted files that
were previously selected.
(cherry picked from commit 44094b082d)
Godot currently supports zero padding for integers, octals and
hexadecimals when using format strings, but not for floats.
This commit adds support for zero padding for floats, thus ensuring
consistent behavior for all types, and making Godot's format specifiers'
behavior closer to c's `printf()`.
Before: `print("<%07.2f>" % -0.2345)` prints `< -0.23>`.
Now: `print("<%07.2f>" % -0.2345)` prints `<-000.23>`.
`print("<%7.2f>" % -0.2345)` prints `< -0.23>`.
(cherry picked from commit b7d835d9ca)
The previous code for OS_Windows::get_ticks_usec() multiplied the tick count by 1000000 before dividing by ticks_per_second. The ticks is counted in a 64 bit integer and is susceptible to overflow when a machine has been running for a long period of time (days) with a high frequency timer.
This PR separates the overall calculation into one for seconds and one for the remainder, removing the possibility of overflow due to the multiplier.
(cherry picked from commit db9fa88160)
Change error checking in `duplicate_signals()` to check for path to
`p_original`, thus adhering to the method used in `duplicate`, instead
of checking for ownership.
Note:
Casting to the C++ classes and calling the methods there would work as well,
but would require including he header files for the specific object types handled
here, which wouldn't be OK either.
A new `methods.dump(env)` is added to dump the construction environment
used by SCons to build Godot to a `.scons_env.json`. The file can be used
for debugging purposes and any external tool.
(cherry picked from commit 42bee75e86)
Some required changes are made:
- locally imported SCons-specific packages within the method;
- `global` variables converted to `nonlocal` (used in nested functions).
(cherry picked from commit d753a7630a)
Configured for a max line length of 120 characters.
psf/black is very opinionated and purposely doesn't leave much room for
configuration. The output is mostly OK so that should be fine for us,
but some things worth noting:
- Manually wrapped strings will be reflowed, so by using a line length
of 120 for the sake of preserving readability for our long command
calls, it also means that some manually wrapped strings are back on
the same line and should be manually merged again.
- Code generators using string concatenation extensively look awful,
since black puts each operand on a single line. We need to refactor
these generators to use more pythonic string formatting, for which
many options are available (`%`, `format` or f-strings).
- CI checks and a pre-commit hook will be added to ensure that future
buildsystem changes are well-formatted.
(cherry picked from commit cd4e46ee65)
- Improve the bug reporting guidelines for readability.
- Make some guidelines more strictly applied in the interest of
bug report quality.
- Mention that feature proposals should now be opened on the
Godot Proposals repository.
- Update the Git commit message guide to be easier to follow.
- Fix warnings reported by markdownlint.
(cherry picked from commit 7b5c502ba5)
The crash happens further down when setting an invalid owner in
`Node::_set_owner_nocheck` but I couldn't figure out how to fix it.
But here the proper fix is to catch the invalid scene file early on
and fail loading it.
Part of #17372.
(cherry picked from commit c080ec5da2)
Each time `r_err_str` is set, we should return a parse error.
Removed redundant `return OK;` which were already handled after the big
`if`/`else if`/`else` for `TK_IDENTIFIER`.
Part of #17372.
(cherry picked from commit e7ebda975a)
`latest_client_id` now defaults to `-1` (invalid ID) instead of `0`.
Also fix typo in notification `gdscrip_client/changeWorkspace`,
and fix argument names in method binds.
Fixes#39375.
(cherry picked from commit e34f33711b)
Avoid load_scene for built-in resources to make sure we don't
open a scene tab and prompt for model file editing.
Load scene as regular resource instead and store the reference to keep
the dependency until the remote inspector cache is cleared.
(cherry picked from commit 01802074a0)
This also changes how checkboxes are selected, which makes it possible
to click in the small area between two checkboxes and
still toggle a value successfully (which is arguably less frustrating).
(cherry picked from commit bbc435624f)
As the masked light list takes no account of layer_min and layer_max, the canvas_layed_id is passed to the _light_mask_canvas_items function where it can be used to reject lights outside the layer range.
Scaling tilemaps can cause border artifacts around the edges of tiles. This has been traced to precision issues in the GPU. This PR adds an adjustment to allow a minor contraction of the UVs of rects in order to compensate for the incorrect classification of texels across the UV border.
The value of this, does not include the layout.
The code has extra logic to map the unicode value to our keylist,
supporting ASCII and Latin-1.
(cherry picked from commit 0a35b97b62
with help of https://github.com/Faless/godot/tree/js/keyCode)
ice_candidate_created should be emitted after set_local_description no
matter the type of the description (assuming no error is returned of
course).
(cherry picked from commit 39bcbf5690)
- properly visit power of 2 factors (50%, 100%, 200%...)
- index based zoom values to prevent floating point issues
- Fix 2d editor not able to reach min and max zoom values
(cherry picked from commit fea6ca20c9)
Attempting to move the function node to another function whose data connection is a dependency of the node the specific node being moved to a different function during changes to sequence connections.
By skipping, if the from_node is a function_node during the data connection dependencies scan.
Should fix#37991
(cherry picked from commit 5c48631509)
Add clarification to docs to explain that when an `AnimationPlayer`
object is paired with an `AnimationTree`, several properties and
methods exposed by the `AnimationPlayer` class may not work as expected.
The issues occur because an `AnimationTree` runs independently, and
uses its member `AnimationPlayer* player` primarily for its
`Map<StringName, AnimationData> animation_set`.
Added descriptions for `root_motion_track` and `get_root_motion_transform`.
(cherry picked from commit 0451248ff1)
This was previously implemented in the GridMap editor. This makes
the same feature available in the TileMap editor.
(cherry picked from commit def2059d67)
The `custom_modules` option was only read via the command line
by fetching `ARGUMENTS` dictionary directly.
Instead, the option's value can now be read via any existing
configuration files (`custom.py`) as well as command line, while also
updating the environment.
(cherry picked from commit 6304d16915)
`get_char_size()` is a public virtual function defined in the `Font`
class. Implementations exist for both `BitmapFont` and `Dynamic Font`.
However, it was only exposed to the GDScript API through the Bitmap
Font, and not for Dynamic Font.
This commit exposes the function through `Font` instead.
Fixes#23967
(cherry picked from commit a4413710f9)
The existence of `SCsub` is checked instead. This file is required for
all modules, and prevents the build system to leave modules without
`config.py` undetected, leading to silently ignoring the module during
compilation.
(cherry picked from commit 12389b3736)
Simple fix for #38627. iOS (#20268) and HTML5 (#20270) removed from list of exceptions
for platforms supported in warning message.
(cherry picked from commit 3d03be7a56)
- Make the Ignore button's position identical across all warnings
by moving it to the left.
- Change the Ignore button's text and color to make it more obvious
that it can be clicked.
- Use the editor font instead of the default project font to match
the rest of the editor.
(cherry picked from commit 0c0ee427d2)
When using the default setting (layer 1 set only) nothing is stored in the tscn file for a Light2D, hence it relies on the value in the constructor.
The problem is the constructed value is 1 in Light2D, and -1 in RasterizerCanvas::Light. -1 results in all bits being set so all occluders are shown, rather than just those in layer 1.
This PR changes Rasterizer::Canvas constructor to set to 1. An alternative is to have -1 as the value for layer 1 throughout.
The insertion order for dictionaries is only a language feature for
Python 3.6/3.7+ implementations, and not prior to that.
This ensures that the engine won't be rebuilt if the order of detected
modules changes in any way, as the `OrderedDict` should guarantee
inerstion order.
As it now seems like we will soon have GLES3 batching working using the same intermediate layer as GLES2, it makes more sense to reuse the same batching settings for both renderers rather than duplicate project settings for GLES2 and GLES3.
Depending on the conditional statements of the 'for' and 'while' loops,
their body may not even execute once. For example:
func a():
var arr = []
for i in arr:
return i
# can be reached, but analysis says cannot
return -1
func b():
var should_loop = false
while should_loop:
return 1
# can be reached, but analysis says cannot
return 0
The parser will complain that the statements after the comment cannot
be reached, but it is clearly possible for our scenario. This is
because the parser falsely assumes that the loop body will always
execute at least once.
Fix the code to remove this assumption for both of those loops.
(cherry picked from commit 7b1423a61e)
A class can't have multiple signals with the same name, but previously users
would not be alerted to a conflict while editing the script where it occurred.
Now a helpful error will appear in the editor during script parsing.
(cherry picked from commit 9e44739324)
This patch adds ability to include external, user-defined C++ modules
to be compiled as part of Godot via `custom_modules` build option
which can be passed to `scons`.
```
scons platform=x11 tools=yes custom_modules="../project/modules"
```
Features:
- detects all available modules under `custom_modules` directory the
same way as it does for built-in modules (not recursive);
- works with both relative and absolute paths on the filesystem;
- multiple search paths can be specified as a comma-separated list.
Module custom documentation and editor icons collection and generation
process is adapted to work with absolute paths needed by such modules.
Also fixed doctool bug mixing absolute and relative paths respectively.
Implementation details:
- `env.module_list` is a dictionary now, which holds both module name as
key and either a relative or absolute path to a module as a value.
- `methods.detect_modules` is run twice: once for built-in modules, and
second for external modules, all combined later.
- `methods.detect_modules` was not doing what it says on the tin. It is
split into `detect_modules` which collects a list of available modules
and `write_modules` which generates `register_types` sources for each.
- whether a module is built-in or external is distinguished by relative
or absolute paths respectively. `custom_modules` scons converter
ensures that the path is absolute even if relative path is supplied,
including expanding user paths and symbolic links.
- treats the parent directory as if it was Godot's base directory, so
that there's no need to change include paths in cases where custom
modules are included as dependencies in other modules.
(cherry picked from commit a96f0e98d7)
The specific case for object reference seems unnecessary, as `RES res = var`
already does the work. The case where REF is invalid is never hit in the case
of already freed objects.
The assignment `res = *r` was causing the resource to be always invalidated
on the 3.2 branch.
(cherry picked from commit 12685df423)
Upstream development restarted after 13 years. Changes:
2020-02-02: Version 0.5.0
Minor speed improvement on the decompressor.
Prevent memory violation when decompressing corrupted input.
2020-01-10: Version 0.4.0
Only code & infrastructure clean-up, no new functionality.
(cherry picked from commit 5167c9186a)
Builtins that should prevent baking colors and vertex positions were incorrectly only active in shaders that were not unshaded. This was a terminology misunderstanding - unshaded materials can still use shaders so should have the same test to prevent baking.
Any C# file can be loaded as script and at load
time we don't yet know if it's actually meant to
be used as a script. As such, such an check can
result in a lot of false errors.
If the file is really meant to be used as a
script, an error would be printed later when
attempting to instantiate it any way.
(cherry picked from commit 38cd2152e6)
- Set options to be the same as travis builds,
except use warnings=all instead of warnings=extra.
- Fail on warnings as per travis builds.
(cherry picked from commit 106221a733)
Edited to set `werror=no` until we've fixed all warnings.
There's a builtin `toolpath` option we can use for that, so no need to hack
around a custom `scons_site` path.
The script requires SCons 3.1.1 or later, so we enable it conditionally.
Follow-up to #32848.
(cherry picked from commit 22c718ab17)
This tool is originally from mongodb.
- Updated CPPSUFFIXES to use scons suffixes
- objective-c files will also be loaded into the compilation database where the compiler / tooling is available to compile the files.
Known limitations:
- This will not work with msvc as your compiler.
(cherry picked from commit 5a6f275b74)
The default `custom.py` can be created at the root of the Godot
repository to initialize any SCons build options via file which are
specific to user.
(cherry picked from commit a712e14038)
Each driver used to define the (same) project settings value, but the
setting names are not driver specific. Ovverriding is still possible via
platform tags.
(cherry picked from commit 90c7102b51)
When a child scene inherits a parent scene with a C# root node, the
parent scene's export variables appear to assume values set in the
parent scene, in the child scene's Inspector. However, when the child
scene is played, the parent scene's export variables assume default
values.
When a node is created, it inherits its parent C# script's fields from
the map CSharpScriptInstance::script->member_info. However this map was
not initialized outside the editor, and this commit ensured it is. This
fixes issues #36480 and #37581.
This is a manual backport of PR #38638 for 3.2.
The behaviour of TYPE_POLYLINE appeared incorrect in GLES2, and inconsistent with GLES3 and the docs, which state that draw_polyline 'Draws interconnected line segments'. Also when drawing with triangles GLES2 draws interconnected segments.
This PR simply changes the primitive from GL_LINES to GL_LINE_STRIP as in GLES3.
This option can be used to workaround various issues with stuff
not reloading properly when changes are made.
The option was renamed to clarify the fact that it actually
reloads the scene saved on the filesystem.
(cherry picked from commit 2962819d1c)
Writing to COLOR in a custom shader can result in incorrect results if colors are baked (vertex color and modulate). This PR prevents baking with COLOR output, except under the special circumstances that final modulate is (1, 1, 1, 1), in which case the result will be correct. This should still allow color baking in many scenarios with custom shaders.
By adding a reference to the 'Microsoft.NETFramework.ReferenceAssemblies' nuget
package, we can build projects targeting .NET Framework with the dotnet CLI.
By referencing this package we also don't need to install Mono on Linux/macOS
or .NET Framework on Windows, as the assemblies are taken from the package.
In addition to prevent item joins when VERTEX reads are present in a custom shader, it is also necessary to prevent baking extra matrices (extra transforms) WITHIN items, because these can also report incorrect results.
In situations where custom canvas shaders read VERTEX values, they could read incorrect global positions rather than local positions where batching had baked item transforms. This PR prevents joining items that read VERTEX built in in shaders, and thus prevents this situation arising (as unjoined items will not bake transforms).
7z is already available in path in appveyor
zip the build .exe files and store them ( appveyor retains for ~6 months)
(cherry picked from commit 7ae70625f3)
Removed by mistake in #38292 like the Windows `__XINPUT_DEVICE__`,
this magic binding is referenced directly in our code.
(cherry picked from commit 1c61b31109)
* On press left+command+shift or right+command+shift it should behave like shift+home or shift+end and select the text
* Using home and end events as reference
(cherry picked from commit d8f8a3c606)
- Make GodotTools output directly to the SCons output directory.
- Removed xbuild_fallback from the build system.
(cherry picked from commit b61ffef0ab)
Affects per-pixel transparency
The current method renders to the screen by copying the GLES output to a
DIB for transparency using the CPU instead of rendering directly to the
window via the GPU. This is slower and also forces the window to be borderless
as WS_EX_LAYERED affects the non-client region as well.
This change uses DWMEnableBlurBehindWindow which allows using the standard
glClearColor() background alpha and is also performed through the GPU,
eliminating CPU bottlenecks
The previous code would always use SSE2 intrinsics, which is not valid
on UWP ARM platforms (and likely not on some x86 platforms either).
The patch has been submitted upstream too:
https://github.com/richgel999/jpeg-compressor/pull/13
(cherry picked from commit 3806efbaa7)
There was a bug in the initial logic for item reordering, whereby it would check for overlaps between the mover (item being moved back) and sandwiched items, but there was no check for overlaps between the movee (item moved forward) and the sandwich items. This extra check is now done.
Also a minor addition to the diagnose frame info (godot texture ID).
Now the stack saved in a `GDScriptFunctionState` is cleared as soon as the `yield()` operation is known not to be resumed because either the script, the instance or both are deleted.
This clears problems like leaked objects by eliminating cases of circular references between `GDScriptFunctionState`s preventing them and the objects they refer to in their saved stacks from being released. As an example, this makes using `SceneTreeTimer` safer.
Furthermore, with this change it's now possible to print early warnings about `yield()`s to released script/instances, as now we know they won't be successfully resumed as the condition for that happens. However, this PR doesn't add such messages, to keep the observed behavior the same for the time being.
Also, now a backup of the function name in `GDScriptFunctionState` is used, since the script may not be valid by the time the function name is needed for the resume-after-yield error messages.
This reverts commit bf1cc116e1.
This needs more discussion to avoid breaking some users' expectations.
See #38086 for arguments.
(cherry picked from commit 69f36cea8c)
Skew is x-axis only, because it must be bidirectionally convertible to a 2x3 matrix, but you can subtract it to the rotation to get the effect on y-axis
(cherry picked from commit efb1f7d76b)
(cherry picked from commit 38085f2f6982c491935a434bb45e358dbebe1714)
(cherry picked from commit b9c280b73ff6a13ea490d2da0f2728bcef3038dc)
(cherry picked from commit 895ed2aed7)
Similar to https://github.com/godotengine/godot/pull/36557
At least in chrome, the following error is printed for each mouse wheel
rotation:
[Intervention] Unable to preventDefault inside passive event listener due to target being treated as passive. See https://www.chromestatus.com/features/6662647093133312
This PR moves the handler to the canvas and thereby fixes the error.
Tested on: Chrome and Firefox (MacOS), Firefox, Chrome(Android), Safari (IPad + MacOS)
(cherry picked from commit b1e8ac7b08)
It seems that particles (and some other features) do not work correctly on iOS in GLES2 because either many of the devices do not support half float compression, or the GL constant used to reference it from Godot is incorrect.
This PR adds a project setting in rendering/gles2/ to disable half-float compression on iOS.
Adding the ability to access MODULATE in the shader breaks when final_modulate is baked into vertex colors (this is a technique used to batch together different colored items). This PR prevents baking vertex colors when MODULATE is detected in the shader.
It also prevents baking when COLOR is read in canvas shaders, which could currently produce the wrong result in the shader if colors were baked. It does not prevent baking if COLOR is only written, which happens in most shaders, and will operate correctly without baking.
Calls to set_amount can increase the size of the particle array, but do not zero the memory, they only set the active flag to false. This uninitialized memory can be sent to the GPU, possibly as NaNs.
RichTextEffect can now have a bbcode string starting like one of the built-in.
It was impossible before as the built-in would take precedence over the custom effect that has the same bbcode start.
Example : [fade] would take precedence over [fade_in]
(cherry picked from commit b4e3042cba)
It made minor adjustments difficult as the camera moved every time
Align Transform With View was used.
This closes#36738.
(cherry picked from commit a636631e33)
`OS.shell_open()` will pass on the path directly to the OS' shell
handler (which can handle file paths or URLs). It can't handle
Godot-specific paths, so these need to be converted with
`ProjectSettings.globalize_path()` first.
(cherry picked from commit d46e411b44)
The 204 and 205 are the older, SDL 2.0.4 and 2.0.5 compatible mappings,
but since all new mappings have only been added to the main
gamecontrollerdb.txt which overrides the older entries, it doesn't make
much sense for us to keep the old databases.
We do not support the SDL2 half axes and inverted axes features from
gamecontrollerdb.txt, but this only impacts the specific controllers
which can use those features, the rest are parsed and used properly.
As for godotcontrollerdb.txt, it doesn't make sense for us to maintain
our own custom mappings instead of submitting them upstream. The only
exception is the Javascript and UWP platforms for which no bindings are
available upstream, so we keep those entries.
(cherry picked from commit 510e83498e)
Calling _reduce_node_type from GDScriptParser::_parse_block for assert
was using a current class with a scope that didn't include all
functions. Now calling in GDScriptParser::_check_block_types uses the
right class type. We also now check the assert node message. The assert
line was added to the set_errors associated with assert, since before
the error would be reported on the next line
(cherry picked from commit bd081df519)
The indexes for the ScriptEditorItemData entries were not getting
updated after sorting. This would cause a page to be open but with a
different tab selected. Whenever _update_script_names was called next,
it would correct this indexing. Now we correct it immediately following
the tab sort.
(cherry picked from commit fe53c1b0bd)
The stack size of the undo history of a TextEdit was not limited leading
to potential memory leaks when doing lots of operations on a TextEdit.
This commit adds the option gui/common/text_edit_undo_stack_max_size
to the project settings. The first element of the undo stack is popped
if the stack's size exceeds this value ensuring limited memory usage.
The default stack size setting is 1024.
Fixes#37838.
(cherry picked from commit 4a82390aaf)
PR #30877 was bogus as it made a blend shape-specific code block apply
to everything but blend shapes (as it seemed not to work properly *for*
blend shapes).
The proper fix should thus be to simply remove the problematic
block (and thus cleanup unnecessary logic).
Fixes#32712.
(cherry picked from commit 0034c88c57)
Although 2D draws in painters order with strict ordering, in certain circumstances items can be reordered to increase batching / decrease state changes, without affecting the end result. This can be determined by an overlap test.
In situation with item:
A-B-A
providing the third item does not overlap the second, they can be reordered:
A-A-B
Items already contain an AABB which can be used for this overlap test.
1)
To utilise this, I have implemented item reordering (only for single rects for now), with the lookahead adjustable in project settings. This can increase performance in situations where items may not be grouped in the scene tree by texture. It can also be switched off (by setting lookahead to 0).
2)
This same trick can be used to help join items that are lit. Lit items previously would prevent joining completely, thus missing out on performance gains other than multi-command items such as tilemaps.
In this PR, lights are assigned as bits in a bitfield (up to 64, the optimization is disabled above this), and on each try_item (for joining), the bitfield for lights and shadows is constructed and compared with the previous items. If these match the 2 items can potentially be joined. However, this can only be done without changing the rendered result if an overlap test is successful.
This overlap test can be adjusted to join items up to a specific number of item references, selectable in project settings, or turned off.
3)
The legacy uniform single rect drawing routine seems to have been identified as the source of flicker, particularly on nvidia. However, it can also be up to 2x as fast. Because of the speed the batching contains a fallback where it can use the legacy single rect method, but I have now added a project setting to make this switchable. In most cases with batching it should not be necessary (as single rects are drawn less frequently) and thus the flickering can be totally avoided.
4)
This PR also fixes a color modulate bug when drawing light passes, in certain situations (particularly custom _draw routines with multiple rects).
5)
This PR also fixes#38291, a bug in the legacy renderer where light passes could draw rects in wrong position.
- Resurrect it for GL ES 2
- Apply roll over with `fmod()` instead of resetting it to 0
- Expose the setting from the `VisualServer`, since it does not belong in any specific rasterizer
This fixes numerous false positives coming out of the culling system.
AABB checks are now a full separating-axis check against the frustum, with the points of the frustum being compared to the planes of the box just as the points of the box were being compared to the planes of the frustum. This fixes large objects behind the camera not being culled correctly.
Some systems that used frustums that were (sometimes mistakenly?) unbounded on one or more side have been modified to be fully enclosed.
Dual paraboloid shadowmaps were ending up with infinitely large volumes of area behind the hemisphere un-culled.
This change just adds a back plane to the convex shape used for the culling volume.
This moves the instance id member from Variant to the ObjectRC so that Variant is still the same size as before the fix (and also regardless if debug or release build).
The previous logic used the 'tools' directory within the Android sdk to validate it. That directory was recently deprecated and removed from the Android sdk folder (https://developer.android.com/studio/releases/sdk-tools)
(cherry picked from commit 328354f878)
This was a regression from 93d7ec8836 (#38110).
Mono's old implementation of Microsoft.Build hardcodes HasUnsavedChanges to
always return true.
This workaround can be reverted once we switch to official Microsoft.Build.
(cherry picked from commit 81f13f6171)
This references Godot's winding order at the top of every
procedural geometry class, as well as referencing other classes
within a given geometry class.
A warning about ImmediateGeometry3D performance was also added.
(cherry picked from commit ed7347d73d)
Now calling _reduce_node_type with debugging enabled to determine
if assert line is safe. Part of doing this required the assert line
to be stored away. Now the AssertNode line is being correctly set.
Newlines are now marked safe always
(cherry picked from commit 8dc8833782)
This should make headless exporting work in projects using textures
in any format.
Error messages should no longer appear when running a project
that used image formats that were previously not present in the list.
(cherry picked from commit 3007c7e2a3)
When reading SCREEN_TEXTURE in a shader, this previously only worked succesfully for the first read of the screen, because state.canvas_texscreen_used was never getting reset. This PR resets state.canvas_texscreen_used at the beginning of each joined item, so that further screen reads can happen.
This commit addresses multiple issues with `Variant`s that point to an `Object`
which is later released, when it's tried to be accessed again.
Formerly, **while running on the debugger the system would check if the instance id was
still valid** to print warnings or return special values. Some cases weren't being
warned about whatsoever.
Also, a newly allocated `Object` could happen to be allocated at the same memory
address of an old one, making cases of use hard to find and having **`Variant`s pointing
to the old one magically reassigned to the new**.
This commit makes the engine realize all these situations **under debugging**
so you can detect and fix them. Running without a debugger attached will still
behave as it always did.
Also the warning messages have been extended and made clearer.
All that said, in the name of performance there's still one possible case of undefined
behavior: in multithreaded scripts there would be a race condition between a thread freeing
an `Object` and another one trying to operate on it. The latter may not realize the
`Object` has been freed soon enough. But that's a case of bad scripting that was never
supported anyway.
Joining items across z_indices can interfere with light culling for lights which only affect certain z ranges. This PR disables joining across z_indices when lights are present, except specifically for lights with both z_min set to the global minimum (-4096) and z_max set to the global maximum (4096).
In addition, the z_index is now stored on the joined_item for accurate light culling. The z_index is also displayed in frame diagnostics.
Needed for the next commit. That's the only place in all the Godot code base
where that's attempted and it's not needed because Objects are not meant to
be copied that way.
- Include PDB files in exported games.
- Release export templates also allow debugging now.
Right now the only way to enable debugging in exported games is with the environment variables, which may be cumbersome or not even possible on some platforms.
(cherry picked from commit 71fc87e101)
The issue was caused by PR #36906 which changes prevented the generated shared libraries from being stripped.
Since the change is only needed for development (debugging) purposes, it's commented out by default.
(cherry picked from commit 2f38cfd9ab)
In rare circumstances default batches were being joined incorrectly, causing visual regressions. This logic has been fixed.
In addition slightly more output information has been added to frame diagnosis mode.
This also replaces a non-breaking space that was accidentally added in
the EditorFeatureProfile documentation.
This closes#31393.
(cherry picked from commit 2f46f1e7b1)
Batching across z_index layers was not preserving the batch_break flag, which determines whether to not join the previous item. This is fixed by storing the flag in RenderItemState and preserving it across canvas_render_items calls.
- Replaces BuildPoly with Build2DFaces, which creates faces as each
pair of face intersections are processed, instead of trying to create
them after all the intersections are processed. Ensures that faces are
merged when possible, and removes degenerate triangles.
- Treats the child as inside the parent when faces are coplanar.
- General clean up of csg.h and csg.cpp.
New contributors added to AUTHORS:
@dreamsComeTrue, @kuruk-mm, @lawnjelly, @ThakeeNathees
Thanks to all contributors and donors for making Godot possible!
(cherry picked from commit 74d60328f8)
Added project setting to enable / disable print frame diagnostics every 10 seconds. This prints out a list of batches and info, which is useful to optimize games and identify performance problems.
This makes the script name appear before the scene file name,
which ensures it's always visible even if the list of scripts is too
narrow to display the full name.
This only impacts built-in scripts with custom resource names.
Unnamed resources will still use `<scene_file>::<id>` naming
in the list of scripts.
(cherry picked from commit e90beade15)
This adds 2 new values (items and draw calls) to the performance monitor in a '2d' section, rather than reusing the 3d values in the 'raster' section.
This makes it far easier to optimize games to minimize drawcalls.
I had no idea what 'coordinate' meant in the context of autotiles, so just adding some clarification for future people who have the same problem.
(cherry picked from commit cbe73766e3)
* Added additional clarification for the function of the 'deep'
parameter in the Dictionary's `duplicate` method.
(cherry picked from commit 469b7c948f)
* item_selected and item_focused docs incorrectly had 'id' as the parameter. Changed to
'index'.
* Fix parameter name in ADD_SIGNAL callin code.
(cherry picked from commit a8de034f78)
Added information about the intervals of values that the functions
`store_{8,16,32,64}()` can correctly write to the file.
(cherry picked from commit 97e20b2f30)
This is the only location in the codebase where it's being used, so no need to make the main lib have a dependency on it.
(cherry picked from commit c591cb8fda)
The Request Docs button is partly responsible for layout overflow
issues on narrow displays, such as #31133.
It also tended to attract spam and low-effort issues that were
difficult to act upon. A "Send Docs Feedback" menu option has been added
to replace it.
(cherry picked from commit 2f6f029a75)
The 3.2.2 release will include quite a few new features which warrant
at least one beta build before RC:
- GLES2 2D batching
- Mono/C# support for iOS
- New Android plugin system
Defers sending 'transform' commands within a RasterizerCanvas::Item until they are needed for default batches. Instead locally caches the extra matrix and applies it using software transform, preventing unnecessary batch breaks.
The logic is relatively complex, and the whole 'extra matrix' of the legacy renderer in addition to the final_transform is not ideal. However this is required to accelerate some user drawing techniques, and later the lines in the IDE.
Right now, games only work on devices when exported with FullAOT+Interpreter.
There are some issues left that need to addressed for FullAOT alone. Right now,
it's giving issues with the Godot.NativeCalls static constructor.
MinGW should support both its own format `.a` and MSVC's format `.lib`, but Mono's module was only using the former. With this change it's now possible to build with MinGW and link the official Mono for Windows which is built with MSVC.
Extra functions canvas_render_items_begin and canvas_render_items_end are added to RasterizerCanvas, with noop stubs for non-GLES2 renderers. This enables batching to be spready over multiple z_indices, and multiple calls to canvas_render_items.
It does this by only performing item joining within canvas_render_items, and deferring rendering until canvas_render_items_end().
Determined that a large reason for the decrease in performance in unbatchable scenes was due to the new routine being analogous to the 'nvidia workaround' code, that is about half the speed. So this simply uses the old routine in the case of single unbatchable rects. Hopefully we will be able to remove the old path at a later stage.
Correct backtrack assignment to prevent excessive tabulation. Worth
noting that tabulation is treated differently in RichTextLabel because
of custom user-asignable tab variable which creates problems with
dynamic fonts specifically.
(cherry picked from commit 2000e110a9)
Where the final_modulate color varies between render_items this can prevent batching. This PR solves this by baking final_modulate into the vertex colors, and setting the uniform 'final_modulate' to white, and allowing the joining of items that have different final_modulate values. The previous batching system can then cope with vertex color changes as normal.
Godot by default has a limit of 16 reflection probes in a scene. this can be increased by increasing atlas subdiv. For 3.2 and possibly 4.0. This also fixes a spelling mistake
Update doc/classes/ReflectionProbe.xml
Fix from clayjohn, Directly link to settings
Co-Authored-By: Clay John <claynjohn@gmail.com>
Fixes#18809.
The in-editor ortho camera used a far clipping plane of 8192 units, and was
placed 4096 units away from the camera cursor.
This was far enough to cause culling issues from floating point precision loss
on objects smaller than one unit.
This change modifies the near/far clipping planes of the ortho camera to use
those specified in the editor (and currently used by the perspective camera).
The frustum is still centered around the camera cursor location, as it was
before.
2d rendering is currently bottlenecked by drawing primitives one at a time, limiting OpenGL efficiency. This PR batches primitives and renders in fewer drawcalls, resulting in significant performance improvements. This also speeds up text rendering.
This PR batches across canvas items as well as within items.
The code dynamically chooses between a vertex format with and without color, depending on the input data for a frame, in order to optimize throughput and maximize batch size. It also adds an option to use glScissor to reduce fillrate in light passes.
With the NDK installed locally, gradle plugin 3.6.0 seems to enforce
a specific older NDK version, and will fail building if you don't have
it installed with:
```
No version of NDK matched the requested version 20.0.5594570.
Versions available locally: 21.0.6113669
```
Upstream issue: https://github.com/gradle/gradle/issues/12440
(cherry picked from commit ba2ec53a26)
A click on the dimmed background of a popup in the editor should stop the input event from propagating to the background.
This solution reuses the system introduced in commit efc3ffb8, taking advantage of the hide() notifications from the modal where we will set the flag "pass_on_modal_close_click(false)" to stop event handling at the viewport input event handling.
The viewport first hides the modal and after marks the input as handled if the flag mentioned above is set.
Fixes#36341
(cherry picked from commit 35bc88ca34)
Since the new audio system in 3.0 we switched the OGG support to
stb_vorbis, and the Opus stream support was disabled as incompatible
(see #7496).
We still build the libraries as they are needed by the theora and webm
modules, but we don't need any Godot code apart from `register_types`.
Fixes#7496.
(cherry picked from commit 7f6b62cef0)
The `TextEdit` one was indeed a potential bug.
The `PCKPacker` one seems to be a false positive, it's already in a
`for` loop that depends on `files.size()`.
(cherry picked from commit ca4e4506db)
The minimum slider value no longer allows decreasing the value below
the default, as this can cause things to break in the editor.
The maximum slider value was also increased to 4096 since it can safely
be increased to that value (some add-ons may require it).
This closes#37052.
(cherry picked from commit 8d8c7a9383)
Changes made:
* Added dirty bit for SpatialEditorSelectedItem's last_xform
* SpatialEditorViewport checks that dirt bit too before skipping the selection
(cherry picked from commit 19825436d4)
Alignment of scene pixels on screen pixel ensure a crisp rendering of small features (such as text). Unfortunately, alignment of top left pixel on screen adds a lot of jittering when zooming at high zoom factor.
This change allow to snap the top left scene pixel on the closest screen pixel (not only the top-left most), and we do so only when the scale factor is an integer.
(cherry picked from commit 1c02906a6f)
Placeholder with length greater than `max_length` are allowed, so there is no reason for those update condition.
It fixes the odd alignment of placeholder when it's length is greater than `max_length`
(cherry picked from commit 43b2f75d64)
The AABB for an empty Spatial has 0 size, since the stored and
compared Transform was scaled by the AABB size, it would completely
destroy the rotation information. If there is no rotation
information, the gizmo doesn't update when the rotation changes.
(cherry picked from commit a0af3094b4)
Fixed FileSystemDock's `file_removed` and `folder_removed` signals not being
emitted because the emitted was using the wrong signal name.
(cherry picked from commit fe0b783e70)
Namely, move the drive dropdown to just the left of the path text box and don't include the former
in the latter.
This improves the UX on Windows.
In the UNIX case, since its concept of drives is (ab)used to provide shortcuts to useful paths, its
dropdown is kept at the original location.
New contributor added to AUTHORS:
@muiroc
Thanks to all contributors and donors for making Godot possible!
Sorry for the late March update and missed February update, I made sure
to include patrons for both February and March in this commit.
(cherry picked from commit 5b97db325a)
This reverts commit 2e152b945f.
SCons `FRAMEWORKS` is, according to their latest docs, only supported
"On Mac OS X with gcc". While the "with gcc" part seems bogus, #36795
did introduce a link failure for our osxcross toolchain for compiling
macOS binaries from Linux. SCons probably fails to detect this as a
macOS target and does not use its `FRAMEWORKS` logic properly.
So using `LINKFLAGS` as we used to is the more portable solution.
The comment mentioned a conflict with libwebsockets, but we actually
still get this conflict even now that we don't use libwebsockets.
Not sure what component is clashing but we should basically just keep
this patch.
Follow-up to #36823.
(cherry picked from commit 8189abd64a)
For some weird reason 'git apply' does not error out when it does nothing,
so I missed that I did not apply the patch properly in #36823...
This broke the UWP 32-bit x86 build.
(cherry picked from commit 9a727714ee)
- Improve the SCsub to allow unbundling and remove unnecessary code.
- Move files around to match upstream source.
- Re-sync with upstream commit 308db73d0b3c2d1870cd3e465eaa283692a4cf23
to ensure we don't have local modifications.
- Doesn't actually build against current version 5.0.1 due to the lack
of the new ArmaturePopulate API that Gordon authored. We'll have to
wait for a public release with that API (5.1?) to enable unbundling.
(cherry picked from commit 9d8a9ea826)
Fixes the link errors below
clang: error: no such file or directory: 'Carbon'
clang: error: no such file or directory: 'AudioUnit'
clang: error: no such file or directory: 'CoreAudio'
clang: error: no such file or directory: 'CoreMIDI'
clang: error: no such file or directory: 'IOKit'
clang: error: no such file or directory: 'ForceFeedback'
clang: error: no such file or directory: 'CoreVideo'
clang: error: no such file or directory: 'AVFoundation'
clang: error: no such file or directory: 'CoreMedia'
clang: error: no such file or directory: 'Metal'
clang: error: no such file or directory: 'QuartzCore'
Tested on
System Version: macOS 10.15.3 (19D76)
SCons by Steven Knight et al.:
script: v3.1.2.bee7caf9defd6e108fc2998a2520ddb36a967691, 2019-12-17 02:07:09, by bdeegan on octodog
engine: v3.1.2.bee7caf9defd6e108fc2998a2520ddb36a967691, 2019-12-17 02:07:09, by bdeegan on octodog
engine path: ['/usr/local/Cellar/scons/3.1.2_1/libexec/scons-local/SCons']
Xcode 11.3.1
Build version 11C504
Apple clang version 11.0.0 (clang-1100.0.33.17)
Target: x86_64-apple-darwin19.3.0
Closes#36720
(cherry picked from commit c924e83a64)
In the case where a ConcavePolygonShape is used as a shape for a RigidBody
in another mode than static, a configuration warning will appear in the
editor.
(cherry picked from commit ad227d9a85)
Otherwise comparisons would fail for compiler versions above 10.
Also simplified code somewhat to avoid using subprocess too much
needlessly.
(cherry picked from commits c7dc5142b5
and df7ecfc4a7)
On GCC and Clang, we use C11 and C++14 with GNU extensions (`std=gnu11`
and `std=gnu++14`). Those are the defaults for current GCC and Clang,
and also match the feature sets we want to use in Godot.
On MSVC, we require C++14 support explicitly with `/std:c++14`, and
make it strict with the use of `/permissive-` (so features of C++17 or
later can't be used).
Moves the definition before querying environment flags and platform
config so that it can be overridden when necessary.
(cherry picked from commit 342f127362)
Without this patch, the following exception is thrown when the touch
screen is used: TypeError: e.getBoundingClientRect is not a function.
No touch events arrive in the engine.
From my testing, this PR fixes the issue and behaves as expected.
Tested with godot-demo-projects/misc/multitouch_view/, emscripten 1.39.8
and Firefox mobile emulator as well as FF on Android
(cherry picked from commit 5134317afc)
The name of the property responsible for physics fps is fixed:
this is `Engine.iterations_per_second`, not `Engine.target_fps`.
(cherry picked from commit 6e5cd36b12)
EditorData::undo_redo.add_do_property and EditorData::undo_redo.add_undo_property is used in EditorData::paste_object_params to implement this feature. It's action name is set to "Paste Params"
Changes made
* Removed the call for clearing the history on paste params case.
* Instead of directly setting the properties value, EditorData::undo_redo is used.
(cherry picked from commit f817ba8379)
The code above for horizontal movement uses the right margin (_positive_ x direction) when the offset is negative, but vertical movement uses the top margin (_negative_ y direction) when the offset is negative.
The resulting problem is easily seen in the editor — set the drag margins to be asymmetrical, turn on drawing the drag margins, and slide the offsets from -1 to 1 and back. The horizontal offset moves the camera's center between the left and right margins, but the vertical offset gets them backwards and will move the camera outside the margins entirely.
(cherry picked from commit 40816574ac)
UDP sockets can be "connected" to filter packets from a specific source.
In case of a bound socket (e.g. server), a new socket can be created on
the same address/port that will receive all packets that are not
filtered by a more specific socket (e.g. the previously connect socket).
This way, a UDPServer can listen to new packets, and return a new
PacketPeerUDP when receiving one, knowing that is a "new client".
`git diff-tree` used to fail on the `3.2` branch (and other non-master
branches) as Travis doesn't actually check that branch from the remote:
```
fatal: ambiguous argument '3.2': unknown revision or path not in the
working tree.
```
The exit code would still be 0 so we'd miss badly formatted commits
targeting stable branches.
We do it manually to ensure that it's going to work as we want it.
(cherry picked from commit e479231b21)
This makes the project icon display immediately as a favicon when
opening the page, without having to wait for the project to finish
loading.
(cherry picked from commit 4492cf856b)
Icons are no longer upsampled when using an integer editor scale.
This makes some icons slightly less crisp, but the icons themselves
can be adjusted to mitigate this. When using a non-integer editor
scale setting, upsampling is kept as it improves crispness in a
far more visible manner.
When upsampling is disabled, this speeds up the theme generation
by about 100 ms on average, making the project manager and editor
start slightly faster. This also speeds up switching between themes.
(cherry picked from commit 9e3393a624)
Previously, a change was missed if it happened while the scan was in progress and already past the affected location.
Also:
- Consider the scan changes thread on termination, in addition to the full scan one
- Add FS-reported hidden to the check for hidden by the editor file system
(cherry picked from commit 3017bdb7ce)
The new default keys were chosen to match common graphics editing
software. A modifier is no longer required to use the Select tool,
making it faster to use.
This closes#34170.
(cherry picked from commit 88213b54ba)
The special case atan(y,0) of the built-in shader function atan(y,x)
returns different results on different devices. So this commit will add
checks when the atan(y,x) function is used in ParticlesMaterial to set
the direction of GPU Particles to make sure the desired values are
returned (act as atan2(y,x)).
(cherry picked from commit 3580ad6005)
af9bb0ea15 fixed AudioServer's
`get_output_delay()` (which used to always return 0) while renaming it
to `get_output_latency()`. It now returns the latency from the
AudioDriver, which can be non-0.
While this was a clear bugfix, it broke playback for WebM files without
audio track. It seems like the playback code, even though it queried
the output delay to calculate a time compensation, was designed to work
even though the delay value was actually bogus. Now that it's correct,
it's not working.
As a workaround we comment out uses of the output latency, restoring
the behavior of Godot 3.1.
This code should still be reviewed by someone more versed in video
playback and fixed to properly account for the non-0 driver latency.
Fixes#35760.
(cherry picked from commit da411d1625)
The problem could be related to different byte ordering when copying
the interface address over the binding address.
(cherry picked from commit e85330231c)
It was removed after the implementation of VHACD. Generating a single
shape can lead to better performance, so it may still be desired.
This also adds tooltips for several options in the Mesh menu.
This closes#35692.
(cherry picked from commit 90af009f2e)
A picture is easier to describe this issue than words. Basically, rich
text effects allowed for character visibility changes. While doing so
would work properly, the rich text label would render the next `word` in
an offset accounting for the hidden characters (leaving a huge space.)
This patch fixes this issue by keeping track of the amount of
`backtrack` necessary per line.
(cherry picked from commit b3fd4884d7)
- Use the editor-defined error, warning and success colors for
preview texts.
- Make the "Regular Expressions" option into a CheckButton
(as it does something as soon as it's toggled) and move it out
of the Advanced Options submenu.
- Make it clearer that the error message originates from an invalid
regular expression.
- Clarify what the number means in the regex error message.
- Tweak some strings' casing for consistency.
(cherry picked from commit ff135065f4)
The behavior for Basis and Transform2D is unchanged, and Transform gets new behavior. All of the behavior is identical to GDScript's behavior.
(cherry picked from commit 0a39c7b354)
- Refresh tha tab automatically when switching to it.
- Disable the Refresh button if no project is currently being debugged.
- Scale the column widths on hiDPI displays.
- Rename the tab from "Video Mem" to "Video RAM" for consistency.
(cherry picked from commit 8f838f33b7)
- Convert the default AutoLoad name to PascalCase when selecting a file.
- Disable the "Add" button if the path is empty or the name is invalid.
- Prefix the automatically-chosen name with "Global" if it would
conflict with a built-in class.
- Replace the FileList icon with the Load icon as it better represents
the action.
(cherry picked from commit 352be7dbcc)
The minimum value of the slider was changed to 0.2 as zooming
works in increments of 0.2. This way, the value can go back to 1
after you've reached the slider's minimum value.
(cherry picked from commit 4c1b2171b0)
Settings search used to work only on properties, so if a searchbox text
was a substring of a category but not of a property the whole category
would be filtered out and no property would be shown.
Now the behaviour is changed so that when the searchbox text is a
substring of a category all its properties are shown too.
The previous behaviour is still present so that in case the searchbox
text is both a substring of a category and a property of another
category, all properties of the first category are shown and only the
property of the second category is shown.
(cherry picked from commit 84410f937e)
Signal bone_setup_changed remains undocumented. I took a quick look at
the cpp code, but its purpose remained unclear to me. If anyone can
steer me in the right direction, I'm happy to flesh this out.
(cherry picked from commit 9151992432)
- Duplicate the header when the `-a` flag is enabled. Since lots of
items are displayed in this case, this helps the user remember
which column is which without having to scroll back to the top.
- Bolden the overall percentages for easier visual grepping.
(cherry picked from commit 7c3f6b2870)
Calling `step()` on EditorProgress too often will slow down the
rest of the editor, so it's best avoided. This is also more consistent
with other exporters, as most of them don't report per-file progress
either.
Exporting a 2D project with ~1,100 files to Android now takes
about 10 seconds from a debug editor build instead of 65 seconds.
This closes#30850.
(cherry picked from commit 2dd3a01d11)
Many newcomers are confused about which one to choose for animating
properties. This should help clarify the situation with regards
to AnimationPlayer versus Tween.
(cherry picked from commit 810b1341ce)
An error message is now printed when trying to set the number of octaves
above the maximum allowed value.
The magic constant was also replaced with a define that can be
easily changed.
This closes#28714.
(cherry picked from commit 13622d40fc)
Previously, the CSV file could only be saved in `res://`. Since this is
an editor tool, it makes sense to allow saving anywhere on
the filesystem.
(cherry picked from commit 81f33df84b)
The workaround for moving the pivot is not needed anymore, in fact it causes all transforms applied to control nodes to jitter while animating (if a pivot offset is set).
This can be observed via AnimationPlayer and Tween.
The fix is to remove the obsolete workaround that causes this bug.
Fixes#28804
(cherry picked from commit dfb7d46a2a)
Changed the condition to add a length filter to make it consistent with the documentation (0 means no character limit). Otherwise the default value in LineEdit causes the virtual keyboard to be non-fonctional on Android.
(cherry picked from commit 196860508a)
@ -4,6 +4,191 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
## [3.2.3] - 2020-09-17
See the [release announcement](https://godotengine.org/article/maintenance-release-godot-3-2-3) for details.
### Added
- Android: Add option to enable high precision float in GLES2
- C#: Add Visual Studio support
- HTML5: Improvements and bugfixes backported from the `master` branch
* Note: This PR adds threads support, but as this support is still [disabled in many browsers](https://caniuse.com/#feat=sharedarraybuffer) due to security concerns, the option is not enabled by default. Build HTML5 templates with `threads_enabled=yes` to test it.
- Input: Support SDL2 half axes and inverted axes mappings
- iOS: Add support of iOS's dynamic libraries to GDNative
- iOS: Add methods to embed a framework
- LineEdit: Add option to disable virtual keyboard for LineEdit
- macOS: Implement confined mouse mode
- macOS: Implement seamless display scaling
- Rendering: Allow nearest neighbor lookup when using mipmaps
### Changed
- C#: New `csproj` style with backport of Godot.NET.Sdk
- This change breaks forward compatibility, C# projects opened in 3.2.3 will no longer work with 3.2.2 or earlier. Backup your project files before upgrading.
- GDScript: Auto completion enhanced for extends and class level identifier
- HTML5: Implement HTML5 cancel/ok button swap on Windows
- Physics: Better damping implementation for Bullet rigid bodies
- This makes the behavior of the GodotPhysics and Bullet backends consistent, and more user-friendly with Bullet. If you're using damping with the Bullet backend, you may need to adjust some properties to restore the behavior from 3.2.2 or earlier (see [GH-42051](https://github.com/godotengine/godot/issues/42051#issuecomment-692132877)).
- Project Settings: Enable file logging by default on desktops to help with troubleshooting
- Script editor: Don't open dominant script in external editor
- Sprite3D: Use mesh instead of immediate for drawing Sprite3D
### Fixed
- Android: Fix Return key events in LineEdit & TextEdit on Android
- C#: Fix crash when pass null in print array in `GD.Print`
- C#: Fix restore not called when building game projects
- C#: Fix potential crash with nested classes
- C#: Fix endless reload loop if project has unicode chars
- Core: Fix debugger error when Dictionary key is a freed Object
- Core: Fix leaked ObjectRCs on object Variant reassignment
- GLES2: Fixed mesh data access errors in GLES2
- GLES2: Batching - Fix `FORCE_REPEAT` not being set properly on npot hardware
- GLES3: Force depth prepass when using alpha prepass
- GLES3: Fix OpenGL error when generating radiance
- HTML5: More fixes, audio fallback, fixed FPS
- IK: Fixed SkeletonIK not working with scaled skeletons
- Import: Fix custom tracks causing issues on reimport
- Import: Fix upstream stb_vorbis regression causing crashes with some OGG files
- iOS: Fix for iOS touch recognition
- iOS: Fix possible crash on exit when leaking translation remappings
- macOS: Add support for the Apple Silicon (ARM64) build target
- ARM64 binaries are not included in macOS editor or template builds yet. It's going to take some time before our [dependencies and toolchains](https://github.com/godotengine/godot-build-scripts/pull/10) are updated to support it.
- macOS: Set correct external file attributes, and creation time
- macOS: Refocus last key window after `OS::alert` is closed
- macOS: Fix crash of failed `fork`
- Networking: Fix `UDPServer` and `DTLSServer` on Windows compatibility
- Particles: Fix 2D Particle velocity with directed emission mask
- PathFollow3D: Fix repeated updates of PathFollow3D Transform
- Physics: Trigger broadphase update when changing collision layer/mask
- Physics: Fix laxist collision detection on one way shapes
- Physics: Properly pass safe margin on initialization (fixes jitter in GodotPhysics backend)
- Project Settings: Fix overriding compression related settings
- Rendering: Fixed images in black margins
- Rendering: Properly calculate Polygon2D AABB with skeleton
- RichTextLabel: Fix RichTextLabel fill alignment regression
- RichTextLabel: Fix `center` alignment bug
- Shaders: Fix specular `render_mode` for Visual Shaders
- SkeletonIK: Fix calling `reload_goal()` when starting IK with `start(true)`
- TileSet: Fix potential crash when editing polygons
- Tree: Fix crash when hovering columns after removing a column
- HTML5: Fix touch events support with Emscripten 1.39.5+
- macOS: Fix gamepad disconnection callback on macOS Catalina
- Particles: Fix undefined behavior with atan in GPU Particles
- Video: Workaround WebM playback bug after AudioServer latency fixes
- Windows: Fix UPNP regression after upstream update
- Windows: Disable NetSocket address reuse
## [3.2] - 2020-01-29
### Added
@ -250,6 +435,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
- Drag-and-drop support in the TileSet editor.
- Ability to attach scripts to nodes by dragging a name from the script list to a node in the scene tree.
- Icons are now displayed next to code completion items, making their type easier to distinguish.
- TileMap property `centered_textures` can be used to center textures on their tile, instead of using the tile's top-left corner as position for the texture.
- "Ignore" flag to ignore specific tiles when autotiling in the TileMap editor.
- Keyboard shortcuts to rotate tiles in the TileMap editor.
@ -383,6 +569,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
- Ogg samples now have an icon in the editor, like WAV samples.
- Camera2D drag margins are now disabled by default.
- If porting a project from Godot 3.1 where drag margins were used, these must be enabled manually again.
- The Camera2D Offset property now ignores the Limit property.
- To get the old behavior back, move the camera itself instead of changing the offset.
- `Camera.project_position()` now requires a second `depth` argument to determine the distance of the point from the camera.
- To get the old behavior back, pass the Camera's `near` property value as the second argument.
- `Skeleton.set_bone_global_pose()` was replaced by `Skeleton.set_bone_global_pose_override()`.
@ -519,6 +707,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
- Graph lines are now thinner and opaque.
- Graph line widths are now resized to match the editor scale.
- Rounded values now display trailing zeroes to make their precision clearer.
- TileMap support for transform operations on cell textures bigger than the cell size has been reworked to properly support isometric tiles.
- Breaks compatibility with some TileMaps from previous Godot versions. An opt-in `compatibility_mode` property can be used to restore the previous behavior.
- Some TileMap editor options were moved to the toolbar.
- The TileMap editor now displays coordinate information in the 2D viewport's bottom-left corner.
- This fixes the TileMap editor width changing when hovering tiles in a small window.
- [Contributing to Godot's translation](#contributing-to-godots-translation)
- [Communicating with developers](#communicating-with-developers)
**Please read the first section before reporting a bug!**
## Reporting bugs or proposing features
## Reporting bugs
The golden rule is to **always open *one* issue for *one* bug**. If you notice
several bugs and want to report them, make sure to create one new issue for
each of them.
Everything referred to hereafter as "bug" also applies for feature requests.
If you're reporting a new bug, you'll make our life simpler (and the
fix will come sooner) by following these guidelines:
If you are reporting a new issue, you will make our life much simpler (and the
fix come much sooner) by following these guidelines:
### Search first in the existing database
#### Search first in the existing database
Issues are often reported several times by various users. It's good practice to
**search first in the [issue tracker](https://github.com/godotengine/godot/issues)
before reporting your issue**. If you don't find a relevant match or if you're
unsure, don't hesitate to **open a new issue**. The bugsquad will handle it
from there if it's a duplicate.
Issues are often reported several times by various users. It's a good practice
to **search first** in the issues database before reporting your issue. If you
don't find a relevant match or if you are unsure, don't hesitate to **open a
new issue**. The bugsquad will handle it from there if it's a duplicate.
#### Specify the platform
### Specify the platform
Godot runs on a large variety of platforms and operating systems and devices.
If you believe your issue is device/platform dependent (for example if it is
related to the rendering, crashes or compilation errors), please specify:
* Operating system
* Device (including architecture, e.g. x86, x86_64, arm, etc.)
* GPU model (and driver in use if you know it)
**In your bug reports, please always specify:**
#### Specify steps to reproduce
- Operating system and version (e.g. Windows 10, macOS 10.15, Ubuntu 19.10)
- Godot version (e.g. 3.2, 3.1.2, or the Git commit hash if you're using a development branch)
For bugs that are likely OS-specific and/or graphics-related, please also specify:
- Device (CPU model including architecture, e.g. x86, x86_64, ARM, etc.)
- GPU model (and the driver version in use if you know it)
**Bug reports not including the required information may be closed at the
maintainers' discretion.** If in doubt, always include all the requested
information; it's better to include too much information than not enough
information.
### Specify steps to reproduce
Many bugs can't be reproduced unless specific steps are taken. Please **specify
the exact steps** that must be taken to reproduce the condition, and try to
keep them as minimal as possible.
keep them as minimal as possible. If you're describing a procedure to follow
in the editor, don't hesitate to include screenshots.
#### Provide a simple, example project
Making your bug report easy to reproduce will make it easier for contributors
to fix the bug.
Sometimes an unexpected behavior happens in your project. In such case,
### Provide a simple, example project
Sometimes, unexpected behavior can happen in your project. In such case,
understand that:
* What happens to you may not happen to other users.
* We can't take the time to look at your project, understand how it is set up
- What happens to you may not happen to other users.
- We can't take the time to look at your project, understand how it is set up
and then figure out why it's failing.
To speed up our work, please prepare for us **a simple project** that isolates
To speed up our work, **please upload a minimal project** that isolates
and reproduces the issue. This is always the **best way for us to fix it**.
You can attach a zip file with the minimal project directly to the bug report,
You can attach a ZIP file with the minimal project directly to the bug report,
by drag and dropping the file in the GitHub edition field.
We recommend always attaching a minimal reproduction project, even if the issue
may seem simple to reproduce manually.
**If you've been asked by a maintainer to upload a minimal reproduction project,
you *must* do so within 7 days.** Otherwise, your bug report will be closed as
it'll be considered too difficult to diagnose.
Now that you've read the guidelines, click the link below to create a
bug report:
- **[Report a bug](https://github.com/godotengine/godot/issues/new?assignees=&labels=&template=bug_report.md&title=)**
## Proposing features or improvements
**Since August 2019, the main issue tracker no longer accepts feature proposals.**
Instead, head to the [Godot Proposals repository](https://github.com/godotengine/godot-proposals)
and follow the instructions in the README file. High-quality feature proposals
are more likely to be well-received by the maintainers and community, so do
your best :)
See [this article](https://godotengine.org/article/introducing-godot-proposals-repository)
for detailed rationale on this change.
## Contributing pull requests
If you want to add new engine functionalities, please make sure that:
If you want to add new engine features, please make sure that:
* This functionality is desired, which means that it solves a common use case
- This functionality is desired, which means that it solves a common use case
that several users will need in their real-life projects.
* You talked to other developers on how to implement it best (on either
communication channel, and maybe in a GitHub issue first before making your
PR).
* Even if it does not get merged, your PR is useful for future work by another
- You talked to other developers on how to implement it best. See also
[Proposing features or improvements](#proposing-features-or-improvements).
- Even if it doesn't get merged, your PR is useful for future work by another
developer.
Similar rules can be applied when contributing bug fixes - it's always best to
@ -83,7 +119,23 @@ for an introduction to developing on Godot.
The [Contributing docs](https://docs.godotengine.org/en/latest/community/contributing/index.html)
also have important information on the PR workflow and the code style we use.
#### Be nice to the git history
### Document your changes
If your pull request adds methods, properties or signals that are exposed to
scripting APIs, you **must** update the class reference to document those.
This is to ensure the documentation coverage doesn't decrease as contributions
are merged.
[Update the documentation template](https://docs.godotengine.org/en/latest/community/contributing/updating_the_class_reference.html#updating-the-documentation-template)
using your compiled binary, then fill in the descriptions.
Godot is completely free and open source under the very permissive MIT license.
No strings attached, no royalties, nothing. The users' games are theirs, down
to the last line of engine code. Godot's development is fully independent and
community-driven, empowering users to help shape their engine to match their
expectations. It is supported by the Software Freedom Conservancy
expectations. It is supported by the [Software Freedom Conservancy](https://sfconservancy.org/)
not-for-profit.
Before being open sourced in February 2014, Godot had been developed by Juan
@ -28,45 +49,48 @@ years as an in-house engine, used to publish several work-for-hire titles.
![Screenshot of a 3D scene in Godot Engine](https://raw.githubusercontent.com/godotengine/godot-design/master/screenshots/editor_tps_demo_1920x1080.jpg)
### Getting the engine
## Getting the engine
#### Binary downloads
### Binary downloads
Official binaries for the Godot editor and the export templates can be found
[on the homepage](https://godotengine.org/download).
#### Compiling from source
### Compiling from source
[See the official docs](https://docs.godotengine.org/en/latest/development/compiling/)
for compilation instructions for every supported platform.
### Community and contributing
## Community and contributing
Godot is not only an engine but an ever-growing community of users and engine
developers. The main community channels are listed [on the homepage](https://godotengine.org/community).
To get in touch with the developers, the best way is to join the
[![Translate on Weblate](https://hosted.weblate.org/widgets/godot-engine/-/godot/svg-badge.svg)](https://hosted.weblate.org/engage/godot-engine/?utm_source=widget)
[![Total alerts on LGTM](https://img.shields.io/lgtm/alerts/g/godotengine/godot.svg?logo=lgtm&logoWidth=18)](https://lgtm.com/projects/g/godotengine/godot/alerts)
opts.Add(BoolVariable("minizip","Enable ZIP archive support using minizip",True))
opts.Add(BoolVariable("xaudio2","Enable the XAudio2 audio driver",False))
opts.Add("custom_modules","A list of comma-separated directory paths containing custom modules to build.","")
# Advanced options
opts.Add(BoolVariable('verbose',"Enable verbose output for the compilation",False))
opts.Add(BoolVariable('progress',"Show a progress indicator during compilation",True))
opts.Add(EnumVariable('warnings',"Set the level of warnings emitted during compilation",'all',('extra','all','moderate','no')))
opts.Add(BoolVariable('werror',"Treat compiler warnings as errors. Depends on the level of warnings set with 'warnings'",False))
opts.Add(BoolVariable('dev',"If yes, alias for verbose=yes warnings=extra werror=yes",False))
opts.Add('extra_suffix',"Custom extra suffix added to the base filename of all generated binary files",'')
opts.Add(BoolVariable('vsproj',"Generate a Visual Studio solution",False))
opts.Add(EnumVariable('macports_clang',"Build using Clang from MacPorts",'no',('no','5.0','devel')))
opts.Add(BoolVariable('split_libmodules',"Split intermediate libmodules.a in smaller chunks to prevent exceeding linker command line size (forced to True when using MinGW)",False))
opts.Add(BoolVariable('disable_3d',"Disable 3D nodes for a smaller executable",False))
opts.Add(BoolVariable('disable_advanced_gui',"Disable advanced GUI nodes and behaviors",False))
opts.Add(BoolVariable('no_editor_splash',"Don't use the custom splash screen for the editor",False))
opts.Add('system_certs_path',"Use this path as SSL certificates default for editor (for package maintainers)",'')
opts.Add(BoolVariable("verbose","Enable verbose output for the compilation",False))
opts.Add(BoolVariable("progress","Show a progress indicator during compilation",True))
opts.Add(EnumVariable("warnings","Level of compilation warnings","all",("extra","all","moderate","no")))
opts.Add(BoolVariable("werror","Treat compiler warnings as errors",False))
opts.Add(BoolVariable("dev","If yes, alias for verbose=yes warnings=extra werror=yes",False))
opts.Add("extra_suffix","Custom extra suffix added to the base filename of all generated binary files","")
opts.Add(BoolVariable("vsproj","Generate a Visual Studio solution",False))
opts.Add(EnumVariable("macports_clang","Build using Clang from MacPorts","no",("no","5.0","devel")))
opts.Add(
BoolVariable(
"split_libmodules",
"Split intermediate libmodules.a in smaller chunks to prevent exceeding linker command line size (forced to True when using MinGW)",
False,
)
)
opts.Add(BoolVariable("disable_3d","Disable 3D nodes for a smaller executable",False))
opts.Add(BoolVariable("disable_advanced_gui","Disable advanced GUI nodes and behaviors",False))
opts.Add(BoolVariable("no_editor_splash","Don't use the custom splash screen for the editor",False))
opts.Add("system_certs_path","Use this path as SSL certificates default for editor (for package maintainers)","")
# Thirdparty libraries
opts.Add(BoolVariable('builtin_bullet',"Use the built-in Bullet library",True))
opts.Add(BoolVariable('builtin_certs',"Bundle default SSL certificates to be used if you don't specify an override in the project settings",True))
opts.Add(BoolVariable('builtin_enet',"Use the built-in ENet library",True))
opts.Add(BoolVariable('builtin_freetype',"Use the built-in FreeType library",True))
opts.Add(BoolVariable('builtin_libogg',"Use the built-in libogg library",True))
opts.Add(BoolVariable('builtin_libpng',"Use the built-in libpng library",True))
opts.Add(BoolVariable('builtin_libtheora',"Use the built-in libtheora library",True))
opts.Add(BoolVariable('builtin_libvorbis',"Use the built-in libvorbis library",True))
opts.Add(BoolVariable('builtin_libvpx',"Use the built-in libvpx library",True))
opts.Add(BoolVariable('builtin_libwebp',"Use the built-in libwebp library",True))
opts.Add(BoolVariable('builtin_wslay',"Use the built-in wslay library",True))
opts.Add(BoolVariable('builtin_mbedtls',"Use the built-in mbedTLS library",True))
opts.Add(BoolVariable('builtin_miniupnpc',"Use the built-in miniupnpc library",True))
opts.Add(BoolVariable('builtin_opus',"Use the built-in Opus library",True))
opts.Add(BoolVariable('builtin_pcre2',"Use the built-in PCRE2 library",True))
opts.Add(BoolVariable('builtin_pcre2_with_jit',"Use JIT compiler for the built-in PCRE2 library",True))
opts.Add(BoolVariable('builtin_recast',"Use the built-in Recast library",True))
opts.Add(BoolVariable('builtin_squish',"Use the built-in squish library",True))
opts.Add(BoolVariable('builtin_xatlas',"Use the built-in xatlas library",True))
opts.Add(BoolVariable('builtin_zlib',"Use the built-in zlib library",True))
opts.Add(BoolVariable('builtin_zstd',"Use the built-in Zstd library",True))
# opts.Add(BoolVariable('builtin_assimp', "Use the built-in Assimp library", True))
opts.Add(BoolVariable("builtin_bullet","Use the built-in Bullet library",True))
opts.Add(BoolVariable("builtin_certs","Use the built-in SSL certificates bundles",True))
opts.Add(BoolVariable("builtin_enet","Use the built-in ENet library",True))
opts.Add(BoolVariable("builtin_freetype","Use the built-in FreeType library",True))
opts.Add(BoolVariable("builtin_libogg","Use the built-in libogg library",True))
opts.Add(BoolVariable("builtin_libpng","Use the built-in libpng library",True))
opts.Add(BoolVariable("builtin_libtheora","Use the built-in libtheora library",True))
opts.Add(BoolVariable("builtin_libvorbis","Use the built-in libvorbis library",True))
opts.Add(BoolVariable("builtin_libvpx","Use the built-in libvpx library",True))
opts.Add(BoolVariable("builtin_libwebp","Use the built-in libwebp library",True))
opts.Add(BoolVariable("builtin_wslay","Use the built-in wslay library",True))
opts.Add(BoolVariable("builtin_mbedtls","Use the built-in mbedTLS library",True))
opts.Add(BoolVariable("builtin_miniupnpc","Use the built-in miniupnpc library",True))
opts.Add(BoolVariable("builtin_opus","Use the built-in Opus library",True))
opts.Add(BoolVariable("builtin_pcre2","Use the built-in PCRE2 library",True))
opts.Add(BoolVariable("builtin_pcre2_with_jit","Use JIT compiler for the built-in PCRE2 library",True))
opts.Add(BoolVariable("builtin_recast","Use the built-in Recast library",True))
opts.Add(BoolVariable("builtin_squish","Use the built-in squish library",True))
opts.Add(BoolVariable("builtin_xatlas","Use the built-in xatlas library",True))
opts.Add(BoolVariable("builtin_zlib","Use the built-in zlib library",True))
opts.Add(BoolVariable("builtin_zstd","Use the built-in Zstd library",True))
# Compilation environment setup
opts.Add("CXX","C++ compiler")
@ -176,68 +183,97 @@ for k in platform_opts.keys():
WARN_PRINT("Attempting to open an URL with the \"res://\" protocol. Use `ProjectSettings.globalize_path()` to convert a Godot-specific path to a system path before opening it with `OS.shell_open()`.");
}elseif(p_uri.begins_with("user://")){
WARN_PRINT("Attempting to open an URL with the \"user://\" protocol. Use `ProjectSettings.globalize_path()` to convert a Godot-specific path to a system path before opening it with `OS.shell_open()`.");
print_line("Hint: Leaked instances typically happen when nodes are removed from the scene tree (with `remove_child()`) but not freed (with `free()` or `queue_free()`).");
@ -1682,8 +1682,9 @@ int String::hex_to_int(bool p_with_prefix) const {
}else{
return0;
}
ERR_FAIL_COND_V_MSG(hex>INT32_MAX/16,sign==1?INT32_MAX:INT32_MIN,"Cannot represent "+*this+" as integer, provided value is "+(sign==1?"too big.":"too small."));
// Check for overflow/underflow, with special case to ensure INT32_MIN does not result in error
ERR_FAIL_COND_V_MSG(overflow,sign==1?INT32_MAX:INT32_MIN,"Cannot represent "+*this+" as integer, provided value is "+(sign==1?"too big.":"too small."));
ERR_FAIL_COND_V_MSG(hex >INT64_MAX/16,sign==1?INT64_MAX:INT64_MIN,"Cannot represent "+*this+" as 64-bit integer, provided value is "+(sign==1?"too big.":"too small."));
ERR_FAIL_COND_V_MSG(overflow,sign==1?INT64_MAX:INT64_MIN,"Cannot represent "+*this+" as 64-bit integer, provided value is "+(sign==1?"too big.":"too small."));
ERR_FAIL_COND_V_MSG(binary>INT64_MAX/2,sign==1?INT64_MAX:INT64_MIN,"Cannot represent "+*this+" as 64-bit integer, provided value is "+(sign==1?"too big.":"too small."));
// Check for overflow/underflow, with special case to ensure INT64_MIN does not result in error
ERR_FAIL_COND_V_MSG(overflow,sign==1?INT64_MAX:INT64_MIN,"Cannot represent "+*this+" as 64-bit integer, provided value is "+(sign==1?"too big.":"too small."));
binary*=2;
binary+=n;
s++;
@ -1788,8 +1790,8 @@ int String::to_int() const {
CharTypec=operator[](i);
if(c>='0'&&c<='9'){
ERR_FAIL_COND_V_MSG(integer >INT32_MAX/10,sign==1?INT32_MAX:INT32_MIN,"Cannot represent "+*this+" as integer, provided value is "+(sign==1?"too big.":"too small."));
ERR_FAIL_COND_V_MSG(overflow,sign==1?INT32_MAX:INT32_MIN,"Cannot represent "+*this+" as integer, provided value is "+(sign==1?"too big.":"too small."));
ERR_FAIL_COND_V_MSG(integer >INT64_MAX/10,sign==1?INT64_MAX:INT64_MIN,"Cannot represent "+*this+" as 64-bit integer, provided value is "+(sign==1?"too big.":"too small."));
ERR_FAIL_COND_V_MSG(overflow,sign==1?INT64_MAX:INT64_MIN,"Cannot represent "+*this+" as 64-bit integer, provided value is "+(sign==1?"too big.":"too small."));
integer*=10;
integer+=c-'0';
}elseif(integer==0&&c=='-'){
sign=-sign;
}
}
@ -1847,8 +1847,8 @@ int String::to_int(const char *p_str, int p_len) {
charc=p_str[i];
if(c>='0'&&c<='9'){
ERR_FAIL_COND_V_MSG(integer >INT32_MAX/10,sign==1?INT32_MAX:INT32_MIN,"Cannot represent "+String(p_str).substr(0,to)+" as integer, provided value is "+(sign==1?"too big.":"too small."));
ERR_FAIL_COND_V_MSG(overflow,sign==1?INT32_MAX:INT32_MIN,"Cannot represent "+String(p_str).substr(0,to)+" as integer, provided value is "+(sign==1?"too big.":"too small."));