Commit graph

526 commits

Author SHA1 Message Date
Max Hilbrunner 0980991e64
Merge pull request #19070 from guilhermefelipecgs/fix_19033
Fix mouse confined and set_borderless_window
2018-05-21 18:30:11 +02:00
Guilherme Felipe 9af14ac1db Fix #15678
Fix cursor not displaying arrow when transiting from mode captured to
visible.
2018-05-21 14:37:30 -03:00
Guilherme Felipe 28d24c4f66 Fix #19033
- Fix a bug when mouse is confined don't update the cursor shape.
- Don't let the mouse leave the window when resizing to a smaller
resolution when MOUSE_MODE_CONFINED.
- Fix set_borderless_window to preserve the actual video_mode.widht/height.
2018-05-20 20:53:04 -03:00
Guilherme Felipe 50a0220d2d Reset the cursor with Input.set_custom_mouse_cursor(null) 2018-05-10 20:02:12 -03:00
Guilherme Felipe 8ead09342d Add support for atlas texture on set_custom_mouse_cursor 2018-05-09 12:44:43 +00: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
Rémi Verschelde 7e39647623
Merge pull request #18665 from mhilbrunner/build-sdk
Windows detect.py: Detect missing WindowsSdkDir
2018-05-08 10:21:54 +02:00
Blazej Floch c45f44d856 Local debugger fixes and extensions
- Adds q/quit option to console debugging
- Adds options (variable_prefix)
- Breaks into debugger with Ctrl-C in local debug mode (Unix/Windows)
- Added option to list all breakpoints
- Fixes add/remove breakpoint bug (invalid path parsing)
- Minor cleanup
2018-05-07 23:17:06 -04:00
Max Hilbrunner a6b191e3e0
Windows detect.py: Detect missing WindowsSdkDir 2018-05-07 00:42:12 +02:00
Max Hilbrunner a53b08861a
Merge pull request #18541 from profan/fix/win-sleep
Windows: ensure minimum possible timer resolution for sleep
2018-05-05 06:47:13 +02:00
Robin Hübner 8cb1ff9452 windows: ensure minimum possible timer resolution for sleep 2018-05-01 09:58:16 +02:00
Pedro J. Estébanez de9d40a953 Implement universal translation of touch to mouse
Now generating mouse events from touch is optional (on by default) and it's performed by `InputDefault` instead of having each OS abstraction doing it. (*)

The translation algorithm waits for a touch index to be pressed and tracks it translating its events to mouse events until it is raised, while ignoring other pointers.

Furthermore, to avoid an stuck "touch mouse", since not all platforms may report touches raised when the window is unfocused, it checks if touches are still down by the time it's focused again and if so it resets the state of the emulated mouse.

*: In the case of Windows, since it already provides touch-to-mouse translation by itself, "echo" mouse events are filtered out to have it working like the rest.

On X11 a little hack has been needed to avoid a case of a spurious mouse motion event that is generated during touch interaction.

Plus: Improve/fix tracking of current mouse position.

** Summary of changes to settings: **

- `display/window/handheld/emulate_touchscreen` becomes `input/pointing_devices/emulate_touch_from_mouse`
- New setting: `input/pointing_devices/emulate_mouse_from_touch`
2018-04-30 19:03:38 +02:00
Guilherme Felipe 62b835a2cd Fix custom cursor when it's hidden
[Linux] Ensures that the custom cursor will be used when changing to
MOUSE_MODE_VISIBLE. Fix #3086

[Windows] Fix cursor flickering when MOUSE_MODE_HIDDEN.

[Mac] Fix possible cursor flicker when MOUSE_MODE_HIDDEN.
2018-04-09 10:28:20 -03:00
bruvzg ddae098dee
Experimental support for windows with per-pixel transparency (macOS, X11 and Windows). 2018-04-07 17:11:45 +03:00
Guilherme Felipe dc57632d66 Remove size restriction for mouse cursor 2018-04-05 15:41:09 -03:00
bruvzg e337eecd17
Fix MinGW cross-build 2018-03-15 17:29:55 +02:00
Bastiaan Olij cc9e8aa732 Added missing import BoolVariable
Didn't like the missing BoolVariable :)
2018-03-15 22:35:44 +11:00
Gary Oberbrunner d1318ee12c Enable SCons to autodetect Windows MSVC compiler
SCons has good compiler detection logic for MSVC compilers. Up to now,
Godot hasn't used it; it depends on passed-in OS environment vars from
a specific Visual Studio cmd.exe windows. This makes it harder to
build from a msys or cygwin shell.

This change allows SCons to autodetect Visual Studio unless it sees
VCINSTALLDIR in the os.environ. It also adds a 'msvc_version' arg for
manual specification of compiler version, and uses the existing 'bits'
arg to specify the target architecture. More detail could be added as
desired. It also adds 'use_mingw' to always use mingw, even if Visual
Studio is installed. That uses the existing mingw setup logic.

If people are used to building Godot in a Visual Studio cmd window,
this should not change the behavior in that case, since VCINSTALLDIR
will be set in those windows. (However, note that you could now unset
that var and build with any other MSVC version or target arch, even in
that window.)

I refactored much of platform/windows/detect.py during this, to
simplify and clarify the logic. I also cleaned up a bunch of env var
settings in windows/detect.py and SConstruct to use modern SCons
idioms and simplify things.

I suspect this will also enable using the Intel compiler on Windows,
though that hasn't been tested.
2018-03-13 09:51:05 -04:00
bruvzg ad67911f1a
Explicitly set OpenGL profile to core (X11, Windows).
Enable GLES2 on Windows.
2018-03-06 15:53:30 +02:00
Marcelo Fernandez d780d774aa Clean and expose get_audio/video_driver_* funcs on OS class 2018-03-04 14:18:05 -03:00
karroffel eac4c984df add GLES 2 renderer for 2D
This commit adds a new rendering backend, GLES2, and adds a
project setting to enable it.

Currently this backend can only be used on the X11 platform,
but integrating into other platforms is planned.
2018-03-01 15:12:30 +01:00
Marcelo Fernandez f8da9550f4 Fixed Windows ignoring minimized/maximized status set by user 2018-02-26 17:38:00 -03:00
Rémi Verschelde 23ebae01dc Refactor version macros and fix related bugs
The previous logic with VERSION_MKSTRING was a bit unwieldy, so there were
several places hardcoding their own variant of the version string, potentially
with bugs (e.g. forgetting the patch number when defined).

The new logic defines:

- VERSION_BRANCH, the main 'major.minor' version (e.g. 3.1)
- VERSION_NUMBER, which can be 'major.minor' or 'major.minor.patch',
  depending on whether the latter is defined (e.g. 3.1.4)
- VERSION_FULL_CONFIG, which contains the version status (e.g. stable)
  and the module-specific suffix (e.g. mono)
- VERSION_FULL_BUILD, same as above but with build/reference name
  (e.g. official, custom_build, mageia, etc.)
  Note: Slight change here, as the previous format had the build name
  *before* the module-specific suffix; now it's after
- VERSION_FULL_NAME, same as before, so VERSION_FULL_BUILD prefixed
  with "Godot v" for readability

Bugs fixed thanks to that:

- Export templates version matching now properly takes VERSION_PATCH
  into account by relying on VERSION_FULL_CONFIG.
- ClassDB hash no longer takes the build name into account, but limits
  itself to VERSION_FULL_CONFIG (build name is cosmetic, not relevant
  for the API hash).
- Docs XML no longer hardcode the VERSION_STATUS, this was annoying.
- Small cleanup in Windows .rc file thanks to new macros.
2018-02-23 20:15:29 +01:00
luz.paz 612ab4bbc6 Fix typos with codespell
Found via `codespell -q 3 --skip="./thirdparty,./editor/translations" -I ../godot-word-whitelist.txt`
Whitelist consists of:
```
ang
doubleclick
lod
nd
que
te
unselect
```
2018-02-21 19:46:06 +01:00
Fabio Alessandrelli d29488ee9b Link bcrypt lib in window and UWP 2018-02-20 17:42:16 +01:00
Rémi Verschelde 3925e6a543
Merge pull request #16696 from BTaskaya/master
PEP3101 applied with changing old type string formatting as new ones
2018-02-19 20:38:37 +01:00
Rémi Verschelde 4fa8987494 Windows: Fix case of imm32 for case-sensitive MinGW build
Fixes #16713.
2018-02-15 09:06:02 +01:00
BTaskaya 78dba05fc0 PEP3101 applied with changing old type string formatting as new ones 2018-02-14 19:29:25 +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
Rémi Verschelde 7d7f8d9e54
Merge pull request #15864 from GodotExplorer/pr-get_unique_id-desktop-impl
Implement more methods for OS on Desktop platforms
2018-02-14 16:11:53 +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
geequlim 3be04f73f5 Windows: implement OS.get_unique_id and OS.set_ime_position 2018-01-31 09:40:33 +08:00
Hein-Pieter van Braam b4d369c887 Implement OS::get_processor_count() for Windows
Current this is hardcoded as '1' for any platform except Unix. The
little is_wow64() dance is required to get correct output on a 32bit
compiled godot running on 64bit Windows according to MSDN.

This code should be UWP safe but I have no way to test that so it's not
implemented for UWP yet.
2018-01-29 16:50:49 +01:00
Rémi Verschelde f12e8568d4
Merge pull request #16081 from djgaspa/dll-directory
Fix remove_dll_directory crash when cookie is null
2018-01-27 23:32:05 +01:00
Hein-Pieter van Braam c6d9a7665a Make separate debug symbols opt-in
This adds a separate_debug_symbols option to the x11, windows, and osx
targets. This will default to adding normal debugging symbols to the
artifacts and only splits them when separate_debug_symbols=yes on the
Scons command line.
2018-01-26 20:46:56 +01:00
djgaspa 18e66a28bc Fix remove_dll_directory crash when cookie is null 2018-01-26 12:30:02 +01:00
binbitten 017a8521c0 Fix horizontal scroll for windows platform 2018-01-20 21:15:58 +01:00
Juan Linietsky 554e95747c sorry, accidentally pressed delete before commiting. 2018-01-10 17:55:00 -03:00
Juan Linietsky 0f00384c93 Added middle button doubleclick, fixes #15567 2018-01-10 17:46:41 -03: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 db49f35ab8 SCons: Fix usage of LD when we meant LINK
Also made LINK and CXXFLAGS configurable as command line options.
Note that LINK currently expects the *compiler* that will be used
for linking and will call its configured linker behind the scenes
(so g++, clang++, etc., not ld.gold). See #15364 for details.
2018-01-05 20:37:45 +01:00
Juan Linietsky 7332da31fc Forced set mouse global position always, hopefully will fix #15354, otherwise out of luck. 2018-01-05 14:33:13 -03: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
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 6322b0bbb7
Merge pull request #12814 from guilhermefelipecgs/add_hardware_custom_cursor
Custom hardware-accelerated mouse cursor
2018-01-03 08:35:59 +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
George Marques abf416f922
Improve LTO build with MSVC 2017-12-31 14:35:38 -02:00
Juan Linietsky 021f3c924b -Removed OpenMP support, replaced by a custom class.
-Disabled Opus, implementation is wrong.
2017-12-24 09:32:12 -03:00
Rémi Verschelde bf4d398d4e Do not require OpenMP for non-tools builds (export templates) 2017-12-22 12:24:40 +01:00
Guilherme Silva a392dbdbe3 Add implementation for custom hardware cursor 2017-12-17 13:40:29 -02:00
George Marques f1683a290b
Add support for whole program optimization on MSVC
Since it's similar to LTO, it can be enabled by setting use_lto=yes.
2017-12-16 22:29:02 -02:00
Juan Linietsky 652c98a7be Add epic hack so vsync can be toggled in run-time from script. Fixes #14458.
Call needs to be routed via visual server to reach the proper thread.
2017-12-16 17:11:02 -03:00
Hein-Pieter van Braam 05018582d7 Rename the debug symbol files to .debugsymbols
Some users were confused by the '.debug' suffix for the symbols.
2017-12-16 13:55:04 +01:00
Rémi Verschelde cf7bd1a7e3
Merge pull request #14708 from Faless/get_packet_not_const_rebased
Remove "const" from PacketPeer get_packet/get_var, move windows network related stuff to drivers
2017-12-16 00:05:18 +01:00
Hein-Pieter van Braam 241de95884 Fix 32bit MingW build for thekla_altas 2017-12-15 23:26:10 +01:00
Fabio Alessandrelli ac7444023e Move windows networking class to drivers/windows/
Also rename stream_peer_winsock.* to stream_peer_tcp_winsock.* and
StreamPeerWinsock to StreamPeerTCPWinsock.
2017-12-15 18:25:29 +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 c0beab6c5b Remove debug printf on Windows 2017-12-15 07:56:47 +01:00
Rémi Verschelde fb84b49d87 Fix type mismatch in OS::set_borderless_window
Closes #14663.
2017-12-14 19:16:20 +01:00
Colin Kinloch edb1df15ea Added indent_style to editorconfig, fixed inconsistent use of tabs and spaces in indentation. 2017-12-14 13:52:23 +00:00
Juan Linietsky f3ad14224e -Add lightmapper
-Fixes to unwrapper (remove degenerates), makes Thekla not crash
-Added optional cancel button in EditorProgress
-Added function to force processing of events (needed for cancel button)
2017-12-14 09:01:27 -03:00
bruvzg 5f5c461385
Use MinGW specific binutils for debug symbols separation 2017-12-11 18:12:50 +02:00
Rémi Verschelde a8ee9a6116
Merge pull request #14434 from Smjert/fix/13447/vsync
Fixes vsync setting ignored when using a separate thread for rendering
2017-12-09 13:21:36 +01:00
Rémi Verschelde ae012f2381 Windows export: Use WINE to run rcedit on non-Windows host
WINE can be either run from a provided path ("export/windows/wine"),
or looked up in the system PATH.

Fixes #14441.
2017-12-09 11:42:08 +01:00
Rémi Verschelde 3fd1c0c76b
Merge pull request #14437 from vnen/rcedit
Call rcedit on export for Windows desktop
2017-12-09 10:48:19 +01:00
George Marques 78a7241911
Call rcedit on export for Windows desktop
- Add an editor setting to read the rcedit path.
- Add settings to the export preset with icon and other exe information
(version, name, copyright, etc.)
2017-12-09 01:31:10 -02:00
Stefano Bonicatti c067cf2c6a Fixes vsync setting ignored when using a separate thread for rendering
Setting the vsync in the main thread, after the rendering thread starts
and takes the OpenGL context fails, so we need to do that before.
Also, for some reason, the main thread cannot make current the context
anymore.

Fixes #13447
2017-12-09 01:43:23 +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
MrCdK 651677f033 Fix windows compilation when using MinGW 2017-12-07 04:59:11 +01:00
bruvzg 69dca1722f Use run-time dynamic linking for AddDllDirectory and RemoveDllDirectory to support mingw-w64 build and Windows 7 with KB2533623. 2017-12-07 00:20:42 +01:00
Pedro J. Estébanez 6f3343f1ce Remove guards for the now targeted Windows 7+ 2017-12-06 23:47:09 +01:00
Pedro J. Estébanez 0d48af4afd Add build param for targeted Windows version 2017-12-06 23:47:09 +01:00
Pedro J. Estébanez d089e688b0 Improve/fix multitouch on Windows
- Fix logic error.
- Track touches to enable defensive handling and releasing on focus out.
- Change comment-out by preprocessor `#if`.
- Track/report coordinates as float.
2017-12-06 23:47:09 +01:00
Unknown fd1b94e307 Improve slang, especially in user-visible parts 2017-12-05 15:41:38 +01:00
Juan Linietsky 0243803117 Properly take into consideration that VERTEX must be written to in opaque pre pass, does some speed up to scenes using triplanar. 2017-12-01 08:45:36 -03:00
Bastiaan Olij 4c930f3663 Needed a broader search path flag 2017-12-01 00:34:37 +11: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 f0b43678c4
Merge pull request #13383 from Krakean/fix_whitescreen
Fixed fleeting window white screen on editor/game startup
2017-11-29 09:11:18 +01:00
Rhody Lugo a65c0939fd disable caching for targets using helper functions 2017-11-28 23:24:12 -04:00
Dmitry Koteroff 7f26fba8cb Fixed white screen on editor/game startup by moving window displaying to a bit later phase 2017-11-29 03:49:36 +03:00
Rhody Lugo a4a222d62d use the same cache for all branches for appveyor 2017-11-28 03:23:33 -04: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
Indah Sylvia ac92c147c6 Completed bc2e8d99e5 so that windows can be built 2017-11-25 11:12:07 +07: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 3fd23da5ee Rename the version's "revision" to "build"
That "revision" was inherited from SVN days but had been since then
used to give information about the build: "custom_build", "official",
"<some distro's build>".

It can now be overridden with the BUILD_NAME environment variable.
2017-11-20 00:51:14 +01:00
Rémi Verschelde 6947bed015 Pass engine name and version parts as proper strings
Removes the need for _MKSTR all over the place which has the drawback of
converting _MKSTR(UNKNOWN_DEFINE) to "UKNOWN_DEFINE" instead of throwing
a compilation error.
2017-11-20 00:51:14 +01:00
Rémi Verschelde ecf80fbbba
Merge pull request #12988 from akien-mga/xdg-home-paths
Add support for XDG Base Directory spec
2017-11-20 00:42:51 +01: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 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 2e3a1caa06 Disable OpenGL warnings unless running with -v, closes #7171 2017-11-13 13:40:07 -03: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
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
mhilbrunner 0407c2ac46 detect.py: Fix KeyError if using MinGW and LTO 2017-10-27 21:04:27 +02:00
Rémi Verschelde 6361e24f29 Cleanup unnecessary debug prints 2017-10-21 20:41:07 +02:00
Indah Sylvia 53facb07cf Fixed wrong Virtual-KeyCode(0x12) pair on Windows platform (#12073) 2017-10-14 15:41:57 +07:00