Commit graph

2600 commits

Author SHA1 Message Date
Rémi Verschelde
eaaff9da31
Merge pull request #29941 from qarmin/redundant_code_and_others
Remove redundant code, possible NULL pointers and others
2019-06-27 01:05:18 +02:00
qarmin
4e5310cc60 Some code changed with Clang-Tidy 2019-06-26 15:08:25 +02:00
Nicholas Thompson
c48576f733 Allow '-' character in iOS reverse DNS identifiers dissallow underscores. 2019-06-25 11:46:43 +01:00
Rémi Verschelde
ab932bb675
Merge pull request #29948 from lawnjelly/androidkeyboard
Fix some keyboards not working with Android
2019-06-24 19:32:42 +02:00
Nils ANDRÉ-CHANG
d2833d4f4d Replace + "/" + with String::file_add() 2019-06-23 13:33:50 +01:00
Rémi Verschelde
1769cbc0e2 SCons: Default to builtin libpng/freetype on Linux
The rationale for keeping those shared by default is that they're typical
dependencies found on any Linux system, and it saves compilation time and
binary size to link their dynamically.

But since official builds default to all-builtin, and Debian/Ubuntu still
don't have libpng16 (which we now require) readily available on all their
supported releases, it's simpler to bundle all the things.

This does not change the fact that those dependencies *can* be unbundled
on Linux, it's only the default option changing.
2019-06-23 10:02:35 +02:00
lawnjelly
512f8ebb93 Fix some keyboards not working with Android
Fixes #17004

Currently the keydown and keyup messages are handled with method like this:

if ((source & InputDevice.SOURCE_JOYSTICK) == InputDevice.SOURCE_JOYSTICK
|| (source & InputDevice.SOURCE_DPAD) == InputDevice.SOURCE_DPAD
|| (source & InputDevice.SOURCE_GAMEPAD) == InputDevice.SOURCE_GAMEPAD) {
// joystick input
}
else
{
// keyboard input
}

The constant for SOURCE_DPAD is 513
10 0000 0001

and the constant for SOURCE_KEYBOARD is 257
1 0000 0001

However, rather confusingly, for many keyboards the source sent by android is 769
11 0000 0001

Thus the keyboard is passing the check as being a DPAD and being processed as a joystick rather than keyboard. This PR handles the specific case of 769, allowing input from physical keyboards.
2019-06-21 12:57:33 +01:00
Luka Dornhecker
ad504b926f Add option to toggle console window on Windows
This is an editor setting and its value can also be toggled
using an entry in the Editor toolbar. The console will still
appear briefly when starting the project manager or editor,
as it's still compiled as console application.

Does not impact exported games, which will still run without
console in release and with console in debug mode.

A project setting or export option could be added to disable
it in debug mode if there's demand for it, but that would
greatly reduce the usefulness of debug builds if Windows users
can no longer report error and crash messages.

Fixes #17889.

Co-authored-by: Rémi Verschelde <rverschelde@gmail.com>
2019-06-20 16:55:52 +02:00
Rémi Verschelde
e09cf96857
Merge pull request #29874 from ibrahn/rework-png-loadsave
PNG driver reworked to use libpng 1.6 simplified API
2019-06-20 11:10:02 +02:00
Rémi Verschelde
d61bce1b75
Merge pull request #29910 from m4gr3d/dev_deprecate_armv6
Deprecate support for Android armv6 architecture
2019-06-20 10:22:23 +02:00
Hugo Locurcio
e08fa103f2
Fix Emscripten root directory detection when building for HTML5
Recent Emscripten SDK versions seem to only include the
`BINARYEN_ROOT` variable in the Emscripten configuration file,
whereas the platform's `detect.py` only looked at `EMSCRIPTEN_ROOT`.
2019-06-19 22:23:58 +02:00
fhuya
f7200d6960 Deprecate armv6 support for Android 2019-06-19 12:05:58 -07:00
JohnJLight
38d3bfe971 Made use of semicolons more consitent, fixed formatting 2019-06-19 15:24:31 +02:00
Ibrahn Sahir
5e24611241 Png driver reworked to use libpng 1.6 simplified API
Wrapped libpng usage in a pair of functions under PNGDriverCommon,
which convert between Godot Image and png data.
Switched to libpng 1.6 simplified API for ease of maintenance.
Implemented ImageLoaderPNG and ResourceSaverPNG in terms of
PNGDriverCommon functions.
Travis, switched to builtin libpng (thus builtin freetype and zlib also)
so we can build on Xenial.
2019-06-19 11:05:58 +01:00
Martin Capitanio
ce1c840635 Linux: Check return values of posix read/write
Fixes #29849, for real this time.
2019-06-19 11:57:38 +02:00
bruvzg
e19b6296e3
Update macOS global mouse position at startup 2019-06-18 22:44:29 +03:00
Rémi Verschelde
0f543ba99d
Merge pull request #29852 from georgwacker/fix-controller-hang
Fix endless controller iteration on windows
2019-06-17 18:58:41 +02:00
Georg Wacker
4014888687 Fix endless controller iteration
Fixes #29846
2019-06-17 18:01:09 +02:00
Rémi Verschelde
40db7b85af Linux: Check return value of chdir on cleanup
Some compilers trigger a warning for it if we do not bother
checking the return value.

Fixes #29849.
2019-06-17 17:06:25 +02:00
Rémi Verschelde
24ee8c3566 Add script to fix style issues and copyright headers
This is only meant to check the validity of the whole codebase every
now and then, or to apply clang-format config changes when relevant.
2019-06-17 13:35:47 +02:00
Rémi Verschelde
0d61fc2c0f
Merge pull request #29752 from bruvzg/window_size_limits
Add ability to limit maximum/minimum window size.
2019-06-17 11:58:00 +02:00
Rémi Verschelde
f6f9f89078
Merge pull request #29325 from m4gr3d/setup_godot_for_ovr_support
Setup Godot to support the Oculus Mobile SDK.
2019-06-16 10:37:57 +02:00
Rémi Verschelde
baab976d0f
Merge pull request #10643 from BastiaanOlij/camera_server
CameraServer class
2019-06-16 10:22:26 +02:00
Rémi Verschelde
1e483d7c73
Merge pull request #29786 from dotdigitalgroup/hidpi-javascript-fix-master
Fix pointer position in hidpi-corrected resolutions on web
2019-06-15 23:06:02 +02:00
Rémi Verschelde
68735d2a88 Fix compilation warnings in JS and Windows builds
Warnings raised by Emscripten 1.38.0 and MinGW64 5.0.4 / GCC 8.3.0.

JS can now build with `werror=yes warnings=extra`.
MinGW64 still has a few warnings to resolve with `warnings=extra`,
and only one with `warnings=all`.

Part of #29033 and #29801.
2019-06-15 14:40:45 +02:00
BastiaanOlij
02ea99129e Adding a new Camera Server implementation to Godot.
This is a new singleton where camera sources such as webcams or cameras on a mobile phone can register themselves with the Server.
Other parts of Godot can interact with this to obtain images from the camera as textures.
This work includes additions to the Visual Server to use this functionality to present the camera image in the background. This is specifically targetted at AR applications.
2019-06-15 21:30:32 +10:00
bruvzg
b924fb97d6
Add ability to limit maximum/minimum window size. 2019-06-15 09:49:11 +03:00
Leonardo Giovanni Scur
31cc1bdb58 Fix pointer position in hidpi-corrected resolutions on web 2019-06-14 17:37:21 -03:00
Rémi Verschelde
bbbc04b2fe
Merge pull request #29711 from zaksnet/windows-export-improvemnts
Added hint for windows export options
2019-06-12 23:44:11 +02:00
Zak
3168c25bad Added hint for windows export options 2019-06-12 14:42:35 +03:00
Rémi Verschelde
f65b0c6d89
Merge pull request #29679 from akien-mga/windows-res-desc
Remove "Editor" from Windows PE file description
2019-06-12 13:24:30 +02:00
Rémi Verschelde
ec98db048f
Merge pull request #29481 from bruvzg/macos_fix_dvorak_qwerty_cmd_hotkeys
Fixes hotkeys on "Dvorak - QWERTY ⌘" keyboard layout.
2019-06-12 12:50:55 +02:00
Rémi Verschelde
0e6cac8ab8
Merge pull request #29465 from bruvzg/per_pixel_transp_impr
Removes redundant "splash" setting, improves per pixel transparency documentation.
2019-06-12 12:50:17 +02:00
Rémi Verschelde
971b5160c6
Merge pull request #29306 from qarmin/small_code_fixes
Small fixes to unrechable code, possibly overflows, using NULL pointers
2019-06-12 12:49:21 +02:00
Rémi Verschelde
93c00dfcd9 Remove "Editor" from Windows PE file description
Closes #29569.
2019-06-11 15:22:03 +02:00
Rémi Verschelde
6d16f2f053 Fix error macro calls not ending with semicolon
It's not necessary, but the vast majority of calls of error macros
do have an ending semicolon, so it's best to be consistent.
Most WARN_DEPRECATED calls did *not* have a semicolon, but there's
no reason for them to be treated differently.
2019-06-11 14:49:34 +02:00
Rémi Verschelde
99acec63f1 bullet: Sync with current upstream master branch
This updates our local copy to commit 5ec8339b6fc491e3f09a34a4516e82787f053fcc.
We need a recent master commit for some new features that we use in Godot
(see #25543 and #28909).

To avoid warnings generated by Bullet headers included in our own module,
we include those headers with -isystem on GCC and Clang.

Fixes #29503.
2019-06-11 13:19:42 +02:00
bruvzg
2a950f3a7c
[X11] Add window borderless state detection, fix borderless state restoration after exiting fullscreen. 2019-06-11 12:07:48 +03:00
Rémi Verschelde
ee86b18a5e
Merge pull request #29497 from qarmin/fix_memory_leak_in_files
Fix memory leak after closing files
2019-06-10 15:23:26 +02:00
qarmin
53c0a29fb0 Fix memory leak after closing files 2019-06-05 09:34:16 +02:00
bruvzg
360fb3af50
[macOS] Fixes hotkeys on "Dvorak - QWERTY ⌘" keyboard layout. 2019-06-04 19:50:50 +03:00
bruvzg
8ff72987c0
[macOS] Fixes unicode input with IME mode inactive, Improves IME mode documentation. 2019-06-04 11:29:00 +03:00
bruvzg
54863b20e6
Removes redundant "display/window/per_pixel_transparency/splash" setting, improves per pixel transparency documentation. 2019-06-04 11:21:29 +03:00
qarmin
8245db869f Small fixes to unrechable code, possibly overflows, using NULL pointers 2019-06-03 21:52:50 +02:00
Rémi Verschelde
f7953ddea8
Merge pull request #29298 from Faless/javascript/clipboard
Partial Javascript clipboard support
2019-06-01 11:18:25 +02:00
Rémi Verschelde
af2c742f53 Fix and expose String::strip_escapes(), use it in LineEdit paste
Supersedes #27736.
2019-05-31 15:49:14 +02:00
fhuya
2c3536810a Setup Godot to support the Oculus Mobile SDK. 2019-05-30 16:35:50 -07:00
Fabio Alessandrelli
ce542bced1 Implement Clipboard API read when supported.
Being async, the first time a value is pasted GUI elements will still
return the previous one.
This at least until 'clipboardchange' window event gets implemented by
user agents.
2019-05-29 23:21:09 +02:00
Fabio Alessandrelli
2b436dd50e Kinda working HTML5 clipboard paste.
Listen to paste events to update local clipboard.
CTRL+V still not working out of the box.
To do that, We would need to change how we handle keypress, most likely
making it worse and less safe. In the end, I'm not sure we can fix it
properly for now. Maybe in the future, with the Clipboard API, support
of which is still pretty limited on chrome, and only available to
extensions in Firefox.

For now, you can paste via:
- Browser bar -> Edit -> Paste.
- Middle mouse click (Linux only, copies secondary clipboard).

And THEN press CTRL+V
2019-05-29 23:21:09 +02:00
wombatstampede
6e46701e64 Android: Include Joysticks/Gamepads which are available on app start. 2019-05-28 18:23:30 +02:00
Rémi Verschelde
06633a8074
Merge pull request #26462 from SubSage/master
Fixes OS.execute; stderr was silenced; adds missing quote from exe args (windows)
2019-05-28 14:26:57 +02:00
Fabio Alessandrelli
0f76df2397 Add OS clipboard set support to OS Javascript 2019-05-28 12:59:29 +02:00
Rémi Verschelde
6ee3a1a6ae
Merge pull request #28512 from MJacred/master
Fix application window not listed in taskbar (X11)
2019-05-28 11:32:03 +02:00
Rémi Verschelde
e8fbb28e20
Merge pull request #29119 from bruvzg/native_icon_support
Add native window/taskbar icon support for Windows and macOS.
2019-05-27 12:09:42 +02:00
Rémi Verschelde
900d90bb61 Git: Explicitly list binary files as such to avoid EOL change
text=auto works well in Git 2.10+ but it's broken in previous versions,
which are still used in production on e.g. Ubuntu 16.04 LTS.

Also fix a couple missed text files with CRLF terminators.
.bat files likely require it to be processed properly on Windows,
but core.autocrlf should take care of converting them on the fly
when checking out on Windows.
2019-05-25 10:43:48 +02:00
bruvzg
2b9ed68d6a
Add native window/taskbar icon support for Windows and macOS.
Co-authored-by: Markus Törnqvist <mjt@nysv.org>
2019-05-24 14:23:57 +03:00
Ibrahn Sahir
63068e2ccd Check project settings live before lookup in crash handler
In x11, windows and osx crash handlers, check project settings exists
before looking up the crash handler message setting.
Avoids crashing the crash handler when handling a crash outside project
settings lifetime. Instead omitting the configurable message and
continuing with trace dump.
2019-05-23 20:06:56 +01:00
Ibrahn Sahir
b660247216 Fixed uninitialised variable in x11 null cursor creation
Fully initialised color var.
Clarified intent a little with comments/layout.
2019-05-23 11:47:28 +01:00
Rémi Verschelde
c29ef774d8
Merge pull request #29032 from akien-mga/tools-exceptions-rtti
SCons: Keep exceptions and rtti on Android, iOS and HTML5 tools build
2019-05-21 17:10:51 +02:00
hbina085
f78baa5f93 added a const keyword for a methods that return constant literal... 2019-05-21 02:16:30 -04:00
Rémi Verschelde
4b20959d99 SCons: Keep exceptions and rtti on Android, iOS and HTML5 tools build
Those were disable to keep size small, and on Android avoid the dependency on the STL,
but for tools build (editor) this is not really a concern.

Note: as of today it's not possible to build tools=yes for those platforms, but this
change is one of the necessary steps to enable it.

Fixes #25262.
2019-05-20 16:51:20 +02:00
Rémi Verschelde
e0574e1d98 Fix typos with codespell
Using codespell 1.15.0.

Method:
```
$ cat > ../godot-word-whitelist.txt << EOF
ang
curvelinear
doubleclick
leapyear
lod
merchantibility
nd
numer
ois
ony
que
seeked
synching
te
uint
unselect
webp
EOF

$ codespell -w -q 3 -I ../godot-word-whitelist.txt --skip="./thirdparty,*.po"
$ git diff // undo unwanted changes
```
2019-05-19 13:10:35 +02:00
George Marques
c121d8871d
Allow project export to be canceled 2019-05-18 15:33:57 -03:00
bruvzg
22ee26849e
[macOS] Allow using user provided .icns files for exported app icons. 2019-05-17 08:49:21 +03:00
Rémi Verschelde
58cec3efc4 Fix OS_UWP::execute's signature after cd4449e
Same as #28919.
2019-05-16 08:48:03 +02:00
Fabio Alessandrelli
6622091eaf Fix OS_Javascript execute method
Signature was changed in OS via:

cd4449e7ab
2019-05-15 19:24:20 +02:00
Rémi Verschelde
e0517a12c5
Merge pull request #28518 from clayjohn/GLES2-MSAA
Added MSAA to GLES2 backend
2019-05-13 17:46:11 +02:00
bruvzg
5714a5f4ea
X11: Check if "_NET_FRAME_EXTENTS" atom is supported. 2019-05-09 19:12:31 +03:00
Aaron Franke
702b539405
Change "ID" to lowercase "id"
Reasoning: ID is not an acronym, it is simply short for identification, so it logically should not be capitalized. But even if it was an acronym, other acronyms in Godot are not capitalized, like p_rid, p_ip, and p_json.
2019-05-09 06:25:32 -04:00
clayjohn
a3d5aec68d added MSAA to GLES backend 2019-05-02 14:24:20 -07:00
Andrea Catania
2684e81682 Fixed game crash, regression of #26977
Co-authored-by: bruvzg <7645683+bruvzg@users.noreply.github.com>
2019-05-01 09:55:17 +02:00
Rémi Verschelde
ae41e35191
Merge pull request #27676 from qarmin/small_fixes_2
Small fixes to static analyzer bugs
2019-05-01 08:19:04 +02:00
Rémi Verschelde
d52b70fb5e SCons: Always use env.Prepend for CPPPATH
Include paths are processed from left to right, so we use Prepend to
ensure that paths to bundled thirdparty files will have precedence over
system paths (e.g. `/usr/include` should have lowest priority).
2019-04-30 13:12:06 +02:00
MJacred
1d86929dcb Fix application window not listed in taskbar (X11)
* for executable
* for editor and exported executable (on older Cinnamon versions)
2019-04-30 12:43:09 +02:00
Rémi Verschelde
419022ea89
Merge pull request #26977 from bruvzg/fix_x11_window_pos
Fix get_window_position / set_window_position on Linux
2019-04-30 12:07:09 +02:00
Rémi Verschelde
b2f6beb888
Merge pull request #28061 from guilhermefelipecgs/fix_19137
[Input] Release keys/actions pressed if window loses focus
2019-04-29 18:39:45 +02:00
Rémi Verschelde
f5cc29f9f3
Merge pull request #28185 from KLee1248/key_remapping
Re-maps KEY_BRACELEFT/RIGHT for OSX users
2019-04-29 17:44:33 +02:00
Rémi Verschelde
e583b75f5e
Merge pull request #28448 from Valentactive/fix-linux-recognition-ecutable-builds-clang
Fix builds made with Clang on some Linux distros (the equivalent of #23542 but for Clang)
2019-04-29 16:43:12 +02:00
Rémi Verschelde
0eaf32bb29
Merge pull request #28470 from Calinou/fix-windows-clipboard-line-endings
Convert line endings to CRLF in `OS.set_clipboard()` on Windows
2019-04-29 16:24:10 +02:00
Hugo Locurcio
be2e8e4047
Convert line endings to CRLF in OS.set_clipboard() on Windows
Windows applications typically expect CRLF line endings in clipboard
content.

This closes #28439.
2019-04-27 18:59:06 +02:00
Juan Linietsky
af9bb0ea15 Clean up latency related functions 2019-04-27 12:23:05 -03:00
Guilherme Felipe
c709dfdf06 [Input] Release keys/actions pressed if window loses focus
Co-authored-by: bruvzg <7645683+bruvzg@users.noreply.github.com>
Co-authored-by: Marcelo Fernandez <marcelofg55@gmail.com>
2019-04-27 12:05:12 -03:00
Michele Valente
c0fcd55f96 fix builds made with Clang on some Linux distros
This is the same as #23542 (Fix binaries incorrectly detected as shared
libraries on some linux distros) but for Clang. It should be fine with
Clang 4 or higher.
2019-04-26 15:50:06 +02:00
Rémi Verschelde
7e65a11bcf
Merge pull request #28402 from Valentactive/add-thinlto-support-x11
Add option to use ThinLTO
2019-04-25 22:23:31 +02:00
Michele Valente
51f9042a5b add option to use ThinLTO
This adds ThinLTO support when using Clang and the LLD Linker, it's
turned off by
default.
For now only support for Linux added as ThinLTO support on other
platforms may still be buggy.
2019-04-25 19:20:12 +02:00
Rémi Verschelde
24005bc03d
Merge pull request #28396 from akien-mga/scons-capture-the-flags
SCons: Review uses of CCFLAGS, CXXFLAGS and CPPFLAGS
2019-04-25 12:22:22 +02:00
Juan Linietsky
cf5881f574 Rename wrong field. 2019-04-24 17:01:20 -03:00
Juan Linietsky
a424d39f76 Remove forgotten strings in configuration files 2019-04-24 16:31:23 -03:00
Juan Linietsky
faaecd6987 Fixes to make exporting more responsive.
-Process and drop input in step functions.
-Hide editor file dialog right after pressing ok
-Use actual editor file dialogs for project export.
2019-04-24 15:52:15 -03:00
Rémi Verschelde
c2a669a9f0 SCons: Review uses of CCFLAGS, CXXFLAGS and CPPFLAGS
Many contributors (me included) did not fully understand what CCFLAGS,
CXXFLAGS and CPPFLAGS refer to exactly, and were thus not using them
in the way they are intended to be.

As per the SCons manual: https://www.scons.org/doc/HTML/scons-user/apa.html

- CCFLAGS: General options that are passed to the C and C++ compilers.
- CFLAGS: General options that are passed to the C compiler (C only;
  not C++).
- CXXFLAGS: General options that are passed to the C++ compiler. By
  default, this includes the value of $CCFLAGS, so that setting
  $CCFLAGS affects both C and C++ compilation.
- CPPFLAGS: User-specified C preprocessor options. These will be
  included in any command that uses the C preprocessor, including not
  just compilation of C and C++ source files [...], but also [...]
  Fortran [...] and [...] assembly language source file[s].

TL;DR: Compiler options go to CCFLAGS, unless they must be restricted
to either C (CFLAGS) or C++ (CXXFLAGS). Preprocessor defines go to
CPPFLAGS.
2019-04-24 16:57:58 +02:00
Kenneth Lee
5c5c3a590a Fixes build for Windows cross-compilation
Fixes #28299
2019-04-23 17:48:46 +00:00
KLee1248
8cbfc0365b Re-maps KEY_BRACELEFT/RIGHT for OSX users
Should fix #28098.
2019-04-19 02:31:15 +00:00
Rémi Verschelde
2dee231c8e
Merge pull request #28146 from volzhs/unique_id_android
Fix get_unique_id() on Android
2019-04-18 13:53:27 +02:00
volzhs
5a4b2087a0 Fix get_unique_id() on Android 2019-04-18 08:07:03 +09:00
Rémi Verschelde
0a40ac3246
Merge pull request #28058 from guilhermefelipecgs/fix_28024
Add Input::get_current_cursor_shape
2019-04-16 09:25:00 +02:00
Guilherme Felipe
1bae73d7d0 Add Input::get_current_cursor_shape
[Clean up] Removed unused/unnecessary methods.
2019-04-15 15:22:09 -03:00
Fabio Alessandrelli
6a1bf006a3 Move IDHandler JS module to platform from Websock 2019-04-12 12:41:49 +02:00
Windy Darian
ff3fdabc52 Force utf-8 source file encoding in MSVC
On Windows, when "Language for non-Unicode programs" were set to "Japanese (Japan)", MSVC would by default use Shift JIS (code page 932) to interpret source files, which would result in test_string failing to compile because of characters in `test_34()`. Forcing utf-8 for MSVC fixes the issue
2019-04-10 23:01:05 -04:00
Hein-Pieter van Braam
f75b9e6246
Merge pull request #27815 from Faless/unix/mem_access
Fix jump over uninitialized value in OS Unix/X11
2019-04-10 11:06:37 +02:00
Rémi Verschelde
c8994b56f9 Style: Apply new changes from clang-format 8.0
It seems to stay compatible with formatting done by clang-format 6.0 and 7.0,
so contributors can keep using those versions for now (they will not undo those
changes).
2019-04-09 17:09:48 +02:00
Fabio Alessandrelli
0bcf0314f7 Fix jump over uninitialized value in OS Unix/X11 2019-04-09 15:12:55 +02:00
Rémi Verschelde
846e7bbc53
Merge pull request #27490 from bruvzg/macos_non_resizable_fullscreen
Allow non-resizeable windows to enter full-screen mode.
2019-04-09 12:30:17 +02:00
Juan Linietsky
dd03dcbd5a Android now (optionally) builds the template when exporting
Added new way to create add-ons
Removed old way to create add-ons
2019-04-07 15:46:52 -03:00
Juan Linietsky
cd4449e7ab Add FileAccess::set_unix_permissions for Unix platforms 2019-04-07 15:45:30 -03:00
Hein-Pieter van Braam
01f7166d09
Merge pull request #26961 from ibrahn/fix-x11setcontext-access-freed
fixed an access after free in OS_X11::set_context. (long version)
2019-04-23 06:14:49 +03:00
Hein-Pieter van Braam
a76d59cba9
Merge pull request #27208 from Calinou/add-lld-linker
Add support for linking using LLD on X11
2019-04-23 06:11:48 +03:00
Ibrahn Sahir
9d0b3b300c fixed an access after free in OS_X11::set_context.
Added constructor and assignment operator for CharString
from const char* to simplify memory management when working with
utf8/ascii strings for APIs taking char*.
Reworked OS_X11::set_context to use CharString and avoid some manual
memory management.
2019-04-22 13:34:17 +01:00
Rémi Verschelde
a342131eba
Merge pull request #27673 from qarmin/small_fixes
Small fixes, mostly duplicated code
2019-04-22 12:00:34 +02:00
Rémi Verschelde
b4860ce3ac
Merge pull request #28166 from KLee1248/first_bug
Use SHGetKnownFolderPath instead of SHGetFolderPathW
2019-04-22 11:53:09 +02:00
Rémi Verschelde
f20c9c25eb
Merge pull request #28164 from BastiaanOlij/AndroidCameraPermission
Add camera permissions to android
2019-04-19 11:27:11 +02:00
Rémi Verschelde
d1c26674eb
Merge pull request #28051 from WindyDarian/no_utf8_for_vs2013
Ignore '/utf-8' flag on Visual Studio 2013
2019-04-19 08:41:43 +02:00
KLee1248
3d908f57d8 Use SHGetKnownFolderPath instead of SHGetFolderPathW.
When getting system directories for Windows, we currently use
SHGetFolderPathW. This is a deprecated function and doesn't support
"Downloads" folders.

As a replacement, this commit uses the newer SHGetKnownFolderPath
function, which is supported since Windows Vista. Godot 3.0 only
supports Windows 7+, so we don't need to use SHGetFolderPathW for
backwards compatibility.

Fixes #26876
2019-04-18 06:45:04 -07:00
Bastiaan Olij
fab84c7dff Add camera permissions to android 2019-04-18 23:16:41 +10:00
Windy Darian
bd7aa1b6f6 Ignore '/utf-8' flag on vs2013 2019-04-15 08:44:34 -04:00
qarmin
856a8226a5 Small fixes, mostly dupicated code 2019-04-08 11:03:37 +02:00
Rémi Verschelde
c562a7d149
Merge pull request #27067 from shartte/remove-context-gl
Remove ContextGL
2019-04-07 12:38:55 +02:00
Hendrikto
49a81308c0 Remove unused imports 2019-04-06 18:05:05 +02:00
Sebastian Hartte
3a8c6db513 Remove ContextGL since as an abstraction it's unused. 2019-04-06 17:52:52 +02:00
Rémi Verschelde
d450220bae Use mix rate and output latency constants in audio drivers
Fix default mix rate in Xaudio2 and potential shadowing issue in JAndroid.
2019-04-06 12:37:25 +02:00
Rémi Verschelde
a9a4936518
Merge pull request #27010 from BastiaanOlij/restructure_android_glue
Restructuring android glue code to make it easier to extend
2019-04-06 00:09:16 +02:00
Rémi Verschelde
e4a96164b6 SCons: add methods.using_clang to check used compiler
Also rename `use_gcc` to `using_gcc` to make it clear that it returns
a config but does not alter it.
2019-04-05 12:51:15 +02:00
Bastiaan Olij
b2c0a687f1 Restructuring glue code to make it easier to extend 2019-04-05 21:44:06 +11:00
qarmin
8460d0678c Small fixes to static analyzer bugs 2019-04-04 22:00:16 +02:00
Rémi Verschelde
44f1b390a3 SCons: Fix python3 compat for builtin_bullet=no 2019-04-03 11:25:01 +02:00
marxin
e7f22ebdcd Enable warnings=extra on clang and GCC testers.
And remove 2 warnings from warnings=extra.
2019-04-02 17:14:47 +02:00
Rémi Verschelde
ab76c649c5
Merge pull request #26958 from bruvzg/macos_hidpi_fixes
Fix hiDPI scaling support in `get_real_window_size` and `set_window.size`
2019-04-01 11:00:50 +02:00
bruvzg
7c7182483f
[macOS] Allow non-resizeable windows to enter fullscreen mode. 2019-03-28 15:37:10 +02:00
Pedro J. Estébanez
9c3ddf05cb Revert accidental commits
This reverts commit fb37284c02.
This reverts commit 4db0f51b9a.
2019-03-20 21:43:55 +01:00
Pedro J. Estébanez
fb37284c02 Create class for shared memory blocks [wip] 2019-03-20 20:44:43 +01:00
Hugo Locurcio
fd7f253649
Add support for linking using LLD on X11
LLD is often faster than GNU ld and gold, resulting in a better
development experience.

This closes #15364.
2019-03-18 16:52:00 +01:00
Sam Green
4946335d3d Add EAGLContext for the fallback case 2019-03-16 01:39:36 -07:00
Sam Green
440706814a Add logging around opengl es context creation. Ensure we can access project settings prior to creating our gl es context, so we can properly determine which driver to use. 2019-03-14 16:31:54 -07:00
bruvzg
85cc435103
[X11] Fix get_window_position to return absolute coordinates, change set_window_position to take window decorations into account. 2019-03-12 19:09:16 +02:00
Rémi Verschelde
53131635b4
Merge pull request #26962 from ibrahn/small-x11setcontext-fix
fix for access after free in OS_X11::set_context.
2019-03-12 16:28:43 +01:00
Ibrahn Sahir
7822cc9329 fix for access after free in OS_X11::set_context. 2019-03-12 13:41:02 +00:00
Rémi Verschelde
291c281fcf
Merge pull request #26957 from nekomatata/vs-natvis-fix
Fixed & improved Visual Studio custom debugger visualization
2019-03-12 14:03:27 +01:00
bruvzg
1b6330b125
[macOS] Fix hiDPI scaling support in OS.get_real_window_size and OS.set_window.size functions. 2019-03-12 11:41:41 +02:00
PouleyKetchoupp
fac0f76b7a Fixed & improved Visual Studio custom debugger visualization 2019-03-12 08:59:30 +01:00
Rémi Verschelde
f1b01c96b9 HTML5: Fix ETC export for GLES2 fallback on mobile 2019-03-11 16:49:33 +01:00
DESKTOP-3H3MR3A\eloisa
b22cf46fdb Request Android record permission when needed 2019-03-08 12:38:36 -03:00
Rémi Verschelde
201cb8d7ed
Merge pull request #26745 from akien-mga/android-modules-def
Define android/modules globally so it appears in Project Settings
2019-03-07 23:06:05 +01:00
Rémi Verschelde
c74bf2e6b1 Define android/modules globally so it appears in Project Settings
Until now people had to add it manually to project.godot to load custom modules.
2019-03-07 11:25:58 +01:00
Philip Whitfield
b717eb714c osx: update mouse position on mouse press 2019-03-07 10:10:33 +01:00
Rémi Verschelde
1100d6a8f2
Merge pull request #26672 from RandomShaper/fix-22955-android-context-loss
Restart game on GL context loss on Android
2019-03-06 22:53:12 +01:00
bruvzg
24d59b56d3
[macOS] Fixes NumPad keys detection, adds some missing key mappings. 2019-03-06 22:03:15 +02:00
Pedro J. Estébanez
2d0d64794e Restart game on GL context loss on Android
Bonus:
Remove useless old code about reload hooks

Fixes #22955.
2019-03-06 19:09:17 +01:00
Rémi Verschelde
e60465dd75
Merge pull request #26707 from bruvzg/fix_macos_mscroll
Fix macOS accumulated mouse scroll events.
2019-03-06 15:32:03 +01:00
bruvzg
37f0a6d99a
Fix macOS accumulated mouse scroll events. 2019-03-06 15:35:19 +02:00
volzhs
8920bb8c1b Fix directory check when exporting project
Fix #26702
2019-03-06 21:20:18 +09:00
Rémi Verschelde
b4d5c1ab5b
Merge pull request #26633 from akien-mga/driver-fallback-etc
Disable driver fallback to GLES2 by default
2019-03-06 00:57:49 +01:00
Rémi Verschelde
d592ee6be8
Merge pull request #26666 from Calinou/update-server-buildsystem
Update the server platform's `detect.py` to match x11's
2019-03-06 00:21:01 +01:00
Luis Martinez
9e465c9fd0 Fixes stderr silence; adds missing quote from exe args(windows)
8d117b214f/core/bind/core_bind.cpp (L452)
This function calls the bottom function

8d117b214f/drivers/unix/os_unix.cpp (L312)

OS.execute doesn't send out a value to stderr, so stderr defaults to
false, which will invoke this bottom line and always silence stderr.

8d117b214f/drivers/unix/os_unix.cpp (L315)

Some programs, such as FFmpeg, will print out to stderr with valuable
and vital information. This fixes stderr always being silenced, user can
now opt to have it be read as normal.
2019-03-05 17:07:00 -06:00
Rémi Verschelde
4a8f219660
Merge pull request #26664 from marxin/fix-25714-__bswap_16
Replace usage of __bswap_16 with BSWAP16 (#25714).
2019-03-05 23:13:23 +01:00
Rémi Verschelde
2e79ec973f
Merge pull request #26626 from rluders/misleading-error-message-export
Fixing misleading error message when trying to export
2019-03-05 22:55:16 +01:00
Hugo Locurcio
9e912a4c89
Update the server platform's detect.py to match x11's
This adds support for LTO, UBSAN/ASAN/LSAN, debugging symbols options
and `optimize=size` in the `server` platform.
2019-03-05 22:22:10 +01:00
marxin
f0d2f079c4 Replace usage of __bswap_16 with BSWAP16 (#25714). 2019-03-05 22:17:20 +01:00
Ricardo Lüders
3fdbdd8380 Fixes misleading error message when trying to export
This patch fixes the misleading error message when users
try to "export all" into an invalid destination path.

Closes #26539
2019-03-05 21:32:52 +01:00
Rémi Verschelde
b0f782a0e3 Disable driver fallback to GLES2 by default
GLES2 is not designed to be a drop-in replacement for the GLES3 backend,
so the fallback mode has to be used knowingly. It *can* make sense for
simple projects which make sure to handle the differences between both
rendering backends, but most users should stick to one supported backend.

By making it opt-in, we can now use this parameter to define whether to
export ETC textures to Android and iOS when using GLES3 + Fallback.

When using GLES3 without Fallback on Android, set the proper min GLES
version in the AndroidManifest.

Also made the option boolean and renamed it for clarity and to avoid
conflict with the previous String option (which would always evaluate as
"true" otherwise).

Fixes #26569.
2019-03-05 16:36:46 +01:00
bruvzg
75d75c68c4
Fix HTML5 quick preview URL 2019-03-05 15:48:11 +02:00
Sam Green
36d627a9cf Remove microphone from export options and distribution plist 2019-03-04 18:01:02 -08:00
Rémi Verschelde
b811207406 More style cleanup... 2019-03-04 10:11:29 +01:00
Juan Linietsky
a1e73dcc94 Add support for event accumlation (off by default, on for editor), fixes #26536 2019-03-03 19:53:13 -03:00
Juan Linietsky
8b4c4d9b2f Implement a more coherent (and way less hack) way to block animation updates, fixes #24618 2019-03-03 17:57:16 -03:00
Juan Linietsky
ae886a6f32 Ability to keep pumping messages while being debugged, may be a solution for #21431 2019-03-03 17:12:19 -03:00
Rémi Verschelde
9d002442b2 Improve VRAM texture compression checks for mobile/web
For HTML5, we need to support S3TC if running on desktop,
and ETC or ETC2 for mobile, so make this explicit.

Add logic to check for ETC2 support on GLES3,
and remove incorrect ETC feature for GLES3 on Android.

Fix ETC check invalidating templates on HTML5.
Fixes #26476.
2019-03-03 13:24:08 +01:00
Rémi Verschelde
a42549b8f7
Merge pull request #26474 from akien-mga/scons-silence-x11
SCons: Reduce spam from x11:can_build
2019-03-02 10:48:42 +01:00
Rémi Verschelde
c77c4ef3b1 SCons: Reduce spam from x11:can_build
When cross-compiling for non-X11 on Linux, it used to be quite spammy.
Now it will only print errors if you miss more than just pkg-config and x11.
2019-03-02 10:39:20 +01:00
Rémi Verschelde
1807e0f135 SCons: Move platform-specific Opus config to its module 2019-03-02 10:30:25 +01:00
Rémi Verschelde
351a2fa41c
Merge pull request #26353 from ivanarh/android_hide_keyboard_crash
Android: Fixed a possible crash in keyboard hide method.
2019-03-01 20:19:48 +01:00
Rémi Verschelde
482dcf5266
Merge pull request #26407 from marcelofg55/audio_input_android
Implement Audio Input support on Android
2019-03-01 08:51:00 +01:00
Marcelo Fernandez
29fb6b4e15 Implement Audio Input support on Android 2019-02-28 14:33:43 -03:00
Rémi Verschelde
1e266d874d X11: Fix drag and drop from non-latin paths
Fixes #25826.

Co-authored-by: bruvzg <7645683+bruvzg@users.noreply.github.com>
2019-02-28 12:32:39 +01:00
Ivan Ponomarev
288ff2fd08 Android: Fixed a possible crash in keyboard hide method. It's called not from main thread so InputMethodManager can't be used directly. 2019-02-27 16:59:50 +03:00
Ivan Ponomarev
1073f0b423 Android: Fixed problems with memory leaks due to absent ReleaseStringUTFChars calls. 2019-02-27 15:11:08 +03:00
Rémi Verschelde
426a6fdc17
Merge pull request #26134 from marxin/fix-Wsign-compare
Fix -Wsign-compare warnings.
2019-02-27 09:22:47 +01:00
marxin
e5f665c718 Fix -Wsign-compare warnings.
I decided to modify code in a defensive way. Ideally functions
like size() or length() should return an unsigned type.
2019-02-27 07:45:57 +01:00
Juan Linietsky
f669ebeeaf -Properly handle missing ETC support on export
-Added ability for resource importers to save metadata
-Added ability for resource importers to validate depending on project settings
2019-02-26 18:45:06 -03:00
Ivan Ponomarev
1d576f17a7 Fixed possible crash on iOS in applicationDidReceiveMemoryWarning method: event loop may be null when it's called. 2019-02-26 18:36:20 +03:00
Juan Linietsky
5eeb06ffd1 -Remove harcoded opengl extension testing from OS, ask rasterizer instead.
-Fixed a bug where etc textures were imported broken
2019-02-26 11:58:47 -03:00
Hein-Pieter van Braam
fc5792f2ea
Merge pull request #26160 from marxin/come-up-with-use_gcc
Come up with use_gcc.
2019-02-25 00:50:53 +01:00
Hein-Pieter van Braam
0fdcebfbb7
Merge pull request #26242 from serados/init_mouse_pos_win
Update Windows global mouse position at startup
2019-02-25 00:48:52 +01:00
Rémi Verschelde
69c0d32b93
Merge pull request #26240 from eska014/html5-preload-noown
Properly preload files, always use stdout/-err in HTML5 platform
2019-02-24 19:44:54 +01:00
Junwei Ng
731b152dc1 Update Windows global mouse position at startup
Fixes issue #8145 for Windows, in the same manner as
issue #21910 fixed it for X11.
2019-02-25 01:10:18 +09:00
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
Bastiaan Olij
6105a8beb1 Remove obsolete ANDROID_NATIVE_ACTIVITY 2018-12-02 00:48:37 +11:00
George Marques
22233ded4a Change custom permissions in Android export to an array
Don't limit the amount of permissions and makes it simpler to
understand.
2018-11-30 11:13:50 -02:00
Marcelo Fernandez
711bc1c07e Fix wrong size and position when windows is minimized on Windows 2018-11-30 00:36:48 -03:00
Leon Krause
c4784426bd
Merge pull request #22857 from marcelofg55/jsmic
Implemented audio input support for JavaScript audio driver
2018-11-28 12:34:08 +01:00
Andrea Beconcini
11a1624202 uwp export: fix existing template check 2018-11-27 20:20:54 +01:00
Marcelo Fernandez
3a702b3ed8 Implemented audio input support for JavaScript audio driver 2018-11-26 19:14:52 -03:00
bruvzg
56b26c4369
Fix macOS icon export (add 1024px PNG icon and 32px/16px RLE icons). 2018-11-26 16:12:36 +02:00
Hugo Locurcio
8c7087ff7f
Remove an unused script
[ci skip]
2018-11-24 16:33:31 +01:00
bruvzg
4554c682e6
Changes IME input to use notification instead of callback, exposes IME methods to gdscript/gdnative. 2018-11-23 14:07:48 +02:00
volzhs
96b1a190a3 Show error if required fields are not filled when exporting iOS 2018-11-23 07:01:29 +09:00
Simon Sikström
00b57d3bd2 Adding support for java.lang.Long values in Android GodotLib.calldeferred calls 2018-11-20 14:46:08 +01:00
Rémi Verschelde
a2a5793e13
Merge pull request #21339 from Placinta/master
Fix regular macOS build by passing -isysroot to compiler so correct system headers are found
2018-11-20 14:11:13 +01:00
Rémi Verschelde
7651b85782
Merge pull request #23822 from bruvzg/mac_109_compat_ver_check
[macOS] Change runtime OS version checks to allow build with MacOS 10.9 SDK
2018-11-20 14:01:02 +01:00
Rémi Verschelde
173b342ca7 Remove trailing whitespace
With `sed -i $(rg -l '[[:blank:]]*$' -g'!thirdparty') -e 's/[[:blank:]]*$//g'`
(+ manual revert of some thirdparty code under `platform/android`).
2018-11-20 11:15:02 +01:00
bruvzg
bbac90c859
[macOS] Change runtime OS version checks to allow build with MacOS 10.9 SDK, 2018-11-19 23:24:28 +02:00
Marcelo Fernandez
385832ed30 Fix X11 running a project with fullscreen setting on and resizable off with multiple screens 2018-11-18 23:03:54 -03:00
bruvzg
4aa441591c
[macOS] Disable setWantsLayer on macOS < 10.14 2018-11-18 16:20:29 +02:00
Ibrahn Sahir
4c90a66e74 Fix gcc version check when running scons in python 3. 2018-11-14 12:25:50 +00:00
Marcelo Fernandez
8705c01f5a Fix compile recent compile issues with gcc 5.5 2018-11-12 10:24:44 -03:00
Rémi Verschelde
9f4d89dffd
Merge pull request #23622 from RandomShaper/fix-windows-mouse-capture
Fix mouse mode restoration on Windows
2018-11-10 21:55:30 +01:00
Rémi Verschelde
54d33fabd1
Merge pull request #23618 from bruvzg/macos_spash_fix
[macOS] Fix blank splash screen
2018-11-10 21:46:47 +01:00
Pedro J. Estébanez
b5c56f6cca Fix mouse mode restoration on Windows
Fixes #23494.
2018-11-09 23:55:19 +01:00
bruvzg
30852d0237
[macOS] Fix blank splash screen 2018-11-09 21:47:23 +02:00
Rémi Verschelde
06c42d151c
Merge pull request #23542 from marcelofg55/no_pie
Fix binaries incorrectly detected as shared libraries on some linux distros
2018-11-09 16:12:16 +01:00
Rémi Verschelde
e7cb47e686
Merge pull request #23463 from hpvb/use-dri-prime-default
Set DRI_PRIME=1 by default on X11 if not already set
2018-11-08 14:21:12 +01:00
Marcelo Fernandez
34e2d2f4f7 Fix binaries incorrectly detected as shared libraries on some linux distros 2018-11-07 12:39:15 -03:00
Hein-Pieter van Braam
0aad11a6a7 Set DRI_PRIME=1 by default on X11 if not already set
This mirrors behavior on Windows and MacOSX where Godot tries to default
to a dGPU if it exists. This doesn't work for Nvidia optimus yet but
this can maybe be added later.
2018-11-06 22:31:35 +01:00
Rémi Verschelde
bf28c614b0
Merge pull request #23461 from hpvb/fix-23400
Properly export the various 'use dGPU' symbols when building with MingW
2018-11-05 11:30:06 +01:00
Rémi Verschelde
5d5227104e
Merge pull request #23499 from bruvzg/fix_osx_app_crash_and_black_spash
[macOS] Fix .app bundle crash and blank initial window
2018-11-05 09:39:57 +01:00
bruvzg
07aee14dd7
Fix initial blank screen on macOS Mojave (except splash). 2018-11-04 11:19:28 +02:00
bruvzg
cfce8de0b5
Fix .app bundle crash on macOS 2018-11-04 11:19:28 +02:00
Fabio Alessandrelli
f17d83e758 Fix UWP build.
Add missing os_uwp.cpp include for VisualServerWrapMT.
Add global env forced include to fix freetype in UWP.
2018-11-03 17:19:44 +01:00
Hein-Pieter van Braam
19d91f788d Properly export the various 'use dGPU' symbols when building with MingW
This fixes exporting the NvOptimusEnablement export when building with
MingW. This also adds the equivalent for AMD.

This fixes #23400
2018-11-03 10:55:03 +01:00
Rémi Verschelde
5beaea9891
Merge pull request #23389 from marcelofg55/multiple_ext
Export for OS X on OS X now lets you select .dmg or .zip
2018-11-02 11:07:18 +01:00
Rémi Verschelde
63d7c9be45
Merge pull request #23431 from buresu/fix-keycode
Fix keycode problem on OSX
2018-11-02 11:02:39 +01:00
Rémi Verschelde
8ac1bcfd3d Fix init of VisualServerRaster
Contrarily to what #23434 assumed, this is not a memory leak,
the VisualServerRaster instance is passed as a parameter to
VisualServerWrapMT's constructor.

Fixes #23437.
2018-11-01 19:23:12 +01:00
George Marques
4c9d734a75 Fix initialization of visual server in all platforms
Avoid leaking an extra instance when using threads. Also fix threaded
loading issues on Android and iOS.
2018-11-01 10:27:04 -03:00
Marcelo Fernandez
d51999f11d Export for OS X on OS X now lets you select .dmg or .zip 2018-11-01 10:08:26 -03:00
Naoto Kondo
ca2476cdb4 Fix keycode problem on OSX 2018-11-01 20:00:02 +09:00
Rémi Verschelde
fbc0e5d98d
Merge pull request #23320 from lethiandev/android-invalid-package-name-error
Add android export error on invalid package name
2018-11-01 10:18:04 +01:00
Rémi Verschelde
16f066c8f1
Merge pull request #23393 from marcelofg55/osx_crash
Fix OS X crash when running as .app
2018-10-31 09:54:11 +01:00
Ibrahn Sahir
9f172b634d Allow the server platform to build on linux again.
Fixed a logic error in platform/server/detect.py that prevented building
the server platform on linux.
2018-10-30 12:38:55 +00:00
Marcelo Fernandez
a069685fbb Fix OS X crash when running as .app 2018-10-29 21:50:41 -03:00
Rémi Verschelde
bfd1f09ac5 Style: Apply clang-format to wrongly formatted files 2018-10-29 23:47:40 +01:00
Rémi Verschelde
7e8cffc03f
Merge pull request #23382 from vnen/android-pad-fix
Prevent a device to be added/deleted more than once on Android
2018-10-29 23:43:43 +01:00
Rémi Verschelde
39a5678c38
Merge pull request #23387 from eska014/memgrowth-preload
Enable --no-heap-copy flag for HTML5 builds
2018-10-29 23:43:11 +01:00
Rémi Verschelde
7771fe5d4a
Merge pull request #23388 from eska014/html5-stubexec
Add proper stubs for OS_JavaScript::execute(), get_process_id(), kill()
2018-10-29 23:40:17 +01:00
Leon Krause
5c2c47a174 Add proper stubs for OS_JavaScript::execute(), get_process_id(), kill()
Avoids linker warnings and errors about undefined references.
2018-10-29 21:41:59 +01:00
Rémi Verschelde
4d9b8a98ba
Merge pull request #23279 from marcelofg55/osx_server
Server platform works on OS X too
2018-10-29 21:25:46 +01:00
Leon Krause
44e5d446c4 Enable --no-heap-copy flag for HTML5 builds 2018-10-29 21:08:51 +01:00
Xavier Sellier
7dcf779a8b
Prevent a device to be added/deleted more than once on Android
cherry-picked from fb5a601217
2018-10-29 13:04:36 -03:00
Marcelo Fernandez
fe93bb03fe Server platform works on OS X too 2018-10-29 12:54:51 -03:00
Konrad Nowakowski
2255d4fdfd Add android export error on invalid package name 2018-10-29 14:26:53 +00:00
Rémi Verschelde
8650793eac
Merge pull request #23317 from lupoDharkael/py-none
Dont use equality operators with None singleton in python files
2018-10-29 12:11:24 +01:00
Karen Schwane
a01ce6299c Move jcenter behind mavenCentral and google gradle repos to fix build problems 2018-10-28 19:20:30 +01:00
lupoDharkael
edcca5f7ad Dont use equality operators with None singleton in python files 2018-10-27 01:18:15 +02:00
Rémi Verschelde
9de724f327
Merge pull request #23091 from aaronfranke/mingw-warnings
Fix some compile warnings for Windows from Linux
2018-10-25 15:09:11 +02:00
M. Huri
b46ba24e3b Repaired mistyped of 'its' on several files. 2018-10-25 07:19:21 +07:00
Colin Kinloch
464842c62c Update mouse location on background scroll and window focus in macOS 2018-10-24 14:47:37 +01:00
Patrick Beard
d2ed3b224a Call -update when window becomes the key window 2018-10-23 07:22:40 -07:00
Max Hilbrunner
5bb34539e2
Merge pull request #23025 from voithos/enginejs
Add comments to javascript wrapper parts.
2018-10-20 15:30:05 +02:00
Aaron Franke
dc2e73499a Fix compile warnings for Windows from Linux
At least the ones I got when I compiled it using Mingw64 POSIX on Xubuntu 18.04. Plus use the Size2 of get_window_size() directly, rather than reconstructing it.
2018-10-19 09:11:14 -04:00
Dualtagh Murray
b902a2f2a7 Fixing warnings generated by MSVC
Fixes #22684.
2018-10-19 11:45:24 +02:00
Zaven Muradyan
61d5513525 Add comments to javascript wrapper parts.
The code in pre.js and engine.js is a bit confusing to see in isolation,
since the files aren't valid JS files by themselves. This just adds some
explanatory text to both files.

Fixes #22937.
2018-10-15 08:56:44 -07:00
dumitru-stama
4c9eb86cbf Fixed initialization of android modules 2018-10-14 17:32:01 -07:00
Wojciech Milkowski
3598165c4d Fix build with Android NDK r18
As a bonus there is no need to use undocumented Gradle API any more.
2018-10-08 22:35:18 +02:00
Fabio Alessandrelli
f8020bc976 Check getcwd return in X11 platform main. 2018-10-07 14:50:14 +02:00