Commit graph

1841 commits

Author SHA1 Message Date
Saracen c5bdb5b1d8 IME context detection. 2018-06-11 17:22:11 +01:00
Rémi Verschelde 69058d33fc
Merge pull request #19443 from eska014/html5-audio-refactor
Detect channel count and mix rate in HTML5 audio driver
2018-06-08 18:04:59 +02:00
Leon Krause 8d3ca2c137 Detect channel count, mix rate, and buffer length in HTML5 audio driver
Refactor WebAudio driver.
2018-06-08 02:50:58 +02:00
Hugo Locurcio d54b5da940
Tweak some help texts in the build system
This also removes `unix_global_settings_path` from SConstruct
since it is no longer used.
2018-06-07 21:40:54 +02:00
Juan Linietsky efdd0c4b89 Oops, for some reason gedit used this file as my notebook, though I made a new one. 2018-06-07 12:52:00 -03:00
Juan Linietsky b659fd6d74 Entirely new (and much improved) animation editor. 2018-06-07 12:52:00 -03:00
Rémi Verschelde 7d392cd6f4 SCons: Allow unbundling libwebsockets and miniupnpc 2018-06-07 10:42:30 +02:00
Rémi Verschelde f392650be2 Improve return value of OS.execute in blocking/non-blocking variants
Initialized the PID to -2, which will be the value returns in blocking-
mode where the PID is not available. (-1 was already taken to signify an
execution failure).

OS::execute will now properly return a non-OK error code when it fails
to execute the target file.

The documentation was rewritten to be very clear about the differences
between blocking and non-blocking mode.

Fixes #19056.
2018-05-30 12:55:17 +02:00
Dmitry Pupinin 46bab3abc7 Allow setting higher numbers in Android version/code 2018-05-29 11:59:23 +02:00
Guilherme Felipe c8e0ec0580 Change position of validation in set_custom_mouse_cursor 2018-05-28 09:36:30 -03:00
Max Hilbrunner 856d945248
Merge pull request #19210 from guilhermefelipecgs/fix_invalid_image
Add validation in set_custom_mouse_cursor
2018-05-28 12:52:10 +02:00
Guilherme Felipe aad6bdad94 Add validation in set_custom_mouse_cursor
Check if the image is valid.
2018-05-27 20:55:05 -03:00
Guilherme Felipe aa174d963d Fix memory leak in set_custom_mouse_cursor 2018-05-26 15:56:35 -03:00
Max Hilbrunner fd1ee14056
Merge pull request #19148 from mhilbrunner/mhilbrunner-js-log
Javascript: Remove weird log
2018-05-24 21:11:17 +02:00
Max Hilbrunner 0c56e011ad
Javascript: Remove weird log 2018-05-24 20:18:21 +02:00
Guilherme Felipe 8c17d8e6fe More fixes to set_borderless_window
[x11] Preserve window size when calling this method.
[osx] Make sure it don't make the window resizable if it's not needed.
[windows] clean up the code.
2018-05-23 17:42:31 -03:00
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
Max Hilbrunner 3ac7f08b55
Merge pull request #19082 from guilhermefelipecgs/fix_cursor
Fix cursor not displaying arrow when transiting from mode captured to visible.
2018-05-21 18:26:42 +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
Fabio Alessandrelli 875d822d77 Fix OSXCROSS build with clang-6.0 2018-05-21 16:16:16 +02: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
Rémi Verschelde 82042bdd03
Merge pull request #18893 from eska014/html5-reldeb-Os
Build HTML5 release_debug with -Os
2018-05-16 22:50:45 +02:00
Daniele Giuliani d315b0fb8a added get_creation_time function for gdscript 2018-05-16 00:50:57 +02:00
Rémi Verschelde 57d257c361
Merge pull request #18680 from Gamblify/DummyTextureLoader
Dummy texture importer
2018-05-15 10:27:07 +02:00
Leon Krause 975c0516a4 Build HTML5 release_debug with -Os, like release.
The increased build time is negligible in comparison to the decreased
file size.
2018-05-14 15:31:16 +02:00
Leon Krause 504ffda8d7 Small refactoring in HTML5 build scripts
Drop logic for non-existent 'profile' target
2018-05-14 15:30:27 +02:00
Max Hilbrunner 0db3d1d2a7
Merge pull request #15739 from poke1024/macos-catch-exception
Catch NSException in macOS run loop to prevent crashs
2018-05-13 23:51:20 +02:00
bruvzg 096eb38fb0
[macOS] Fix numeric keys scan-codes remapping. 2018-05-13 22:19:08 +03:00
Rémi Verschelde 0902915c33
Merge pull request #18751 from guilhermefelipecgs/fix_cursor_osx
Fix custom cursor disappearing on osx
2018-05-11 14:23:13 +02:00
Ruslan Mustakov 08a924bcee Proper focus in/out handling on iOS
PR #18675 (commit 96301e9) revealed a problem with how iOS lifecycle
callbacks were handled by Godot. Before that PR it was possible to get
NOTIFICATION_WM_FOCUS_IN callback without getting the corresponding
NOTIFICATION_WM_FOCUS_OUT. That commit added a flag to ensure they are
always coupled, but now there is an issue when, for example, you open a
notification panel on iOS without moving the app to background.
It resulted in view.stopAnimation being called without the
corresponding startAnimation when the app moves to foreground again, so
it looked like the game hanged.

I changed focus out notification to be sent in applicationWillResignActive,
because it makes more sense than to do it in applicationDidEnterBackground,
because it is always called in pair with applicationDidBecomeActive, where
focus in is sent. applicationDidEnterBackground may not come under
circumstances that are now described as a comment in code.
2018-05-11 17:19:39 +07:00
Guilherme Felipe 50a0220d2d Reset the cursor with Input.set_custom_mouse_cursor(null) 2018-05-10 20:02:12 -03:00
Rémi Verschelde a415efa4b7
Merge pull request #18765 from eska014/enginejs-extalt
Facilitate using non-default filename extensions in HTML5 platform
2018-05-10 21:57:07 +02:00
Max Hilbrunner 486ec499f3
Merge pull request #18766 from eska014/html5-localcustomshell
Use local path for custom HTML5 shell export
2018-05-10 16:51:13 +02:00
Leon Krause d1970888d3 Use local path for custom HTML5 shell export 2018-05-10 15:31:44 +02:00
Leon Krause 96f907c023 Accept non-default main packs in engine.js startGame()
Allows using startGame() with main packs exported as .zip, but also any
other custom extension, for example if a web game host does not allow
the .pck filename extension.
2018-05-10 15:08:19 +02:00
Max Hilbrunner f20af4b632
Merge pull request #18753 from eska014/html5-iframefocus
Fix keyboard focus lock-out with HTML5 canvas in iframe
2018-05-10 15:01:24 +02:00
Leon Krause 32eb3e1b7d Add Engine.setWebAssemblyFilenameExtension()
Some web game hosts only allow certain filename extensions. If .wasm is
not allowed, this function allows overriding the WebAssembly filename
extension to work around that restriction.
2018-05-10 14:50:34 +02:00
Leon Krause 9080e96bc8 Fix keyboard focus lock-out with HTML5 canvas in iframe 2018-05-10 02:42:47 +02:00
Rémi Verschelde fe82b5a122
Merge pull request #18749 from eska014/html5-mousecapture-rel
Fix relative motion with captured mouse in HTML5 platform
2018-05-10 01:26:49 +02:00
Guilherme Felipe 48f9e6a05b Fix custom cursor disappearing on osx 2018-05-09 20:06:59 -03:00
Leon Krause d78b10313b Fix relative mouse motion when captured in HTML5 platform 2018-05-10 01:02:48 +02:00
Rémi Verschelde 1380040337
Merge pull request #18716 from guilhermefelipecgs/support_for_atlas_tex_on_cursor_2
Add support for atlas texture on set_custom_mouse_cursor
2018-05-09 19:53:56 +02:00
Guilherme Felipe 8ead09342d Add support for atlas texture on set_custom_mouse_cursor 2018-05-09 12:44:43 +00:00
Gustav Lund 3dcf338ebb Dummy texture importer
Added a dummy importer for textures to use with the server platform.
Allows for running a project in headless mode without crashing when loading scenes containing textured objects
Also as a result decreases load time as no image files have to be loaded.
2018-05-09 08:13:02 +02:00
Hein-Pieter van Braam 07f590046a For uwp the ARM architecture needs to be in lower case 2018-05-09 01:16:05 +02:00
Rémi Verschelde 720e2f7b09
Merge pull request #18726 from volzhs/remove-legacy
Remove android compatibility under API 16
2018-05-08 23:49:37 +02:00
volzhs 2f8f34ceaf Remove android compatibility under API 16 2018-05-09 06:01:33 +09: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 a6552819b1 Android: Increase targetSdkVersion to 27
Matches the change for 2.1 in #18626, and the new requirements from Google
for new apps starting with August 2018 (targetSdkVersion 26 or higher):
https://android-developers.googleblog.com/2017/12/improving-app-security-and-performance.html
2018-05-08 15:29:42 +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
Max Hilbrunner af128f6d39
Merge pull request #16573 from StateOff/more_console_debugging
Local debugging fix & extensions
2018-05-08 07:00:45 +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 c32b24da70
Merge pull request #18627 from RameshRavone/patch-2
Fix: JAR files signed with the MD5 algorithm as unsigned (godot 3)
2018-05-08 04:31:20 +02:00
RameshRavone d3182248c4
Fix: JAR files signed with the MD5 algorithm as unsigned 2018-05-07 21:02:53 +05:30
Ruslan Mustakov 96301e934d Resume audio on iOS after phone call or alarm
When a phone call or an alarm triggers on iOS, the application receives
an "audio interruption" and it's up to the application to resume
playback when the interruption ends. I added handling for audio
interruptions same as if the game is focused out and then back in.
2018-05-07 15:48:46 +07: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
Rémi Verschelde 18c28c159d
Merge pull request #17196 from RandomShaper/improve-gui-touch
Implement universal translation of touch to mouse (3.1)
2018-05-02 10:47:49 +02:00
Rémi Verschelde de97339a2d
Merge pull request #18291 from akien-mga/coverity-uninitialized-scalar-var
Fix Coverity reports of uninitialized scalar variable
2018-05-01 19:14:07 +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
Ignacio Etcheverry c8884ce3bd Fix _export_begin not being called when exporting to android 2018-04-26 23:07:21 +02:00
Hugo Locurcio 1c419531a0 Change ".." punctuation for "..." in editor strings (#16507) 2018-04-22 19:36:01 +02:00
Ruslan Mustakov 265caa687b Provide error details when in-app purchase fails 2018-04-19 21:04:20 +07:00
Rémi Verschelde bf7ca623a6 Fix Coverity reports of uninitialized scalar variable
Fixes most current reports on Coverity Scan of uninitialized scalar
variable (CWE-457): https://cwe.mitre.org/data/definitions/457.html

These happen most of the time (in our code) when instanciating structs
without a constructor (or with an incomplete one), and later returning
the instance. This is sometimes intended though, as some parameters are
only used in some situations and should not be double-initialized for
performance reasons (e.g. `constant` in ShaderLanguage::Token).
2018-04-19 15:20:45 +02:00
Ruslan Mustakov 5dffa506dc Fix Android input source checks
Input source types are not pure bit flags, they are combinations of
flags, so != 0 check was incorrect and resulted in crashes later, when
trying to obtain the device.
2018-04-16 11:19:07 +07: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
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
Juan Linietsky 1570a72eee
Merge pull request #17742 from marcelofg55/audio_device_list
Added new audio device functions to set/get the audio device
2018-04-07 16:40:47 -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
Rémi Verschelde 866254343b
Merge pull request #17827 from bruvzg/macos_shortcut_key_remapping_fix
[macOS] Fix keyboard shortcuts on non QWERTY keyboard layouts.
2018-04-05 13:22:52 +02:00
Rémi Verschelde 7e9aa89fb8
Merge pull request #17777 from bruvzg/macos_exit_code
[macOS] Return exit code specified by `OS.exit_code` parameter.
2018-04-04 22:35:40 +02:00
Rémi Verschelde 919209907d
Merge pull request #17792 from eska014/enginejs-preloadpaths
Handle directories in engine.js preloadFile()
2018-04-04 22:26:14 +02:00
Rémi Verschelde bba80721dc
Merge pull request #17801 from endragor/android-input-checks
Add safety checks when handling Android input
2018-04-04 22:09:03 +02:00
Rémi Verschelde 5dc514aced
Merge pull request #17880 from litdeviant/master
Fix UpdatePowerInfo method implementation in PowerIphone class
2018-04-03 11:05:49 +02:00
Rémi Verschelde 3ef85ddb8d
Merge pull request #17836 from eska014/detect-emconfig
Detect and configure JavaScript build per Emscripten configuration file
2018-04-03 10:33:33 +02:00
Rémi Verschelde 59710880cd
Merge pull request #17844 from Faless/uwp_fix
Fix UWP build after #17194
2018-04-02 11:51:26 +02:00
Igors Vaitkus 06fab24348
Fix UpdatePowerInfo method implementation in PowerIphone class 2018-03-31 02:52:37 +03:00
Fabio Alessandrelli b8c73b195f Fix bug in HTML5 HTTPClient.
The URL parameter already has a slash, adding an extra one results in
an invalid resource path
2018-03-30 14:31:18 +02:00
Fabio Alessandrelli e6364c3fd5 Fix UWP build after #17194
`uwp/detect.py` was not setting the `env.msvc` variable to true causing
scons to pass wrong arguments to `msvc` (using `clang/gcc` options)
which in turn break the build due to `-Werror=return-type` not being
recognized by ms compiler.
2018-03-29 18:21:08 +02:00
Leon Krause 5be7c3dcee Detect and configure JavaScript build per Emscripten configuration file 2018-03-29 04:07:23 +02:00
bruvzg 5ba984fc8c
[macOS] Fix keyboard shortcuts on non QWERTY keyboard layouts. 2018-03-28 20:22:59 +03:00
Fabio Alessandrelli e7b9e2f970 Fix IPhone and OSX cross compilation 2018-03-28 19:08:20 +02:00
Ruslan Mustakov 995724b762 Add safety checks when handling Android input
It is possible that input comes before the engine is fully initialized.
This fixes the crashes that ocurred when that happens.
2018-03-27 22:03:44 +07:00
Leon Krause 3014e48ec5 Fix engine.js startGame() when loading from directory 2018-03-27 11:26:34 +02:00
Leon Krause d373029382 Allow custom path when using engine.js preloadFile() with URL 2018-03-27 11:26:29 +02:00
Leon Krause 6f1bddf4b5 Fix engine.js preloadFile() with directories 2018-03-27 11:26:25 +02:00
Leon Krause 63c7fc6358 Expose Emscripten libs to engine.js discreetly 2018-03-27 09:12:08 +02:00
Marcelo Fernandez ecc1b34cbc Added new audio device functions to set/get the audio device 2018-03-26 17:41:05 -03:00
Rémi Verschelde 4a5723f59e
Merge pull request #17760 from eska014/html5-refactor
Refactor HTML5 platform build script
2018-03-26 21:15:17 +02:00
Leon Krause d8d9eea722 Refactor JavaScript platform build script 2018-03-26 19:46:56 +02:00
bruvzg 1a38449ab9
[macOS] Return exit code specified by OS.exit_code parameter. 2018-03-26 16:55:57 +03:00
bruvzg d6c6a65438
Revert "Implement OS_OSX::execute"
This reverts commit e42576548f.
2018-03-23 11:56:05 +02:00
bruvzg 14597dc2b2
Fix dragging window from non-retina to retina display. 2018-03-22 18:24:09 +02:00
Marcelo Fernandez 35d21c0881 Fix several in-class initialization clang warning 2018-03-22 00:17:18 -03:00
Rémi Verschelde baa092e99d
Merge pull request #17653 from eska014/rwlock-dummy
Add RWLockDummy for NO_THREADS builds
2018-03-21 17:40:01 +01:00
Xavier Sellier 61e8f8a866 Prevent android to split-screen 2018-03-21 08:53:51 -04:00
Rémi Verschelde 6066b236aa
Merge pull request #17645 from volzhs/android-device-info
Fix getting Android device information
2018-03-20 11:28:15 +01:00
volzhs 4e378aeeb8 Fix getting Android device information
Fix #17644
2018-03-20 13:53:33 +09:00