Commit Graph

102 Commits

Author SHA1 Message Date
nova++ 1a3cb23955 Fix "File must be opened" error with File.open() 2022-04-13 08:51:07 -04:00
bruvzg 4bf99f4af2 Narrow FileAccess scope to prevent deadlocks. 2022-04-12 10:54:39 +03:00
bruvzg 9381acb6a4
Make FileAccess and DirAccess classes reference counted. 2022-04-11 13:28:51 +03:00
Rémi Verschelde abbb0dc082
Merge pull request #59548 from akien-mga/obj-remove-unused-categories 2022-03-28 14:17:24 +02:00
reduz 360dea5348 Add GDExtension support to Script
* Ability to create script languages from GDExtension
* Some additions to gdnative_extension.h to make this happen
* Moved the GDExtension binder to core

This now allows creating scripting languages from GDExtension, with the same ease as if it was a module. It replaces the old PluginScript from Godot 3.x.
Warning: GodotCPP will need to be updated to support this (it may be a bit of work as ScriptInstance needs to be created over there again).
2022-03-27 16:13:00 +02:00
Rémi Verschelde 5371009d8e Object: Remove unused category boilerplate
We might want to re-add something like this if/when we find a good use case
for it and do the effort to categorize all objects in the API properly.

Until then, it's better to remove that boilerplate since it's not needed.

Closes #18711.
2022-03-26 15:46:01 +01:00
reduz 2f651277da Add static method support to ClassDB
* Based on the work done for Variant in the past.
* Added `ClassDB::bind_static_method`
* Cleaned up ClassDB::bind_method to use variadic templates.

This adds support for having static methods in Object derived classes.
Note that this does not make it work yet in GDScript or Mono and, while it works for GDExtension, GodotCPP needs to be updated.
2022-03-22 16:27:34 +01:00
Rémi Verschelde 768f9422bc Convert uses of `DirAccess *` to `DirAccessRef` to prevent memleaks
`DirAccess *` needs to be deleted manually, and this is often forgotten
especially when doing early returns with `ERR_FAIL_COND`.
`DirAccessRef` is deleted automatically when it goes out of scope.

Co-authored-by: bruvzg <7645683+bruvzg@users.noreply.github.com>
2022-03-11 09:13:11 +01:00
Rémi Verschelde 6c3170e875
Merge pull request #57930 from piiertho/bugfix/add-none-flag-to-resource-saver 2022-03-07 12:05:35 +01:00
Pierre-Thomas Meisels f9d4f08090 Fix ResourceSaver::save method exposition flag parameter
enh: Add FLAG_NONE to SaverFlags in ResourceSaver to fix api inconsistency
fix: flags parameter of ResourceSaver::save is now uint32_t to allow flag composition in scripts
2022-03-07 10:39:51 +01:00
Rémi Verschelde b8b4580448
Style: Cleanup single-line blocks, semicolons, dead code
Remove currently unused implementation of TextureBasisU, could be re-added
later on if needed and ported.
2022-02-16 14:06:29 +01:00
Hugo Locurcio ee7cd9a3a1
Add an `OS.get_processor_name()` method
This method can be used to get the CPU model name.
It can be used in conjunction with
`RenderingServer.get_video_adapter_name()` and
`RenderingServer.get_video_adapter_vendor()` for annotating benchmarks
and automatic graphics quality configuration.
2022-02-15 20:55:53 +01:00
Hendrik Brucker b396fd4eef Improve compilation speed (forward declarations/includes cleanup) 2022-02-12 02:46:22 +01:00
Fabio Alessandrelli 789e648f4d [Debugger] New extensible EngineProfiler class.
Uses GDExtension, replaces old Callable system for profilers, and is
also used internally.
2022-02-06 17:33:45 +01:00
strank 88eb9f7aef Delete orphaned property default for exit_code which is not exposed any more. 2022-01-19 23:25:54 -05:00
Rémi Verschelde 8bdef23f7f
Merge pull request #56012 from bruvzg/wt🤎4 2022-01-17 13:26:15 +01:00
Anilforextra 6c3a0460a8 Use List Initializations for Vectors. 2022-01-12 10:15:12 +05:45
Rémi Verschelde fcc2648e18
Fix missing arg name in bindings for GDExtension API 2022-01-07 14:24:06 +01:00
kobewi ec94ceba14 Fix method validation in Thread 2022-01-04 14:44:47 +01:00
Rémi Verschelde fe52458154
Update copyright statements to 2022
Happy new year to the wonderful Godot community!
2022-01-03 21:27:34 +01:00
luz paz a124f1effe Fix various typos
Found via ` codespell -q 3 -S ./thirdparty,*.po,./DONORS.md -L ackward,ang,ans,ba,beng,cas,childs,childrens,dof,doubleclick,expct,fave,findn,gird,hist,inout,leapyear,lod,nd,numer,ois,ony,paket,seeked,sinc,switchs,te,uint,varn`
Update editor/import/resource_importer_layered_texture.cpp

Co-authored-by: Raul Santos <raulsntos@gmail.com>
Update doc/classes/TileSetScenesCollectionSource.xml

Co-authored-by: Raul Santos <raulsntos@gmail.com>
Update scene/gui/graph_edit.cpp

Co-authored-by: Raul Santos <raulsntos@gmail.com>
Update scene/resources/animation.cpp

Co-authored-by: Raul Santos <raulsntos@gmail.com>
Update scene/resources/animation.cpp

Co-authored-by: Raul Santos <raulsntos@gmail.com>
Update scene/resources/animation.cpp

Co-authored-by: Raul Santos <raulsntos@gmail.com>
Update scene/gui/rich_text_label.cpp

Co-authored-by: Raul Santos <raulsntos@gmail.com>
Revert previously committed change
2022-01-02 01:03:58 -05:00
bruvzg ea5bb8b47d
[Windows] Improve console handling and execute/create_process.
Always build with the GUI subsystem.
Redirect stdout and stderr output to the parent process console.
Use CreateProcessW for blocking `execute` calls with piped stdout and stderr (prevent console windows for popping up when used with the GUI subsystem build, and have more consistent behavior with `create_process`).
Add `open_console` argument to the `execute` and `create_process` to open a new console window.
Remove `interface/editor/hide_console_window` editor setting.
Remove `Toggle System Console` menu option.
Remove `set_console_visible` and `is_console_visible` functions.
2021-12-18 10:14:07 +02:00
Tomasz Chabora d04c2a554f Improve Directory content navigation 2021-12-10 17:24:04 +01:00
Nathan Franke 49403cbfa0
Replace String comparisons with "", String() to is_empty()
Also:
- Adds two stress tests to test_string.h
- Changes to .empty() on std::strings
2021-12-09 04:48:38 -06:00
Hugo Locurcio 5761b90f3c
Add an `OS.crash()` method for testing system crash handler
This makes it possible to test the system's crash handler without
having to modify engine code or exploit an engine bug.
2021-12-03 22:11:46 +01:00
Brian Semrau c558263d84 Expose Thread::get_main_id in core bindings 2021-11-12 19:28:49 -05:00
Aaron Franke 3c0fdcc8ac
Use "enum class" for input enums 2021-11-12 15:37:54 -06:00
bruvzg 0b6b8427c8 [macOS] Add `create_instance` function to spawn editor copies.
[macOS] Modify `create_project` function to detect and run app bundles using NSWorkspace to ensure app window is registered and activated correctly.
2021-11-01 11:48:23 +02:00
Clay John 8a10bb7d0d
Use OpenGL 3.3 core profile instead of compatibility profile
- Rename OpenGL to GLES3 in the source code per community feedback.
  - The renderer is still exposed as "OpenGL 3" to the user.
- Hide renderer selection dropdown until OpenGL support is more mature.
  - The renderer can still be changed in the Project Settings or using
    the `--rendering-driver opengl` command line argument.
- Remove commented out exporter code.
- Remove some OpenGL/DisplayServer-related debugging prints.
2021-10-31 15:56:45 +01:00
Hugo Locurcio ce97ddbcb1
Rename GLES2 driver to OpenGL to prepare for the upgrade to GLES3
- Use lowercase driver names for the `--rendering-driver`
  command line argument.
2021-10-30 02:05:49 +02:00
unknown 73c5e07051 Added better descriptive error messages for file operations in core_bind.cpp 2021-10-18 02:09:42 +05:30
Brian Semrau f28c677f3d [core_bind] Add `is_alive` to Thread. Replace `is_active` with `is_started`.
Replacing `is_active` resolves an API discrepancy between core_bind Thread and core/os Thread.
2021-10-06 12:47:58 -04:00
Rémi Verschelde 90f8eb7aa0
Merge pull request #53059 from timothyqiu/thread-obj
Fix crash when creating thread
2021-10-02 02:15:43 +02:00
Lightning_A c63b18507d Use range iterators for `Map` 2021-09-30 15:09:12 -06:00
Haoyu Qiu 40e188f687 Fix crash when creating thread 2021-09-29 22:08:12 +08:00
Rémi Verschelde ed5267f69f
Merge pull request #53053 from LATRio/callable_in_thread_start 2021-09-28 11:10:09 +02:00
Hennadii Chernyshchyk dbb37e586b
Fix inversed check inside register_singleton 2021-09-28 00:17:31 +03:00
LATRio 97c68514c4 Use Callable in Thread::start 2021-09-25 22:07:13 +09:00
Hugo Locurcio 2560070c0a
Remove `Engine.editor_hint` in favor of `Engine.is_editor_hint()`
The `Engine.set_editor_hint()` setter method is no longer exposed
to scripting, which makes the property effectively read-only from
an user perspective.
2021-09-20 14:24:39 +02:00
Rémi Verschelde def99c7baf
Implement `OS::get_locale_language()` helper method
This method extracts the 2 or 3-letter language code from `OS::get_locale()`,
making it easier for users to identify the "main" language code for users
that might have different OS locales due to different OS or region, but
should be matched to the same translation (e.g. "generic" Spanish).

Fixes #40703.
2021-09-16 09:34:58 +02:00
Haoyu Qiu d2aef4c439 Expose enum related methods in ClassDB 2021-09-11 20:33:05 +08:00
Wilson E. Alvarez d11c1afc04
Rename String::is_rel_path to String::is_relative_path 2021-08-29 20:41:29 -04:00
reduz e2f8df8c5b Add ability to register singletons from engine API
* Exposed functions in Engine to register and unregister singletons.
* Added the concept of user singletons, which can be removed (the system ones can't).
2021-08-25 08:32:25 -03:00
Rémi Verschelde de7b6d13eb
Merge pull request #51627 from mhilbrunner/todo-for-neikeq 2021-08-18 20:13:50 +02:00
Max Hilbrunner 81f7d1890b Namespaces instead of underscore prefix for binds
Thanks to neikeq for the initial work.

Co-authored-by: Ignacio Roldán Etcheverry <neikeq@users.noreply.github.com>
2021-08-17 16:10:09 +02:00
Rémi Verschelde 913a7a63d5
Merge pull request #51793 from KoBeWi/direnam
Fix renaming directories
2021-08-17 16:06:30 +02:00
kobewi 0dde3e5b59 Fix renaming directories 2021-08-17 14:38:48 +02:00
ne0fhyk 3a00ff1cce Add partial support for Android scoped storage.
This is done by providing API access to app specific directories which don't have any limitations and allows us to bump the target sdk version to 30.
In addition, we're also bumping the min sdk version to 19 as version 18 is no longer supported by Google Play Services and only account of 0.3% of Android devices.
2021-08-16 23:11:56 -07:00
Hugo Locurcio 937c1a716c
Rename `iterations_per_second` to `physics_ticks_per_second`
This makes it clearer that this property is only about physics FPS,
not rendering FPS.

The `physics_fps` project setting was also renamed to
`physics_ticks_per_second` for consistency.
2021-08-11 02:37:02 +02:00
Aaron Franke 84f720966c
Use doubles for time in many other places 2021-08-09 14:05:42 -05:00