Commit graph

409 commits

Author SHA1 Message Date
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 9f134aa5d1 Cleanup old references to GLES2 renderer
There are still some left in the Android Java code, even stuff to swap between
GLES1 and GLES2 support from early Godot days... would be good to see some cleanup
there too one day.

The "graphics/api" option for Android exports is removed, as only GLES 3.0 is supported.
It can be readded when GLES 2.0 support comes back. Fixes #13004.
2017-11-19 17:52:18 +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
Juan Linietsky d09160a8b6 Make video mode initialization more intuitive, fixes #12022 2017-11-09 13:02:26 -03:00
Juan Linietsky 7715a261d5
Merge pull request #12262 from AndreaCatania/pplug
Physics server plug
2017-11-03 23:39:44 -03:00
AndreaCatania 7a9ca08f16 Implemented physics plug
Moved init_physics

Implemented physics 2D plug

Fix clang

Fix clang

Fix static check

Fix clang

Fix static check

Moved physics server initialization

Moved physics server settings initialization
2017-11-04 03:25:51 +01:00
Rémi Verschelde cefdb34f6c SCons: make use_lto a global option and opt-in for iphone
Supersedes #12553, see discussion in #12552.
2017-11-02 09:11:50 +01:00
N0hbdy f3fc07272c Add Colemak keybindings to editor for osx 2017-10-30 22:51:02 +01:00
Marcelo Fernandez be6ac69f75 Implemented OS get_latin_keyboard_variant on x11 2017-10-30 12:14:40 -03:00
Rémi Verschelde 37f1bb3298 Travis: Simplify matrix, disable iphone and add X11 tools=no/clang
Travis always has massive backlog of macOS builds, so we can't rely on them
too much.
The iphone build was mostly useful to spot tools=no or target=release_debug
issues, so replacing it by an appropriate X11 build.
2017-10-27 19:56:37 +02:00
santouits 55fae24710 Fix x11 boot logo position in fullscreen and in maximized 2017-10-26 01:06:26 +03:00
Marcelo Fernandez 2baf54526b Fix BSD compile issues 2017-10-17 16:50:41 +00:00
J08nY b1252caa10
Use binary names instead of absolute paths in calls to OS::execute.
Now that #12009 is merged, we should let the system find the binary on
the users $PATH and don't assume we know where to look for them in
different distributions.
2017-10-13 16:45:24 +02:00
Rémi Verschelde 79e247d74e Drop unusued LEGACYGL_ENABLED check
[ci skip]
2017-10-13 00:18:04 +02:00
Poommetee Ketson 478fd21e07 Merge pull request #11575 from marcelofg55/move_path_to_trash
FileSystemDock will now remove files/dirs to trashcan using OS::move_to_trash
2017-10-02 23:52:09 +07:00
Felix M. Cobos ec644ccb69 Reduce gcc lto build time by telling the linker to
use the number of jobs indicated by -j
2017-09-26 17:04:04 +02:00
Marcelo Fernandez 20918587d3 FileSystemDock will now remove files/dirs to trashcan using OS::move_to_trash 2017-09-25 21:49:01 -03:00
Elliott Sales de Andrade 3e69d19116 Use BoolVariable in platform-specific options. 2017-09-25 14:36:30 -04:00
Elliott Sales de Andrade 45a9a680a3 Use BoolVariable for third-party options. 2017-09-25 14:36:30 -04:00
Elliott Sales de Andrade ffab67b8da Use BoolVariable in target/component/advanced options. 2017-09-25 14:36:02 -04:00
Elliott Sales de Andrade f9e463bce2 Use EnumVariable for choice-based build options. 2017-09-25 14:36:01 -04:00
Rémi Verschelde 4ac7f5acf9 Merge pull request #11519 from hpvb/fix-gcc-lto
Fix gcc lto

[ci skip]
2017-09-24 13:32:00 +02:00
Rémi Verschelde df5dab738a Merge pull request #11527 from QuLogic/system-zstd
Enable building against system zstd.
2017-09-24 08:58:38 +02:00
Elliott Sales de Andrade 00c03bdd2b Add support for OpenSSL 1.1.0.
This release hides many struct members which provides easier forward
compatibility but is a break from previous releases. A few small macros
provide compatibility between both 1.1.0 and 1.0.x.

Fixes #8624.
2017-09-24 02:11:02 -04:00
Elliott Sales de Andrade a408388623 Enable building against system zstd. 2017-09-23 23:46:47 -04:00
Hein-Pieter van Braam 43757fcc85 Fix gcc lto
This repairs LTO on X11 and adds it to MingW targets. The difference in
linktime is substantial, but runtime performance is quite a bit better.
2017-09-23 22:55:26 +02:00
Rémi Verschelde e8a0c5da77 Merge pull request #11243 from hpvb/add-debug-info-on-release
Create separate debug info files by default
2017-09-21 10:30:17 +02:00
Rémi Verschelde 0eec37e247 Merge pull request #11141 from fcobos/x11_borderless_switch_fix
X11 - Adding borders back to a borderless window was not working.
2017-09-21 10:23:52 +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
Marcelo Fernandez 9a0aa45d5c Fix crash handler not including stdlib.h 2017-09-19 11:21:45 -03:00
Marcelo Fernandez ff1e0a3e2c Prevent running the crash_handler when a debugger is present on windows 2017-09-18 16:29:23 -03:00
Rémi Verschelde 53bbc046ee Merge pull request #11252 from marcelofg55/fix_noaudio_crash
Fix crash when no audio driver is available
2017-09-17 22:48:22 +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 88be952fc9 Create separate debug info files by default
Now that we have a built-in stacktrace on a segfault it would be useful
to have debug information on debug_release builds so that bugreports can
include this information. Without this debug info we will still get
function names in the backtrace but not file location.

This commit will by default build all targets with minimal debug info
and then strip the information into separate files. On MacOS this is a
.dSYM file, on Linux/MingW this is a .debug file. MacOSX will
automatically load a dSYM file if it exists in its debugger. On
Linux/MingW we create a 'gnu debuglink' meaning that gdb and friends
will automatically find the debug symbols if they exist.

Existing workflow for developers does not change at all, except that we
now create two instead of one build artifact by default.

This commit also adds a 'debug_symbols' option to X11, MacOS, and MingW
targets. The default is 'yes' which corresponds to -g1. The alternatives
are 'no' (don't generate debug infos at all) or 'full' which runs with
-g2. A target=debug build will now build with -g3.
2017-09-16 12:00:46 +02:00
Thomas Herzog 7dffed485b Merge pull request #11230 from maxim-sheronov/fix_enum_bindings
Fix enums bindings
2017-09-15 08:43:35 +02:00
Andreas Haas 9488f06e4a
X11: Fix gamepads not being added whith udev.
Seems like this property isn't present on some gamepads...
Fixes #10958
2017-09-14 22:50:40 +02:00
Marcelo Fernandez 7a4c0ff35e Fix crash when no audio driver is available 2017-09-13 20:54:55 -03: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
Marcelo Fernandez 83fe937362 Added a crash handler to dump the backtrace on Windows, Linux and OS X 2017-09-13 10:07:23 -03:00
Felix M. Cobos 2e74bf488b Adding borders back to a borderless window was not working. 2017-09-12 18:53:34 +02:00
Felix M. Cobos 3b5ee014bd Hint the window manager to disable desktop compositing in fullscreen mode. 2017-09-09 23:24:19 +02:00
Poommetee Ketson 459f526119 Fix typos 'a' and 'an' 2017-09-02 21:19:06 +07:00
Rémi Verschelde 0cee288c11 Merge pull request #10148 from leezh/pcre2
Replacement of internal RegEx with PCRE2
2017-08-31 11:56:19 +02:00
Hein-Pieter van Braam d44414c711 Disable -ffast-math for etc2comp
Apparently -ffast-math generates incorrect code with recent versions of
GCC and Clang. The manual page for GCC warns about this possibility.

In my tests it doesn't actually appear to be measurably slower in this
case, and this is used in a batch process so it seems safe to disable
this.

This fixes #10758 and fixes #10070
2017-08-30 11:51:24 +02:00
Rémi Verschelde 7ad14e7a3e Dead code tells no tales 2017-08-27 22:13:45 +02: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 612099e377 Merge pull request #10591 from Rubonnek/possible-null-ptr-dereference
Added/Fixed null pointer checks
2017-08-27 02:10:56 +02:00
Rémi Verschelde ea55b400d9 Merge pull request #10598 from Rubonnek/free-memory
Free memory when Main::setup returns an error
2017-08-27 02:10:41 +02:00
Wilson E. Alvarez 7a07895920 Added/Fixed null pointer checks 2017-08-26 16:58:47 -04:00
Wilson E. Alvarez bd257153dc Free memory when Main::setup returns an error 2017-08-25 21:12:19 -04:00
Wilson E. Alvarez 1577f41653 Fixed several memory leaks 2017-08-25 08:47:05 -04: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
Marcelo Fernandez 63f847b306 p_screen param from get_screen_* funcs now default to the current screen 2017-08-21 18:28:29 -03:00
Wilson E. Alvarez 738d2ab969 Removed unnecessary assignments 2017-08-21 15:15:55 -04:00
Zher Huei Lee e3e2f06324 Replacement of internal RegEx with PCRE2
The pattern and replacement matching behaviour has been changed purely
due to the nature of switching to a standards-compliant library.

One mistake in the previous behaviour was that named groups didn't have
a number. This has been corrected.

As names are actually just an alias of numbered groups,
RegExMatch::get_name_dict() is now get_names() and is a dict
referring to the group number it represents.

Duplicate names are enabled and the with the first matching instance
used.

Due the lack of a suitable equivalent in PCRE2, RegExMatch::expand() was
removed.
2017-08-19 19:29:14 +08:00
Richard Adenling 398e0930dc Set the X11 class hint before mapping the window
Setting the class hint before mapping the window will allow some
window managers to determine if a window should be treated specially.
This is also in accordance with the ICCCM spec which says that
WM_CLASS should only be changed when a window is in a
withdrawn (unmapped) state.

Fixes #10429
2017-08-19 00:16:46 +02:00
TwistedTwigleg 00f6c85928 Synchronize parameter names in definition and declaration
Fixes #10244.
2017-08-16 17:22:23 +02:00
Rémi Verschelde 2bb8ab7b89 Merge pull request #10045 from marcelofg55/audioserver_finish
Fix double finalisation of audio drivers
2017-08-07 11:11:03 +02:00
Bojidar Marinov 7b7c7c8dc0
Rename KEY_RETURN to KEY_ENTER and KEY_ENTER to KEY_KP_ENTER
Closes #7695
2017-08-06 16:26:07 +03:00
Marcelo Fernandez 1ca107a057 Fix double finalisation of audio drivers 2017-08-02 11:45:19 -03:00
Rémi Verschelde 411f09a512 Merge pull request #9887 from StraToN/power-fix-x11
Fix power management on x11 platform and removes explicit NULL pointer dereference
2017-07-27 08:53:27 +02:00
Julian Murgia 71dcb7fcc4 Fixes power management on x11 platform and removes explicit NULL pointer dereference. 2017-07-26 23:29:51 +02:00
bruvzg 7de7ca8ae4 Remove duplicate keycode constant for Numpad Enter key. 2017-07-26 14:43:02 +03:00
Jia Wang 2f5b7f8777 Workaround to allow pasting unicode characters from X selection.
Fixes #2491.
Fixes #9787.
2017-07-25 08:00:48 +08:00
Juan Linietsky 25678b1876 -Renamed GlobalConfig to ProjectSettings, makes more sense.
-Added system for feature overrides, it's pretty cool :)
2017-07-19 17:06:03 -03:00
Marcelo Fernandez 11dbca419c Fix fullscreen on X11 for non-resizable windows 2017-07-13 13:08:38 -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
Poommetee Ketson 2fd204c35e Refactor 'treshold' to 'threshold' 2017-07-08 22:24:56 +07:00
Marcelo Fernandez c3563b266f Implemented borderless window functions on Linux. 2017-07-05 12:19:24 -03:00
Rémi Verschelde a2586a2119 Merge pull request #9396 from sowfelicity/x11-ime-echo
Workaround for IME and echo events on Linux (fixes #29 #7106 #9381):
2017-07-03 23:48:57 +02:00
Rémi Verschelde e91a267a7c Buildsystem: Improve detect.py readability and fix issues
Tried to organize the configure(env) calls in sections, using the same order
for all platforms whenever possible.

Apart from cosmetic changes, the following issues were fixed:
- Android: cleanup linkage, remove GLESv1_CM and GLESv2
- iPhone: Remove obsolete "ios_gles22_override" option
- OSX:
  * Fix bits detection (default to 64) and remove obsolete "force_64_bits" option
    (closes #9449)
  * Make "fat" bits argument explicit
- Server: sync with X11
- Windows: clean up old DirectX 9 stuff
- X11:
  * Do not require system OpenSSL for building (closes #9443)
  * Fix typo'ed use_leak_sanitizer option
  * Fix .llvm suffix overriding custom extra_suffix
2017-07-01 08:20:51 +02:00
Jia Wang 098a888ec0 Workaround for IME and echo events on Linux:
Request detectable auto-repeat (Require XKB extension) to support
    echo events and IME at the same time. Fixes #29, #7106 and #9381.
2017-06-29 19:26:06 +08:00
Juan Linietsky e79e135841 Revert "Workaround for IME on Linux." 2017-06-25 20:09:16 -03:00
Rémi Verschelde 87fd71244b Merge pull request #9334 from Noshyaar/pr-genh
BuildSystem: generated files have .gen.extension
2017-06-25 11:08:36 +02:00
Poommetee Ketson e3998528e0 BuildSystem: generated files have .gen.extension 2017-06-25 07:55:01 +07:00
Jia Wang 41029eb1f0 Workaround for IME on Linux(fixes #29 #7106):
Workaround for supporting input method frameworks like SCIM,
    IBus, Fcitx, etc.

    The locale is set when the application starts.

    Workaround for input when the input context within the specified
    input method is not available.
2017-06-25 08:17:56 +08:00
Juan Linietsky 612ab8fcdb -Restored multithread capability to VisualServer
-Restored resource previews!
2017-06-09 00:24:18 -03:00
Andreas Haas 9bc5348961
InputEvent: Renamed "pos" property to "position"
Make the naming consistent with other classes.
2017-06-03 11:26:39 +02:00
Andreas Haas d6333066fc
X11: Turn warning about not finding cursor theme into verbose output.
Failing to get the cursor theme should not cause any issues since we're then using the default one anyway.
So I removed the warning and made it a verbose-only print instead, as people tend to mistake it for a real error..
(pretty much like `iCCP: known incorrect sRGB profile` :P)
2017-05-29 20:41:18 +02:00
Juan Linietsky 5b3709d309 Removal of InputEvent as built-in Variant type..
this might cause bugs I haven't found yet..
2017-05-20 17:05:38 -03:00
Juan Linietsky 98a3296702 Removal of Image from Variant, converted to a Resource. 2017-05-17 07:37:45 -03:00
Rémi Verschelde c8aea60324 Improve documentation of thirdparty code snippets 2017-05-07 11:42:37 +02:00
Rémi Verschelde 2976801012 X11: Abort build if using OpenSSL 1.1.0+
Workaround until #8624 is fixed.
2017-05-06 19:01:10 +02:00
Rémi Verschelde 515f92d03b Fix property warnings and hide some debug prints
"ALL IS GOOD" was a lie.

In particular, removes verbose "path not recognized" false positive.

The actual logic is to (somewhat naively) check all ResourceFormatLoaders
and to pick the first good match, so no need to warn about the formats
that do not match the type hint.
2017-04-23 11:17:32 +02: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 df61dc4b2b Add "Godot Engine contributors" copyright line 2017-04-08 00:11:42 +02:00
Juan Linietsky ce948ed63b Revert "8145 - Mouse Position is unknown until first mouse event on X11" 2017-04-06 13:08:42 -03:00
Sergey Pusnei c79e998d1f 8145 - Mouse Position is unknown until first mouse event on X11 & Win
- X11 update input->pos on EnterNotify
- X11 & Win call first-time events processing before main initialization
2017-03-28 19:18:40 -04:00
Rémi Verschelde 9d28a5e7d9 Merge pull request #8159 from Hinsbart/last_id
Input: Remove usage of platform dependent event IDs.
2017-03-27 08:52:58 +02:00
Rémi Verschelde d8f32637be SCons: Add option to toggle warnings (on by default)
All the warnings are factored out of the platform-specific files and moved to
SConstruct. Will have to check that it does not introduce regressions on some
platforms/compilers.

(cherry picked from commit 31107daa1a)
2017-03-26 21:58:37 +02:00
Andreas Haas c0b6756875
Input: Remove usage of platform dependent event IDs.
The ID property for InputEvents is set by `SceneTree` when sending the event down the tree.
So there's no need for the platform specific code to set this value when it will later be overriden anyway...
2017-03-26 15:59:32 +02:00
Rémi Verschelde debeee56f7 Fix typos in source code using codespell
From https://github.com/lucasdemarchi/codespell
2017-03-24 21:45:31 +01:00
Juan Linietsky c37fad650f Export working (for linux at least) 2017-03-21 19:34:26 -03:00
Andreas Haas fc84ccc468
X11: Don't reset mouse cursor theme.
On KDE (and possibly others) the "default" cursor theme is actually some system default, not the one you've set in the desktop setting.
This was especially annoying when using a white cursor, as Godot would then reset back to a dark one.
In my case it was also keeping the cursor from changing its shape.
2017-03-18 12:13:14 +01: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 e1c1d7d1d7 Add a bunch of missing Godot headers in own files 2017-03-05 15:47:28 +01:00
Rémi Verschelde 49c065d29c Refactoring: rename tools/editor/ to editor/
The other subfolders of tools/ had already been moved to either
editor/, misc/ or thirdparty/, so the hiding the editor code that
deep was no longer meaningful.
2017-03-05 14:21:25 +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
Shlomi Fish 0ef3d22d98 Fix failing build on mageia v6 x64 linux.
There was an error about undeclared malloc()+free().
2017-02-27 21:24:46 +02:00
Rémi Verschelde 34a0aa6900 Merge pull request #7862 from Hinsbart/joypad_connections
Better handling of joypad device IDs.
2017-02-26 21:30:24 +01:00