Commit graph

212 commits

Author SHA1 Message Date
Pedro J. Estébanez 496d8f19fc Let memory stat functions return uint64_t 2019-01-30 19:07:46 +01:00
Rémi Verschelde b16c309f82 Update copyright statements to 2019
Happy new year to the wonderful Godot community!
2019-01-01 12:58:10 +01:00
volzhs 84d060c768 Added OS.get_system_time_msecs() 2018-12-20 18:50:50 +09:00
bruvzg 4554c682e6
Changes IME input to use notification instead of callback, exposes IME methods to gdscript/gdnative. 2018-11-23 14:07:48 +02:00
Kanabenki 48166a9f3c Add store_csv_line method for File 2018-11-16 11:09:05 +01:00
Marcelo Fernandez 4de0cbba15 Expose OS::move_window_to_foreground 2018-11-07 11:51:15 -03:00
Andrii Doroshenko (Xrayez) 31f6fad90e Bind missing subresource flag in ResourceSaver 2018-10-18 17:58:44 +03:00
Rémi Verschelde 277b24dfb7 Make core/ includes absolute, remove subfolders from include path
This allows more consistency in the manner we include core headers,
where previously there would be a mix of absolute, relative and
include path-dependent includes.
2018-09-12 09:52:22 +02:00
Juan Linietsky c6b340ea98
Merge pull request #20712 from marcelofg55/midi_open_close
Add OS::open_midi_inputs and OS::close_midi_inputs
2018-08-24 12:17:14 -03:00
RaphaelHunter 43825dce47 fix #20390 :get_unix_time_from_datetime and get_date_time_from_unix_time can handle time before year 1970 now 2018-08-13 15:37:27 +08:00
Rémi Verschelde d29ea4337f Fix ResourceLoader::exists() false negative and readd deprecated has() 2018-08-12 12:44:38 +02:00
Juan Linietsky 852378109f Added function ResourceLoader.exists(), to check if a resource exists. Closes #19140 2018-08-10 15:57:43 -03:00
Juan Linietsky ea3d997f9d
Revert "added get_creation_time function for gdscript" 2018-08-10 13:29:49 -03:00
Juan Linietsky 275e0d5ee4
Merge pull request #18914 from notwarp/master
added get_creation_time function for gdscript
2018-08-10 13:28:47 -03:00
Marcelo Fernandez 05fc12ddb6 Add OS::open_midi_inputs and OS::close_midi_inputs 2018-08-04 10:07:46 -03:00
Marcelo Fernandez 7a5f9fc08e Added a new MIDIDriver class 2018-07-21 09:09:42 -03:00
Marc Gilleron 4705dc4f00 Expose OS.get_ticks_usec() 2018-06-18 21:03:55 +02:00
Saracen c5bdb5b1d8 IME context detection. 2018-06-11 17:22:11 +01:00
Ibrahn Sahir 1433c2cbbb GDScript access to copyright, license, author and donor information.
Adds following functions to the Engine singleton:
get_author_info - names of Godot authors
get_copyright_info - detailed source copyright get_license_info
get_donor_info - donor names
get_license_info - full text of licenses used, indexed by license names
get_license_text - the text of the Godot Expat license
2018-05-19 00:40:16 +01:00
Daniele Giuliani d315b0fb8a added get_creation_time function for gdscript 2018-05-16 00:50:57 +02:00
Hein-Pieter van Braam e668757aa9
Merge pull request #14622 from bruvzg/non-rectangular-windows
Experimental support for windows with per-pixel transparency.
2018-05-08 16:44:35 +02:00
Juan Linietsky 633bbdb231
Merge pull request #17353 from zmanuel/timer_hysteresis_multiframe_pr1
Use hysteresis for smoother physics update frequency
2018-05-07 19:27:32 -03:00
Juan Linietsky 69a96ff4a6
Merge pull request #15943 from poke1024/geometry-line-line
Add Geometry::line_intersects_line_2d()
2018-05-07 17:54:33 -03:00
Ruslan Mustakov 1d9a3a9b1c iPhone X support and iOS-related fixes
Starting from April 2018 Apple no longer accepts apps that do not
support iPhone X. For games this mainly means respecting the safe area,
unobstructed by notch and virtual home button. UI controls must be
placed within the safe area so that users can interact with them.

This commit:

- Adds OS::get_window_safe_area method that returns unobscured area of
  the window, where interactive controls should be rendered.

- Reorganizes how launch screens are exported - the previous way was
  incorrect and modern iPhones did not pick up the correct screens and
  because of that used a non-native resolution to render the game.

- Adds launch screen options for iPhone X.

- Makes launch screens optional in the export template. If not
  specified, a white screen will be used.

- Adds App Store icon (1024x1024) export option as it now has to be
  bundled with the app instead of being provided in iTunes Connect.

- Fixes crash when launching games in iOS Simulator. It happened because
  controllerWasConnected callback came before the engine was
  initialized. Now in such case the controllers will be queued up and
  registered after initialization is done.

- Fixes issue with the virtual keyboard where for some reason
  autocorrection panel would intersect with the keyboard itself and not
  allow you to use the top row of the keyboard. This is fixed by
  disabling autocorrection altogether.

Closes #17358. Fixes #17428. Fixes #17331.
2018-04-11 14:53:24 +07:00
Manuel Moos d5abd4eb75 Add hysteresis to physics timestep count per frame
Add new class _TimerSync to manage timestep calculations.
The new class handles the decisions about simulation progression
previously handled by main::iteration(). It is fed the current timer
ticks and determines how many physics updates are to be run and what
the delta argument to the _process() functions should be.

The new class tries to keep the number of physics updates per frame as
constant as possible from frame to frame. Ideally, it would be N steps
every render frame, but even with perfectly regular rendering, the
general case is that N or N+1 steps are required per frame, for some
fixed N. The best guess for N is stored in typical_physics_steps.

When determining the number of steps to take, no restrictions are
imposed between the choice of typical_physics_steps and
typical_physics_steps+1 steps. Should more or less steps than that be
required, the accumulated remaining time (as before, stored in
time_accum) needs to surpass its boundaries by some minimal threshold.
Once surpassed, typical_physics_steps is updated to allow the new step
count for future updates.

Care is taken that the modified calculation of the number of physics
steps is not observable from game code that only checks the delta
parameters to the _process and _physics_process functions; in addition
to modifying the number of steps, the _process argument is modified as
well to stay in expected bounds. Extra care is taken that the accumulated
steps still sum up to roughly the real elapsed time, up to a maximum
tolerated difference.

To allow the hysteresis code to work correctly on higher refresh
monitors, the number of typical physics steps is not only recorded and
kept consistent for single render frames, but for groups of them.
Currently, up to 12 frames are grouped that way.

The engine parameter physics_jitter_fix controls both the maximum
tolerated difference between wall clock time and summed up _process
arguments and the threshold for changing typical_physics_steps. It is
given in units of the real physics frame slice 1/physics_fps. Set
physics_jitter_fix to 0 to disable the effects of the new code here.
It starts to be effective against the random physics jitter at around
0.02 to 0.05. at values greater than 1 it starts having ill effects on
the engine's ability to react sensibly to dropped frames and framerate
changes.
2018-04-09 22:27:29 +02:00
bruvzg ddae098dee
Experimental support for windows with per-pixel transparency (macOS, X11 and Windows). 2018-04-07 17:11:45 +03:00
Marcelo Fernandez a4e64c5454 Added File.get_path and File.get_path_absolute functions 2018-03-13 12:07:37 -03:00
Marcelo Fernandez d780d774aa Clean and expose get_audio/video_driver_* funcs on OS class 2018-03-04 14:18:05 -03:00
Rémi Verschelde e0f43e0678
Merge pull request #15564 from RandomShaper/adpod-topmost
Add new window setting: always on top
2018-02-14 16:43:40 +01:00
Marcelo Fernandez ea1d726a46 Added OS::center_window to center the window precisely on desktop platforms 2018-02-12 15:45:41 -03:00
Bernhard Liebl c1e099b48f Add Geometry::line_intersects_line_2d() 2018-01-21 15:31:34 +01:00
Paul Joannon a066f896d8 get_target_fps and set_target_fps now both use an int 2018-01-12 14:26:21 +01:00
Pedro J. Estébanez ee2c31d306 Add new window setting: always on top
Implemented for Windows and Linux.
2018-01-05 21:31:04 +01:00
Rémi Verschelde e4213e66b2 Add missing copyright headers and fix formatting
Using `misc/scripts/fix_headers.py` on all Godot files.
Some missing header guards were added, and the header inclusion order
was fixed in the Bullet module.
2018-01-05 01:22:23 +01:00
Rémi Verschelde b50a9114b1 Update copyright statements to 2018
Happy new year to the wonderful Godot community!
2018-01-01 14:40:47 +01:00
Rémi Verschelde e6f3253f7d
Merge pull request #12603 from GodotExplorer/beautify-json
Add indent and sort keys support for JSON.print
2017-12-06 23:53:05 +01:00
Rémi Verschelde 73049d115e Rename OS::get_data_dir to OS::get_user_data_dir
Will be needed to avoid confusion with system data path (XDG_DATA_HOME)
and editor data dir in upcoming refactoring.
2017-11-17 20:55:09 +01:00
Leon Krause 9b7b46143d Move singleton management from ProjectSettings to Engine 2017-11-14 15:15:13 +01:00
Geequlim f7168bf217 Add indent and sort keys support for JSON.print 2017-11-07 11:52:45 +08:00
Bernhard Liebl 7ec32b6d09 Basic docs for Geometry plus two new functions 2017-11-05 07:56:27 +01:00
Gilles Roudiere 5b9b158354 Merge pull request #11823 from endragor/virtual-keyboard-height
Allow to obtain virtual keyboard height
2017-10-04 18:16:28 +02:00
Ruslan Mustakov 275e537058 Allow to obtain virtual keyboard height
On mobile platforms virtual keyboards take up significant amount of
screen space and UI containing a text box may need to be adjusted
after the keyboard appears to keep the text box visible to user. This
commit adds a way to obtain virtual keyabord height so that controls
are aware of how much they need to move.
2017-10-04 17:21:05 +07:00
Juan Linietsky 3cadecf17b fixed the OS.has_feature() API, and added support for 32 and 64. 2017-10-03 17:36:14 -03:00
Hein-Pieter van Braam 2bece6bbd3 Merge pull request #11782 from eska014/persistent-userfs-test
Add OS::is_userfs_persistent, allow starting HTML5 platform in private mode
2017-10-03 12:24:11 +02:00
Leon Krause 7b23665e72 Add OS::is_userfs_persistent to check user:// persistence
Allows starting HTML5 export when IndexedDB is not available.
2017-10-02 21:07:05 +02:00
AndreaCatania 4537977d6d Renamed fixed_process to physics_process 2017-09-30 16:19:07 +02:00
letheed 5ad9be4c24 Rename pos to position in user facing methods and variables
Rename user facing methods and variables as well as the corresponding
C++ methods according to the folloming changes:

* pos -> position
* rot -> rotation
* loc -> location

C++ variables are left as is.
2017-09-20 13:11:10 +02:00
Thomas Herzog 41715c1e8f Merge pull request #11294 from karroffel/json-object
added JSON singleton
2017-09-17 16:31:27 +02:00
Ignacio Etcheverry f1f8fd1b68 Adds _OS::PowerState enum 2017-09-16 12:28:23 +02:00
karroffel 308d20aba5 added JSON singleton
There was no way to access JSON functionality in scripting languages
apart from GDScript because the JSON class wasn't exposed to ClassDB.
2017-09-15 15:40:27 +02:00
Maxim Sheronov 0fffa45158 Fix enums bindings
Add missed bindings for enums
Move some enums to class to have correct output of api.json
2017-09-13 20:57:07 +03:00
Rémi Verschelde bd282ff43f Use HTTPS URL for Godot's website in the headers 2017-08-27 14:16:55 +02:00
Rémi Verschelde 7f49e2a7a0 Merge pull request #10487 from marcelofg55/curscr_as_default
p_screen param from get_screen_* funcs now default to the current screen
2017-08-22 08:12:04 +02:00
Juan Linietsky 2cc8309249 Merge pull request #10351 from neikeq/enums-are-for-the-weak
ClassDB: Provide the enum name of integer constants
2017-08-21 19:56:08 -03:00
Marcelo Fernandez 63f847b306 p_screen param from get_screen_* funcs now default to the current screen 2017-08-21 18:28:29 -03:00
Rémi Verschelde 93f1fb1c2f Fixes for new two-dash long command line arguments
- Fixes some single-dash leftovers that were missed in the previous commit
- Reorder the help output for clarity, and document missing options
- Drop obsolete options: --noop, --pack, --editor-scene, --level, --import, --import-script, --no-quit
- Improve error message on malformed arguments and do not display help on error
- Always use long form of arguments when starting a new Godot process from C++, for clarity and easy grepping
- Cleanup obsolete code here and there
2017-08-21 08:09:22 +02:00
Ignacio Etcheverry 32dd9a9f66 ClassDB: Provide the enum name of integer constants 2017-08-20 22:07:43 +02:00
Juan Linietsky 541fdffc0a Merge pull request #10319 from neikeq/pr-engine-editor-hint
Adds Engine::is_editor_hint() method
2017-08-20 12:55:46 -03:00
Juan Linietsky b9dcebb37c Revert "Second take at making command-line arguments more UNIX-like + main.cpp and help cleanup" 2017-08-19 17:47:27 -03:00
Rémi Verschelde 70b0857f6c Fixes for new two-dash long command line arguments
- Fixes some single-dash leftovers that were missed in the previous commit
- Reorder the help output for clarity, and document missing options
- Drop obsolete options: --noop, --pack, --editor-scene, --level, --import, --import-script, --no-quit
- Improve error message on malformed arguments and do not display help on error
- Cleanup obsolete code here and there
2017-08-19 16:48:11 +02:00
Ignacio Etcheverry fd69604bd9 Adds editor_hint to Engine class 2017-08-19 01:03:12 +02:00
TwistedTwigleg 00f6c85928 Synchronize parameter names in definition and declaration
Fixes #10244.
2017-08-16 17:22:23 +02:00
Indah Sylvia 5ae78fdf6a Makes all Godot API's methods Lower Case 2017-08-07 18:24:35 +07:00
George Marques 0f765c86e5
Add GZIP compression support
- Fix a wrong call in PoolByteArray::compress
2017-07-13 14:41:10 -03:00
geequlim 7358766ff6 IME window follow the input cursor.
Abstruct set_ime_position to OS class.
Update ime position for LineEdit and TextEdit.
2017-07-11 18:36:20 +08:00
George Marques 5c779c574a
Add compression support for File object 2017-06-19 16:38:37 -03:00
kubeczek a81b706e09 Fixed thread check, solves: #3698 2017-06-13 17:49:28 +02:00
Juan Linietsky 98a3296702 Removal of Image from Variant, converted to a Resource. 2017-05-17 07:37:45 -03:00
Sergey Pusnei 8589ca3903 Rename [gs]et_pos to [gs]et_position for Controls
Control set_pos -> set_position
Control set_global_pos -> set_global_position
[gs]et_mouse_pos -> [gs]et_mouse_position
[gs]et_global_mouse_pos -> [gs]et_global_mouse_position
fixes #8005
2017-04-10 08:27:34 +02:00
Rémi Verschelde f29dc079dc Merge pull request #8333 from touilleMan/classdb-class_sget_property-binding
Add _ClassDB.class_[g|s]et_property to ClassDB exposed methods
2017-04-09 17:46:35 +02:00
Emmanuel Leblond 23c310be7b
Add _ClassDB.class_[g|s]et_property to ClassDB exposed methods 2017-04-09 13:27:07 +02:00
Rémi Verschelde df61dc4b2b Add "Godot Engine contributors" copyright line 2017-04-08 00:11:42 +02:00
Rémi Verschelde 5dbf1809c6 A Whole New World (clang-format edition)
I can show you the code
Pretty, with proper whitespace
Tell me, coder, now when did
You last write readable code?

I can open your eyes
Make you see your bad indent
Force you to respect the style
The core devs agreed upon

A whole new world
A new fantastic code format
A de facto standard
With some sugar
Enforced with clang-format

A whole new world
A dazzling style we all dreamed of
And when we read it through
It's crystal clear
That now we're in a whole new world of code
2017-03-05 16:44:50 +01:00
Rémi Verschelde e6952cad3a Merge pull request #7950 from RandomShaper/expose-more-geom
Expose uncapped versions of closest-point-to-segment utilities
2017-03-05 12:04:23 +01:00
Pedro J. Estébanez 0e0b6ec443 Expose uncapped versions of closest-point-to-segment utilities 2017-03-04 23:02:27 +01:00
Julian Murgia 94103c0c02 Add API to access battery power state
Done:
- X11, server (tested)
- Windows (developed, would be nice to retest)
- OSX (not tested)
Prepared (not developed):
- Android (code is here, but may not compile)
- iphone
- winrt
- bb10
- haiku
- javascript
2017-03-04 18:04:29 +01:00
Pedro J. Estébanez eaa6433b3b Expose Geometry::get_closest_point_to_segment_2d() 2017-03-04 01:55:12 +01:00
Juan Linietsky 96de0141cc Removed import/export system, will start new one from scratch. 2017-01-25 21:57:08 -03:00
Rémi Verschelde 831d9b925a Merge pull request #7563 from RayKoopa/extended_list_dir_begin
Add parameters to Directory.list_dir_begin() to skip navigational or hidden entries
2017-01-25 20:22:34 +01:00
Ray Koopa 1ce9bbc8ed Added parameters to skip hidden and/or navigational file system entries 2017-01-24 21:07:02 +01:00
Andreas Haas 5ec0610c60
Add ClassDB binding for File.get_modified_time
Closes #7613
2017-01-23 22:33:58 +01:00
Rémi Verschelde ce99286362 Merge pull request #7524 from neikeq/pr-dir-getcurdrive
Directory: Bind get_current_drive() method
2017-01-14 17:22:06 +01:00
Ignacio Etcheverry 0b2ae7313b Directory: Bind get_current_drive() method 2017-01-14 17:20:16 +01:00
Juan Linietsky da4170540c Fixed dir access return value, changed it to Error like all other funcs 2017-01-14 09:17:15 -03:00
Rémi Verschelde d2aae675e9 Replace Engine version API by preexisting OS one
It outputs a single Dictionary with all relevant information as
keys, that will less bloat the documentation and provide all details
in one function call.
2017-01-13 18:25:49 +01:00
Juan Linietsky e53c247cb1 Created new Engine singleton, and moved engine related OS functions to it. 2017-01-13 12:51:14 -03:00
Juan Linietsky bc26f90581 Type renames:
Matrix32 -> Transform2D
	Matrix3 -> Basis
	AABB -> Rect3
	RawArray -> PoolByteArray
	IntArray -> PoolIntArray
	FloatArray -> PoolFloatArray
	Vector2Array -> PoolVector2Array
	Vector3Array -> PoolVector3Array
	ColorArray -> PoolColorArray
2017-01-11 00:52:51 -03:00
Rémi Verschelde 9856843717 Merge pull request #7462 from karroffel/error_code
expose OS.set_exit_code and OS.get_exit_code to ClassDB
2017-01-10 15:29:39 +01:00
Juan Linietsky 2ab83e1abb Memory pool vectors (DVector) have been enormously simplified in code, and renamed to PoolVector 2017-01-07 18:26:38 -03:00
karroffel fbfcc981d9 exposed OS.set_exit_code and OS.get_exit_code to ClassDB 2017-01-07 18:55:48 +01:00
Juan Linietsky 118eed485e ObjectTypeDB was renamed to ClassDB. Types are meant to be more generic to Variant.
All usages of "type" to refer to classes were renamed to "class"
ClassDB has been exposed to GDScript.
OBJ_TYPE() macro is now GDCLASS()
2017-01-02 23:03:46 -03:00
Rémi Verschelde c7bc44d5ad Welcome in 2017, dear changelog reader!
That year should bring the long-awaited OpenGL ES 3.0 compatible renderer
with state-of-the-art rendering techniques tuned to work as low as middle
end handheld devices - without compromising with the possibilities given
for higher end desktop games of course. Great times ahead for the Godot
community and the gamers that will play our games!
2017-01-01 22:03:33 +01:00
ISylvox b5c383fd61 vsnc --> vsync 2016-11-08 21:06:57 +07:00
Ignacio Etcheverry 6d6d9bc7f9 Core: Add singleton instance to _Marshalls 2016-11-05 17:13:04 +01:00
Rémi Verschelde c57b992774 Merge pull request #5847 from 29jm/patch-3
Expose virtual keyboard functions to GDScript
2016-07-22 08:39:07 +02:00
Johan Manuel ec8c6e2c7c Expose virtual keyboard functions to GDScript 2016-07-21 23:58:58 +02:00
Rémi Verschelde d723e5a62f Merge pull request #5560 from vnen/os-request-attention
Add OS.request_attention() for Windows
2016-07-21 17:29:45 +02:00
Rémi Verschelde b2953bc1cc OS: Add get_engine_version method
Fixes #5693.
2016-07-18 00:54:56 +02:00
George Marques 5c355a63d3
Add OS.request_attention() for Windows 2016-07-05 12:29:08 -03:00
SuperUserNameMan 7a142780f0 windows get_latin_keyboard_variant() implementation and gdscript binding 2016-07-03 19:35:13 +02:00