Commit Graph

226 Commits

Author SHA1 Message Date
Rémi Verschelde 0eab0d9343 Update copyright statements to 2019
Happy new year to the wonderful Godot community!
2019-01-03 11:41:35 +01:00
Hugo Locurcio 403f7dc35f Change ".." punctuation for "..." in editor strings (#16507)
(cherry picked from commit 1c419531a0)
2018-06-05 21:42:33 +02:00
bruvzg db76c54117 Fix Linux/X11 build on ARMs.
(cherry picked from commit ce64c2a32e)
2018-05-13 21:45:09 +02:00
Gustav Lund a6c9527c2f Fix for large .pck files
An error in unix file IO was causing crashes when getting the size of a file larger than max integer size
As ftell returns a long the fix is trivial

(cherry picked from commit 8a7840a304)
2018-05-08 09:10:26 +02:00
Robin Hübner 4866733a74 GDNative Unix: fix shared lib loading, dlopen expects leading ./ to interpret as relative path.
(cherry picked from commit 8287441955)
2018-05-01 22:07:02 +02:00
Marcelo Fernandez 272fb05270 Added File.get_path and File.get_path_absolute functions
(cherry picked from commit a4e64c5454)
2018-04-29 15:09:29 +02:00
Poommetee Ketson 2f82b67071 [DOCS] add HTTPRequest.request return values
(cherry picked from commit f05e24ed18)
2018-04-29 14:32:44 +02:00
Poommetee Ketson 55a66efa38 Fix get_drive (bookmarks) in linux not working
(cherry picked from commit 7e5b10b7d3)
2018-03-28 22:13:39 +02:00
Artem Varaksa eacd66e784 Clean up some bad words from code comments
(cherry picked from commit d35e486228)
2018-02-22 12:22:41 +01:00
Iskustvo 4bdcee2b9d [X11] Improving error detection in move_to_trash
(cherry picked from commit 268d7c7c5b)
2018-02-19 22:20:06 +01:00
Marcin Zawiejski d4a70c6c08 fix buffer write performance on Windows and Unix
(cherry picked from commit 8315aa40cc)
2018-02-19 22:13:45 +01:00
Marlon Henry Schweigert 5481ece976 Display set_nodelay to GDScript
Pass enabled arg

Rename set_nodelay to set_no_delay

Add description to the method

Change description

(cherry picked from commit 87adf9cfba)
2018-02-04 20:02:04 +01:00
sambler 384055c86f Fix use of execvp, earlier fix was short sighted and only worked
when godot could be found in PATH.
The correct fix is to use sysctl to get the path to the current executable
this also fixes the ability to call external commands.
2018-01-08 12:07:28 +10:30
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
Juan Linietsky 6e2ed15ff1 Add support from properly exporting shared objects, needed for GDNative export 2018-01-04 15:43:06 -03:00
Emmanuel Leblond e315c94900 Change OS::initialize signature to return Error (fix segfault on x11) 2018-01-04 15:15:55 +01:00
Rémi Verschelde d65ac7378c Fix crash in OS::execute on FreeBSD
As spotted by @robfram, closes #15288.
Also reviewed other uses of `if (String.find(.*))` for potential similar mistakes, found a wrong (and useless) one in ScriptEditorDialog.
2018-01-04 01:20:20 +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
Fabio Alessandrelli 92067b4714 Remove "const" from PacketPeer get_packet/get_var
They are NOT constant methods, as state by the comment message,
they fetch the last packet and then forget about it, actively
changing the state of the object.
2017-12-15 17:14:17 +01:00
Rémi Verschelde 7908dc322a Drop unused OS_Unix::has_data and related logic
Closes #5536.
2017-12-10 17:05:24 +01:00
Rémi Verschelde 13c2ff9320 Style: Apply new clang-format 5.0 style to all files 2017-12-07 08:02:00 +01:00
Rémi Verschelde d5ca9e2f6f Style: Apply clang-format again on all files
Fixes issues introduced by newer clang-format versions or commits
pushed directly without using the clang-format pre-commit hook.
2017-12-07 08:02:00 +01:00
Unknown fd1b94e307 Improve slang, especially in user-visible parts 2017-12-05 15:41:38 +01:00
Juan Linietsky 9678231b10 Changed the dynamic library open function to allow setting the path of the library to open extra libraries. 2017-11-30 10:00:55 -03:00
Rémi Verschelde af9c67db0c Allow customizing user:// path (folder in OS::get_data_path())
This allows to specify any valid folder name (including with subfolders) to use
as user:// on all platforms. The folder is constrained to the platform-specific
OS::get_data_path() (typically what `XDG_DATA_HOME` resolves to).

Fixes #13236.
2017-11-26 19:02:32 +01:00
Ruslan Mustakov d42c5646a5 Return and repair file logging
And make it configurable, too.
2017-11-21 16:43:44 +07:00
Rémi Verschelde 32c12a92a5 Add initial support for the XDG Base Directory spec
Spec version 0.7 from https://standards.freedesktop.org/basedir-spec/basedir-spec-0.7.html
(latest as of this commit).

Three virtual methods are added to OS for the various XDG paths we will use:
- OS::get_data_path gives XDG_DATA_HOME, or if missing:
  ~/.local/share on X11, ~/Library/Application Support/ on macOS and %APPDATA% on Windows
- OS::get_config_path gives XDG_CONFIG_HOME, or if missing:
  ~/.config on X11, ~/Library/Application Support/ on macOS and %APPDATA% on Windows
- OS::get_cache_path gives XDG_CACHE_HOME, or if missing:
  ~/.cache on X11, ~/Library/Caches on macOS and %APPDATA% on Windows

So for Windows there are no changes, for Linux we follow the full split spec
and for macOS stuff will move from ~/.godot to ~/Library/Application Support/Godot.

Support for system-wide installation of templates on Unix was removed for now,
as it's a bit hackish and I don't think anyone uses it.

user:// will still be OS::get_data_path() + "/godot/app_userdata/$name" by
default, but when using the application/config/use_shared_user_dir option
it will now use XDG_DATA_HOME/$name, e.g. ~/.local/share/MyGame.

For now everything still goes in EditorSettings::get_settings_dir(), but
this will be changed in a later commit to make use of the new splitting
where relevant.

Part of #3513.
2017-11-19 20:54:24 +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
Rémi Verschelde ed57f0a0d4 Remove get_default_video_mode definition on OSX/iOS
It had been missed in d09160a8b6 and broke compilation
for those platforms.

Took the opportunity to run clang-format on the code base to fix some corner cases
that went through our static tests/were overlooked recently.
2017-11-09 23:36:08 +01:00
Rémi Verschelde 87694d1884 Disable logging until the logs location is sorted out
Temporary workaround for #12277.
2017-10-29 15:50:27 +01:00
Elia Argentieri 600efa0346 Use execvp instead of execv to allow OS.execute() to search through PATH.
Fix #12003.
2017-10-11 01:07:27 +02:00
Marcelo Fernandez 4b695c3bdf OS::execute can now read from stderr too when executing with a pipe 2017-10-03 15:09:04 -03:00
Ruslan Mustakov 1a2311e350 Extract logging logic
Previously logging logic was scattered over OS class implementations
with plenty of duplication. Major changes in this commit:

 - Extracted logging logic into a separate Logger hierarchy. It allows
   easy configuration of logging mechanism depending on compile-time or
   run-time configuration.

 - Implemented RotatedFileLogger which is usually used with StdLogger,
   providing persistency of logs. It is often important to be able to
   obtain logs of the game even in production to be able to understand
   what happened prior to some problem. On mobile there previously was
   no way to obtain the logs aside from having the device connected to
   your machine.

 - flush() is not performed in release mode for every logged line. It
   is only performed for errors.
2017-09-25 16:19:21 +07: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
Marcelo Fernandez 3528b1e571 Fix x11 exported executables not getting the +x flag 2017-09-17 14:40:58 -03:00
Hein-Pieter van Braam 65af96eab0 Only do 'drive' discovery on X11
As it turns out older versions of the Android NDK have mntent.h but not
a complete implementation. If it did work it would most likely give the
wrong results on Android anyway.

This commit enables the UNIX drive discovery only for X11

We also missed '/run/media' (default for gnome desktops) in the list of
places to look for 'drives' on Linux. Add that to the list also.

This fixes #11270
2017-09-14 23:04:30 +02:00
Rémi Verschelde cc7c892bca Merge pull request #11160 from marcelofg55/drive_funcs_x11
Implemented DirAccess get_drive and get_drive_count for Linux
2017-09-13 20:04:54 +02:00
Marcelo Fernandez e5f905a735 Implemented DirAccess get_drive and get_drive_count for Linux 2017-09-12 23:43:08 -03:00
Rémi Verschelde aabbd00284 Merge pull request #10908 from hpvb/fix-unused-variables
Fix unused variable warnings
2017-09-12 12:55:53 +02:00
supagu e7c5706f71 DirAccess constructor sets current_dir to an absolute path 2017-09-10 20:03:26 +09:30
Hein-Pieter van Braam b2a38854fd Fix unused variable warnings
The forth in my quest to make Godot 3.x compile with -Werror on GCC7
2017-09-08 15:03:53 +02:00
Hein-Pieter van Braam cbedb54408 Fix EOF in wav file importer
In #10973 I reset the state of the stream in get_pos() assuming that the
ftell failing would cause proper error checking. This is not how this
class was designed, however. This commit fixes the get_8() method to
not return unitialized data on eof, and removes the wrong error resets
added in #10973.

This fixes #11022
2017-09-07 00:26:17 +02:00
supagu f4994e750d Further symlink fixes 2017-09-06 18:09:27 +09:30
Rémi Verschelde 44adf75cd5 Merge pull request #10986 from hpvb/fix-unix-file-open
Fix UNIX file open
2017-09-05 01:18:53 +02:00
Hein-Pieter van Braam 5fed954a1b Fix UNIX file open
In #10973 I refactored FileAccessUnix::_open() but I accidentally made
it impossible to create new files.

This fixes that and fixes #10984
2017-09-05 01:14:14 +02:00
Rémi Verschelde 27feafbe12 Merge pull request #10973 from hpvb/fix-file-access-unix
Make UNIX file access more correct
2017-09-05 00:33:20 +02:00
Rémi Verschelde e0801111c4 Merge pull request #10883 from supagu/symlink2
Another take at fixing symlinks
2017-09-04 23:27:32 +02:00
Hein-Pieter van Braam a7c2ff5c94 Make UNIX file access more correct
Check for errors in the POSIX recommended ways.
2017-09-04 22:23:29 +02:00
Fabian Mathews dccdef1327 Another take at fixing symlinks 2017-09-03 13:46:05 +09:30
Hein-Pieter van Braam 9c63ab99f0 Fix use of unitialized variables
The second in my quest to make Godot 3.x compile with -Werror on GCC7
2017-09-02 01:59:26 +02:00