Commit Graph

2167 Commits

Author SHA1 Message Date
Leon Krause 76522624cb Use stdout/-err for all messages in HTML5 platform 2019-02-24 04:56:34 +01:00
Leon Krause 81554dac61 Fix file preloading warning in HTML5 platform 2019-02-23 20:06:22 +01:00
bruvzg ac3158332b
[macOS] Make `move_window_to_foreground` to take focus in addition to moving window to front. 2019-02-23 20:06:33 +02:00
marxin 0d2a105e6b Come up with use_gcc.
Add new method. Fix wrong version condition for -fpie.
2019-02-23 09:17:11 +01:00
marxin 7de7f0ef17 Fix all -Wtype-limits warnings. 2019-02-21 19:34:35 +01:00
marxin 8d51618949 Add -Wshadow=local to warnings and fix reported issues.
Fixes #25316.
2019-02-20 19:44:12 +01:00
Rémi Verschelde 51c9ffaec0 Drop RtAudio driver on Windows
We've been defaulting to WASAPI since 3.0 and it's superior to RtAudio
in all aspects.

Obsoletes and closes #25503.

Also enable WINMIDI on MinGW, this had been missed initially.

Fix os_windows.cpp and crash_handler_windows.cpp which had weird
dependencies on RtAudio.h's includes (ugh).
2019-02-20 13:47:01 +01:00
Marcelo Fernandez 0c5f87531d Fix compiling with use_mingw flag on Windows 2019-02-19 10:02:24 -03:00
Rémi Verschelde 2374af9e22
Merge pull request #25851 from BastiaanOlij/ios_export_capabilities
New export options in iOS
2019-02-16 14:23:02 +01:00
Bastiaan Olij 0f03ad379c New export options iOS 2019-02-16 12:11:53 +11:00
Rémi Verschelde 89eb79aef1
Merge pull request #25879 from hpvb/fix-25629
Detect when primusrun/optirun is in use
2019-02-14 17:06:20 +01:00
Hein-Pieter van Braam 84627140d7 Detect when primusrun/optirun is in use
It seems that bumblebee doesn't like us creating multiple GL contexts
to avoid this we now detect whether we're running with this software
and don't do anything.
2019-02-14 15:50:47 +00:00
Hein-Pieter van Braam e3aa67792c Don't crash if there's no application name
This fixes #25852
2019-02-14 14:55:51 +00:00
Rémi Verschelde bc9c1e899e
Merge pull request #25842 from marcelofg55/windows_timezone
Fix get_time_zone_info returning inverted bias on Windows/UWP
2019-02-13 14:28:11 +01:00
Marcelo Fernandez 4d43aba31e Fix get_time_zone_info returning inverted bias on Windows/UWP 2019-02-13 09:10:26 -03:00
Rémi Verschelde 5fc86026ca Fix typos with codespell
Using codespell 1.14.0.

Method:
```
$ cat > ../godot-word-whitelist.txt << EOF
ang
doubleclick
lod
nd
numer
que
te
unselect
EOF
$ codespell -w -q 3 -I ../godot-word-whitelist.txt --skip="./thirdparty,*.po"
$ git diff // undo unwanted changes
```
2019-02-13 09:23:29 +01:00
Rémi Verschelde bc26d0d6cd Platform: Ensure classes match their header filename
Also drop some unused files.

Renamed:
- `platform/iphone/sem_iphone.h` -> `semaphore_iphone.h`
  (same for `osx`)
- `platform/uwp/gl_context_egl.h` -> `context_egl_uwp.h`
- in `platform/windows`: `context_gl_win.h`, `crash_handler_win.h`,
  `godot_win.cpp`, `joypad.h` and `key_mapping_win.h` all renamed to
  use `windows`. Some classes renamed accordingly too.
- `EditorExportAndroid` and `EditorExportUWP` renamed to
  `EditorExportPlatformAndroid` and `EditorExportPlatformUWP`
- `power_android` and `power_osx` renamed to `PowerAndroid` and
  `PowerOSX`
- `OSUWP` renamed to `OS_UWP`

Dropped:
- `platform/windows/ctxgl_procaddr.h`
2019-02-12 16:56:25 +01:00
Rémi Verschelde 75dae1b9a9 Drivers, main, servers: Ensure classes match their header filename
Renamed:
- `drivers/alsamidi/alsa_midi.h` -> `midi_driver_alsamidi.h`
  (same for `coremidi` and `winmidi`)
- `main/timer_sync.h` -> `main_timer_sync.h`
- `servers/visual/visual_server_global.h` -> `visual_server_globals.h`
2019-02-12 14:39:47 +01:00
Rémi Verschelde 13c50e8aa5
Merge pull request #25481 from hpvb/fix-ubsan-asan-reports
Fix many asan and ubsan reported issues
2019-02-12 12:21:01 +01:00
Rémi Verschelde b867ef0eec
Merge pull request #25570 from Kanabenki/windows-relative-icon
Use relative path property hint for windows export icon
2019-02-08 16:50:14 +01:00
Rémi Verschelde aa9ec210b9
Merge pull request #25521 from bruvzg/disabled_hidpi_retina_fix
[macOS] Fix rendering on retina displays with HiDPI support disabled.
2019-02-08 11:06:48 +01:00
Ignacio Etcheverry 4e4e889c75
Merge pull request #25478 from neikeq/rr
Mono: Fix MonoPosixHelper not being found
2019-02-03 06:31:52 +01:00
Ignacio Etcheverry 41873ffa88 Added set_environment to OS class 2019-02-03 05:38:47 +01:00
Kanabenki 5890e7060e Use relative path property hint for windows export icon 2019-02-03 01:31:53 +01:00
bruvzg 50e2c1e184
[macOS] Fix rendering on retina displays with HiDPI support disabled. 2019-01-31 19:24:57 +02:00
Hein-Pieter van Braam d308eb091a Fix many asan and ubsan reported issues
This allows most demos to run without any ubsan or asan errors. There
are still some things in thirdpart/ and some things in AudioServer that
needs a look but this fixes a lot of issues. This should help debug less
obvious issues, hopefully.

This fixes #25217 and fixes #25218
2019-01-30 06:43:56 +01:00
Rémi Verschelde 35bb52011a
Merge pull request #25391 from hpvb/fix-dri-prime-detect
Properly detect when to use DRI_PRIME
2019-01-29 10:11:49 +01:00
Bastiaan Olij b53f2d1d59 Using DisplayLink to emulate vsync on OSX 2019-01-29 17:00:35 +11:00
Hein-Pieter van Braam 9c308023bb Properly detect when to use DRI_PRIME
We fork off twice once with and once without DIR_PRIME=1 set. We
then use the vendor string to determine what GPU to use.

We prefer (in order)
1) AMDGPU/AMDGPU-PRO/NVidia non-free driver
2) Intel driver
3) Nouveau
4) Software rendering

If a driver can't be detected it will default to DRI_PRIME=0
2019-01-28 16:21:07 +00:00
Rémi Verschelde 70689ebffd Remove unused iostream includes 2019-01-28 12:16:22 +01:00
Juan Linietsky a089061120 Fix pixelized previews, but also instances of breaking ImageTexture cache. Closes #25378. 2019-01-27 13:41:47 -03:00
Rémi Verschelde c3b0ee5941 Fix code style issues 2019-01-26 22:35:31 +01:00
Rémi Verschelde d355469c1f
Merge pull request #25300 from neikeq/improve-thread-id
Improve custom thread numbering for POSIX
2019-01-26 20:33:18 +01:00
Rémi Verschelde a7525b5c13
Merge pull request #25302 from eska014/html5-startupfs
Allow requesting full screen during start-up in HTML5 platform
2019-01-25 09:36:54 +01:00
Ignacio Etcheverry 6de04cf04c Improve custom thread numbering for POSIX
We lazily assign new IDs to threads that do not have one. This is the case for threads not created by the Godot API.
2019-01-25 00:59:07 +01:00
Marcelo Fernandez daf57bc81f Fix ALT+F4 being ignored with MOUSE_MODE_CAPTURED on Windows 2019-01-23 10:59:54 -03:00
Leon Krause 6939a03255 Allow requesting full screen during start-up in HTML5 platform 2019-01-23 03:42:17 +01:00
Marcin Zawiejski 62f3611271 Fix GDI objects leak when setting custom cursor
Fixes #19906
2019-01-23 01:11:40 +01:00
Marcin Zawiejski 9ca649c67b
Set WINVER and _WIN32_WINNT values in VS project
While looking into a different issue, I've noticed that Visual Studio Intellisense does not work well for Godot project when using Windows Vista+ APIs (e.g. CreateThreadpool), i.e. it does not recognise the APIs because they are defined in Windows header files for Vista+ only.

This is because the WINVER and _WIN32_WINNT symbols don't have their values set in the generated Godot project file. This fixes the problem by setting the values when generating the project file.
2019-01-22 21:34:37 +01:00
Juan Linietsky ab843b1698 Raised executable priority on windows to avoid stuter, helps #25162 2019-01-22 16:04:54 -03:00
Juan Linietsky 0c9fd3c4b4 Avoid cyclic iteration check, fixes #24969 2019-01-22 13:17:39 -03:00
Rémi Verschelde b86f16ed40
Merge pull request #25178 from marxin/sanitizr-options
Rename sanitizer option names.
2019-01-22 12:20:32 +01:00
Juan Linietsky 6fa632b821 Add function to obtain filesystem type from DirAccess.
Change EditorFileSystem to not use directory modification times on FAT32, fixes #20946
2019-01-21 18:06:14 -03:00
Rémi Verschelde 2323464f5e ExportDialog: Make error messages translatable
Also fix missing newlines that caused #24202.
2019-01-21 18:34:53 +01:00
marxin e558773e21 Rename sanitizer option names.
Make the sanitizer names more explicit (use_ubsan, use_asan, use_lsan).
Comment has been adjusted to include GCC as supported compiler for these
and exclude -fno-omit-frame-pointer option (should not cause any
problems).
2019-01-21 08:10:15 +01:00
Leon Krause 8f1669e771 Deal with Google's HTML5 autoplay policy
Resume audio context after mouse, touch or key input.
2019-01-20 14:25:15 +01:00
Rémi Verschelde 08417c8597
Merge pull request #25135 from CakHuri/fix-capabilites
Fixed a typo in 'uwp_device_capabilites'
2019-01-20 11:58:26 +01:00
Rémi Verschelde f0035b7cc7
Merge pull request #25150 from eska014/html5-warning
Fix HTML5 build warning
2019-01-20 09:25:21 +01:00
Leon Krause db6be7b59f Refactor OS_JavaScript header 2019-01-20 00:13:20 +01:00
Leon Krause 0d47dccda9 Fix HTML5 gamepad logic for Emscripten 1.38.22 compat breakage 2019-01-20 00:07:31 +01:00
M. Huri 544015e380 Fixed a typo in 'uwp_device_capabilites' 2019-01-19 20:51:30 +07:00
Rémi Verschelde 9e820cdf20 Android: Enable arm64-v8a export by default
From August 1, 2019, Google Play requires that all new apps and app updates
include 64-bit versions, so we enable ARM64 by default.

IINM support for x86 and x86_64 is still be optional, so not enabling them
out of the box.

Part of #25030.
2019-01-16 13:54:51 +01:00
Rémi Verschelde eebca76be5 SCons: Drop unused MPC_FIXED_POINT define 2019-01-16 12:27:57 +01:00
Rémi Verschelde 7f4ee36469 Android: Add support for x86_64 architecture
Like arm64v8, this is only supported by API 21 and later,
so we enforce 21 as min API for x86_64.

Part of #25030.
2019-01-16 11:39:39 +01:00
volzhs 87db1a8971 Fix Android keep screen on working properly 2019-01-15 22:06:44 +09:00
Rémi Verschelde e425f26578
Merge pull request #24913 from volzhs/export-ios-template
Make export valid when setting custom packages for iOS
2019-01-11 18:06:13 +01:00
volzhs af162a8c3f Make export valid when setting custom packages for iOS
even no templates installed.
all others export work as this already.
2019-01-12 01:43:38 +09:00
bruvzg b7e9e184aa
[macOS] Fix missing mouse move event speed. 2019-01-11 16:53:11 +02:00
Hein-Pieter van Braam e5b335d367 Don't use -ffast-math or other unsafe math optimizations
Godot supports many different compilers and for production releases we
have to support 3 currently: GCC8, Clang6, and MSVC2017. These compilers
all do slightly different things with -ffast-math and it is causing
issues now. See #24841, #24540, #10758, #10070. And probably other
complaints about physics differences between release and release_debug
builds.

I've done some performance comparisons on Linux x86_64. All tests are
ran 20 times.

Bunnymark: (higher is better)
(bunnies)    min    max  stdev average
fast-math   7332   7597    71     7432
this pr     7379   7779   108     7621 (102%)

FPBench (gdscript port http://fpbench.org/) (lower is better)
(ms)
fast-math  15441  16127   192    15764
this pr    15671  16855   326    16001  (99%)

Float_add (adding floats in a tight loop) (lower is better)
(sec)
fast-math   5.49   5.78  0.07     5.65
this pr     5.65   5.90  0.06     5.76  (98%)

Float_div (dividing floats in a tight loop) (lower is better)
(sec)
fast-math  11.70  12.36  0.18    11.99
this pr    11.92  12.32  0.12    12.12  (99%)

Float_mul (multiplying floats in a tight loop) (lower is better)
(sec)
fast-math  11.72  12.17  0.12    11.93
this pr    12.01  12.62  0.17    12.26  (97%)

I have also looked at FPS numbers for tps-demo, 3d platformer, 2d
platformer, and sponza and could not find any measurable difference.

I believe that given the issues and oft-reported (physics) glitches on
release builds I believe that the couple of percent of tight-loop
floating point performance regression is well worth it.

This fixes #24540 and fixes #24841
2019-01-09 02:06:13 +01:00
Rémi Verschelde bd6ab5360f
Merge pull request #24592 from volzhs/android-etc
Make possible to use ETC texture format with GLES3 on Android
2019-01-04 16:49:49 +01:00
Hein-Pieter van Braam b1e3215f3a
Merge pull request #24477 from lupoDharkael/nouveau
Don't enable DRI_PRIME if nouveau is loaded
2019-01-03 23:35:47 +01:00
Guilherme Felipe 86d626e9cb Implements OS_JavaScript::set_custom_mouse_cursor 2019-01-03 13:51:16 -02: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
Rémi Verschelde d1f3b622f0 Fix missing/malformed license headers 2019-01-01 12:46:36 +01:00
Rémi Verschelde fb9085ab54
Merge pull request #24482 from organicpencil/mouse_capture_fix
Fix missed captured mouse events on x11
2018-12-30 16:18:08 +01:00
Rémi Verschelde dcc7f2b54b
Merge pull request #24545 from akien-mga/osxcross-mono
SCons: Allow building Mono module with OSXCross
2018-12-30 15:07:18 +01:00
Rémi Verschelde 95e96947f6 SCons: Drop ios_sim option forcing x86, simulator needs x86_64 2018-12-27 14:11:13 +01:00
volzhs 130cdb2f2a Make possible to use ETC texture format with GLES3 on Android
Currently, textures are not exported if use ETC on project settings and export project with GLES3.
GLES3 should be able to use ETC format also.
2018-12-26 00:47:06 +09:00
Rémi Verschelde d52100f4ff SCons: Allow building Mono module with OSXCross
Improve the test logic to only assume that we're building for macOS
if OSXCROSS_ROOT is defined *and* we requested p=osx.

Supersedes #24480.
2018-12-22 12:36:19 +01:00
Lee Pugh b3ff366467 Fix missed captured mouse events on x11 2018-12-21 14:12:47 -06:00
Rémi Verschelde 6770357e47 Android: Better identify thirdparty C/C++ code
- The `cpu-features.{c,h}` code was only used by chance by the webm
  (libvpx) code, so I moved it there. It was actually introduced before
  that and wasn't in use, and libvpx just happened to be able to
  compile thanks to it being bundled.
  It could potentially be compiled on the fly from the Android NDK, but
  since we plan to replace the webm module by a GDNative plugin in the
  near future, I went the bundling route.

- `ifaddrs_android.h` is already provided in the Android NDK as
  `ifaddrs.h`, same as on other Unixes. Yet we cannot use it until we
  up the min API level to 24, where `getifaddrs` is first defined.
  I moved the files to `thirdparty/misc` and synced them with upstream
  WebRTC (only indentation changes and removal of `static` qualifiers).

Also removes dropped thirdparty files from COPYRIGHT.txt after changes
in #24105 and #24145.
2018-12-20 13:07:54 +01:00
lupoDharkael bfade869f3 Don't enable DRI_PRIME if nouveau is loaded 2018-12-20 11:51:26 +01:00
Rémi Verschelde d8067e905c
Merge pull request #24500 from akien-mga/drop-global_defaults
Core: Drop unused global_defaults logic
2018-12-20 11:49:32 +01:00
Rémi Verschelde a8faa55042
Merge pull request #24485 from volzhs/system-time-ms
Added OS.get_system_time_msecs()
2018-12-20 11:31:16 +01:00
Rémi Verschelde 9cb18232c2 Core: Drop unused global_defaults logic
It used to be used for Android and iOS to specify platform-specific
project settings overrides, but we now have feature tags for that.
2018-12-20 11:02:49 +01:00
volzhs 84d060c768 Added OS.get_system_time_msecs() 2018-12-20 18:50:50 +09:00
George Marques e3e5a1bb6e Add option to add debug keystore in Android export 2018-12-19 15:09:09 -02:00
volzhs b385a4b053 Fix lint error/warning while building android template 2018-12-18 17:26:33 +09:00
Rémi Verschelde 9c7bc127b9
Merge pull request #24385 from hpvb/reduce-string-coew
Reduce String CoW
2018-12-16 19:13:35 +01:00
Hein-Pieter van Braam 4e25e5066b Reduce String CoW
By introducing an intermediate proxy class for the array subscript
operator for String and CharString we can control better when CowData
will actually CoW.

This should improve performance of String usage for most cases.
2018-12-16 16:51:38 +01:00
Rémi Verschelde 9df7ed59fb
Merge pull request #19501 from Zylann/custom_loaders
Added basic support for custom resource savers and loaders
2018-12-16 14:26:56 +01:00
Mikko Mustonen 9974f6c56f switch middle and secondary mouse buttons order 2018-12-15 15:10:06 +02:00
Marc Gilleron 065e2670af Added basic support for custom resource savers and loaders 2018-12-15 05:34:53 +00:00
Cosmic Chip Socket cf124b1415 Use XInput2 RawMotion to generate MouseMotion events
The current system for capturing the mouse and generating motion events on X11
has issues with inaccurate and lopsided input. This is because both
XQueryPointer and XWarpPointer work in terms of integer coordinates when the
underlying X11 input driver may be tracking the mouse using subpixel
coordinates. When warping the pointer, the fractional part of the pointer
position is discarded.

To work around this issue, the fix uses raw motion events from XInput 2. These
events report relative motion and are not affected by pointer warping.
Additionally, this means Godot is able to detect motion at a higher resolution
under X11. Because this is raw mouse input, it is not affected by the user's
pointer speed and acceleration settings. This is the same system as SDL2 uses
for its relative motion.

Multitouch input on X requires XInput 2.2. Raw motion events require
XInput 2.0. Since 2.0 is old enough, this is now the minimum requirement to
use Godot on X.
2018-12-14 23:51:20 +01:00
Rémi Verschelde 5f32fc8208
Merge pull request #20385 from moiman100/unify-double-clicking
Added double clicking to all buttons on Linux and Javascript
2018-12-14 23:47:03 +01:00
Rémi Verschelde 57c3f6a94b
Merge pull request #20063 from moiman100/fix-button-mask
Unified button mask behavior across platforms
2018-12-14 23:31:52 +01:00
Rémi Verschelde 16fda586d9 Android: Don't expose x86_64 ABI for export if we can't build templates for it
Support for x86_64 *could* be added in detect.py, but AFAIK this is not
a widespread architecture for Android, much less for gaming devices.
2018-12-14 23:08:00 +01:00
Rémi Verschelde 28f78ef844
Merge pull request #24285 from volzhs/support-gles2-ios
Support GLES2 for iOS
2018-12-13 10:37:12 +01:00
Sam Green 4cb6b80090 Bump minimum iOS version to 10 2018-12-12 14:40:11 +01:00
Rémi Verschelde 4c41e29c8e
Merge pull request #23923 from bruvzg/ime_gdscript
Changes IME to make it possible to use it from gdscript/gdnative
2018-12-11 18:00:48 +01:00
volzhs 20de0679fc Support GLES2 for iOS 2018-12-11 22:57:53 +09:00
Rémi Verschelde dc2fadc14d
Merge pull request #22733 from guilhermefelipecgs/fix_wm_class
[x11] Use "application/config/name" for WM_CLASS
2018-12-07 22:35:17 +01:00
Rémi Verschelde dc8fd1c634
Merge pull request #24166 from volzhs/export-ios
Add checking required field for exporting iOS
2018-12-05 08:56:17 +01:00
volzhs e698a92b09 Add checking required field for exporting iOS
without specifying Identifier, it will cause `can not be parsed` error on Xcode
2018-12-05 07:32:24 +09:00
Rémi Verschelde 09474ba4c4
Merge pull request #24151 from endragor/fix-ios-safe-area
Fix iOS safe area insets to use pixels and not points
2018-12-04 21:47:42 +01:00
Rémi Verschelde a99e90b258 SCons: Properly set bits variable as string for MSVC detection 2018-12-04 14:30:49 +01:00
Ruslan Mustakov 230510d628 Fix iOS safe area insets to use pixels and not points 2018-12-04 15:50:05 +07:00
Rémi Verschelde b0c66154a4
Merge pull request #23989 from bruvzg/fix_macos_icons
Fix macOS icon export (add 1024px PNG icon and 32px/16px RLE icons).
2018-12-03 17:35:23 +01:00
Rémi Verschelde 49573817b8
Merge pull request #24078 from marcelofg55/win_min_bug
Fix wrong size and position when windows is minimized on Windows
2018-12-03 17:32:35 +01:00
Rémi Verschelde d8a28368f9
Merge pull request #24105 from BastiaanOlij/cleanup_old_android_native
Remove obsolete ANDROID_NATIVE_ACTIVITY
2018-12-02 21:15:54 +01:00