Commit Graph

953 Commits

Author SHA1 Message Date
Rémi Verschelde 29c7118f32 Merge pull request #8913 from RandomShaper/ios-alert-2.1
Implement OS.alert() for iOS (2.1)
2017-05-26 07:56:24 +02:00
Pedro J. Estébanez b870ff6940 Implement OS.alert() for iOS 2017-05-25 17:30:36 +02:00
volzhs d4ef6216d3 Fix android payment logical error
getting sku detail runs only if mod != 0 which means querying 20*n will not get sku details.
referenced from https://github.com/googlesamples/android-play-billing/blob/master/TrivialDrive/app/src/main/java/com/example/android/trivialdrivesample/util/IabHelper.java#L1029-L1062
2017-05-19 12:11:59 +09:00
Pedro J. Estébanez deda04faff Upgrade Android build tools to the latest 2017-05-16 00:54:54 +02:00
Rémi Verschelde aa046a85dc Merge pull request #8740 from pixelpicosean/scrollingWithFactor
Implemented scrolling factor for precision trackpads for 2.1
2017-05-15 07:57:05 +02:00
Sean Bohan ee670f3724 Implemented scrolling factor for smooth trackpad scrolling
Working platforms platform: OSX, Windows.
Support for almost all ui elements, including project list.

Ported from 304a1f5b5a (#7864).
Fixes #492 and #3913.
2017-05-15 06:44:00 +08:00
Fabio Alessandrelli aa167fa04b Rename debug/debug_port to network/debug_port.
Expose it in editor settings.
2017-05-12 20:01:53 +02:00
Fabio Alessandrelli e9a7eeaf9c Fix UDP wait() not returning after first received packet
(cherry picked from commit 5c6715a291)
2017-05-12 20:01:53 +02:00
Fabio Alessandrelli bd26eacc59 Allow non blocking UDP put_packet in C++.
- Add blocking mode option to PacketPeerUDP.
- put_packet returns ERR_UNAVAILABLE when operation would block.
- ENet module uses non-blocking UDP.

(cherry picked from commit 5f681d0b0f)
2017-05-12 20:01:53 +02:00
Rémi Verschelde 05d83a62c6 Merge pull request #8695 from BastiaanOlij/mfi_support_2.1
iPhone MFI gamepad support
2017-05-12 18:16:41 +02:00
Rémi Verschelde 353ed88a54 Merge pull request #8724 from volzhs/android-jni
Fix compile error when use "android_add_jni_dir"
2017-05-12 08:24:32 +02:00
Rémi Verschelde 229c277585 Merge pull request #8722 from volzhs/fix-android
Fix possible memory leak for Android and update gradle
2017-05-12 08:24:09 +02:00
volzhs 69c4c4a20c Fix compile error when use "android_add_jni_dir" 2017-05-12 15:07:41 +09:00
volzhs c7d3aac505 Update to latest gradle 2017-05-12 14:38:23 +09:00
volzhs a6c74136b5 Fix possible memory leak for Android
/godot_dev/platform/android/java/src/com/google/android/vending/expansion/downloader/impl/DownloaderService.java:575: Error: The WIFI_SERVICE must be looked up on the Application context or memory will leak on devices < Android N. Try changing  to .getApplicationContext()  [WifiManagerLeak]
            mWifiManager = (WifiManager) getSystemService(Context.WIFI_SERVICE);
                                         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

   Explanation for issues of type "WifiManagerLeak":
   On versions prior to Android N (24), initializing the WifiManager via
   Context#getSystemService can cause a memory leak if the context is not the
   application context. Change context.getSystemService(...) to
   context.getApplicationContext().getSystemService(...).

1 errors, 0 warnings
2017-05-12 14:38:15 +09:00
BastiaanOlij de9efc2fdf iPhone MFI gamepad support 2017-05-09 08:57:17 +10:00
Rémi Verschelde e3cf067845 X11: Abort build if using OpenSSL 1.1.0+
Workaround until #8624 is fixed.

(cherry picked from commit 2976801012)
2017-05-06 19:01:33 +02:00
volzhs 7919ce782b Fix error or download again if use obb for Android 2017-04-26 03:43:38 +09:00
Rémi Verschelde ef351971d8 Drop EXEC PATHP?? super verbose info message
It seems to give nightmares to Windows users.

(cherry picked from commit dd55950b62)
2017-04-20 01:55:54 +02:00
Rémi Verschelde a27876d5ac Style: Apply clang-format (3.9.1) to Obj-C++ files 2017-04-09 14:03:52 +02:00
Rémi Verschelde 4b561e3e04 Merge pull request #8311 from BastiaanOlij/format_mm_2.1
Spaces to tabs and layout adjustments on .mm files
2017-04-08 16:49:51 +02:00
Rémi Verschelde 7f32db5ac9 Revert "8145 - Mouse Position is unknown until first mouse event on X11 & Win"
This reverts commit e5d63aaece.
Same reasoning as #8291.
2017-04-08 11:28:25 +02:00
BastiaanOlij 33ea9fc4a7 Spaces to tabs and layout adjustments on .mm files 2017-04-08 09:47:13 +10:00
Rémi Verschelde 2491754de7 Style: Fix some badly formatted files 2017-04-08 01:42:41 +02:00
Rémi Verschelde e9b045d9e5 Add "Godot Engine contributors" copyright line 2017-04-08 00:45:24 +02:00
Rémi Verschelde f71da5c8c5 Merge pull request #8273 from RandomShaper/fix-android-x86-2.1
Fix crash on Android-x86 (2.1)
2017-04-05 22:27:58 +02:00
Pedro J. Estébanez 212fca0c50 Fix crash on Android-x86 2017-04-05 22:16:04 +02:00
Sergey Pusnei e5d63aaece 8145 - Mouse Position is unknown until first mouse event on X11 & Win
- X11 update input->pos on EnterNotify
- X11 & Win call first-time events processing before main initialization

(cherry picked from commit c79e998d1f)
2017-04-05 08:08:08 +02:00
Ramesh Ravone 1c17e5b38d Update build.gradle.template
Updating project repository,
added jcenter() since Android Studio uses it by default.

https://www.jfrog.com/knowledge-base/why-should-i-use-jcenter-over-maven-central/
(cherry picked from commit 77c81a21d8)
2017-04-05 08:07:01 +02:00
Rémi Verschelde b3d1113ae3 Merge pull request #8152 from Hinsbart/input_id_2.1
[2.1] Better handling of joypad device IDs.
2017-03-27 08:51:15 +02:00
Andreas Haas 8c06da0d49
Better handling of joypad device IDs.
Now InputDefault is responsible for giving out joypad device IDs to the platform, instead of each platform handling this itself.
This makes it possible for c++ modules to add their own "custom" gamepad devices, without the risk of messing up events in case the user also has regular gamepads attached (using the OS code).
For now, it's implemented for the main desktop platforms.
Possible targets for future work: android, uwp, javascript
2017-03-26 00:12:11 +01:00
Rémi Verschelde 31107daa1a SCons: Add option to toggle warnings (on by default)
All the warnings are factored out of the platform-specific files and moved to
SConstruct. Will have to check that it does not introduce regressions on some
platforms/compilers.
2017-03-25 09:24:29 +01:00
Rémi Verschelde 492f6e06c0 Merge pull request #8088 from BastiaanOlij/android_gravity_2.1
Android gravity vector Godot 2.1
2017-03-24 22:49:23 +01:00
Rémi Verschelde fd17d301d0 Merge pull request #8100 from BastiaanOlij/ios_magnetometer_2.1
Fixing magnetometer on iOS
2017-03-23 09:57:29 +01:00
Fabio Alessandrelli 15ecdb5f00 Fix buffer size check in UDP socket.
We were reserving 12 bytes from the buffer for ip, port, and length, but since
IPv6 introduction we should be reserving 24 (IPv6 are 16 bytes)

(cherry picked from commit 5dc7c920bf)
2017-03-22 21:11:49 +01:00
Fabio Alessandrelli 994df5df5c Use default UDP ring buffer size of 65536 for clients
We should probably create a specific function for setting the
recv buffer anyway. UDP sockets does not need to bind (listen)
to be able to call recvfrom. This is especially useful for clients
who just call set_send_address and start communicating with a server.

(cherry picked from commit 9336857132)
2017-03-22 21:07:27 +01:00
Fabio Alessandrelli 7dbccc9a57 Fix bug causing UDP socket to close after the first send if not listening
The ring buffer for receiving packets was not resized in constructor

(cherry picked from commit 68dc969f8c)
2017-03-22 21:05:27 +01:00
Fabio Alessandrelli 9f41c0a356 Avoid deadlock when writing/reading data on a connecting TCP socket
TCP status polling is always performed as non blocking.
Trying to put a packet on a connecting socket will fail immediately.

(cherry picked from commit fa0cb7da0e)
2017-03-22 21:03:26 +01:00
Fabio Alessandrelli d9525082fe Remove set_ip_type from network classes (no longer needed)
- TCP:
  - `listen` bind to wildcard "*" -> dual stack socket
  - `listen` bind to address -> socket from address type
  - `connect` -> resolve using best protocol (UNSPEC), socket from address type

- UDP:
  - `listen` bind to wildcard "*" -> dual stack socket
  - `listen` bind to address -> socket from address type
  - `put_packet`/`put_var` -> resolve using TYPE_ANY (UNSPEC), socket from address type
    (to change socket type you must first call `close` it)

(cherry picked from commit 88a56ba783)
2017-03-22 21:00:23 +01:00
Fabio Alessandrelli 0b9684a085 Implement UDP listen bind address
(cherry picked from commit 2fe4ef6699)
2017-03-22 20:25:56 +01:00
Fabio Alessandrelli 43d992fc34 Implement TCP Server bind address
(cherry picked from commit b2839343ca)
2017-03-22 20:25:52 +01:00
Fabio Alessandrelli 603105df18 Convert validity checks of IP_Address to is_valid method.
(cherry picked from commit 98a7e2b4e0)
2017-03-22 20:01:41 +01:00
Fabio Alessandrelli aeffe74a27 Avoid calling close when polling a UDP peer without socket
(cherry picked from commit e4b9b37ccf)
2017-03-22 20:01:13 +01:00
Fabio Alessandrelli ccf37c4ca2 TCP connect always opens correct socket type
TCP client connections does not need to rely on ipv6 dual stack sockets

(cherry picked from commit 55b4f3686d)
2017-03-22 15:40:31 +01:00
BastiaanOlij 4b7d1d8c15 Fixing magnetometer on iOS 2017-03-21 23:50:53 +11:00
BastiaanOlij cc6810c030 Android gravity vector Godot 2.1 2017-03-21 22:45:24 +11:00
Andreas Haas c5c546fb7f X11: Don't reset mouse cursor theme.
On KDE (and possibly others) the "default" cursor theme is actually some system default, not the one you've set in the desktop setting.
This was especially annoying when using a white cursor, as Godot would then reset back to a dark one.
In my case it was also keeping the cursor from changing its shape.

(cherry picked from commit fc84ccc468)
2017-03-19 00:44:22 +01:00
Ramesh Mani Maran f2f2369db8 android: adding classpath and gradle plugins
(cherry picked from commit 27c7d253aa)
2017-03-19 00:44:13 +01:00
denis e3e86567ba Update mouse position on touch and release events (Android)
(cherry picked from commit 55835167a4)
2017-03-19 00:42:58 +01:00
Rémi Verschelde f8db8a3faa Bring that Whole New World to the Old Continent too
Applies the clang-format style to the 2.1 branch as done for master in
5dbf1809c6.
2017-03-19 00:36:26 +01:00
Rémi Verschelde 1b0e2b0c39 Refactoring: rename tools/editor/ to editor/
The other subfolders of tools/ had already been moved to either
editor/, misc/ or thirdparty/, so the hiding the editor code that
deep was no longer meaningful.

(Manual redo of 49c065d29c)
2017-03-18 23:45:45 +01:00
Rémi Verschelde 16b78da941 Style: Various fixes to play nice with clang-format
(cherry picked from commit 2a0ddc1e89)
2017-03-18 23:13:47 +01:00
Rémi Verschelde 2d479aa0c6 Style: Prevent clang-format on JS code
(cherry picked from commit 39114178a0)
2017-03-18 22:52:28 +01:00
Rémi Verschelde dbf0137576 Style: Fix statements ending with ';;'
(cherry picked from commit f44ee891be)
2017-03-18 21:14:33 +01:00
Rémi Verschelde 9992509b0d iphone: Drop unused Appirater thirdparty API
(cherry picked from commit 481e511082)
2017-03-18 20:22:23 +01:00
Ramesh Mani Maran 9b26e9c9ac support for multiple maven url
(cherry picked from commit aa7490ffd0)
2017-03-18 20:21:49 +01:00
Shlomi Fish cb2cdce6b8 Fix failing build on mageia v6 x64 linux.
There was an error about undeclared malloc()+free().

(cherry picked from commit 0ef3d22d98)
2017-03-18 20:19:57 +01:00
Ignacio Etcheverry 77cb8f058d Replace misuse of list iteration
(cherry picked from commit 0cd309c5c7)
2017-03-18 20:13:17 +01:00
Hein-Pieter van Braam dffdf28349 X11 return to cwd at exit
During runtime godot calls chdir() several times. This doesn't really
matter normally but when using tools such as gprof the location of the
profiling data is kind of hard to intuit.

With this PR we simply store the current working directory at start and
restore it once we're almost done exiting.

This doesn't use the OS abstractions as when we need to get the current
workdir we haven't yet initialized it (by necessity). This would break
if we tried to build X11 for windows, but since the X11 target is
hardcoded to use the UNIX abstractions I don't think it matters.

(cherry picked from commit d0c2015fe1)
2017-03-18 20:12:42 +01:00
Brett-Mitchell 616850b3c0 Fix for issue #7766
Add initialization for OS_OSX.mouse_mode in OS_OSX::OS_OSX().  mouse_mode now defaults to OS::MOUSE_MODE_VISIBLE.
(cherry picked from commit 6921e11805)
2017-03-18 20:09:45 +01:00
Saracen 919c1d627f Fix glitches when sampling relative cursor data in CAPTURED mouse mode on Windows.
(cherry picked from commit 523b69771b)
2017-03-18 20:06:40 +01:00
marcelofg55 97fef612fb Fix issues with set_window_resizable on x11
(cherry picked from commit 474e3ac055)
2017-03-18 19:56:16 +01:00
Ferenc Arn 5e90183ba4 Use -Ofast on x11. Also introduced use_lto option.
debug_release doesn't turn off optimizations for release target now. Ensure that sanitizer options apply to both C and C++ files.

Built-in optimization/debug flags are prepended such that user-specified flags can override them.

Based on and around the discussion in PR #5194.

(cherry picked from commit 7a85d25218)
2017-03-18 19:52:35 +01:00
Fabio Alessandrelli b9451ce58d Fix gibberish output for windows/mingw.
%ls should be used instead of %s or %S to speficy narrow/wide charstring
in wprintf fwprintf

Fixes #6252

(cherry picked from commit 3df934acad)
2017-03-18 19:42:21 +01:00
Jerome67000 ab7faa1281 #7215 try to fix adb bad targeting user on device
(cherry picked from commit 8c19a6cb85)
2017-03-18 19:41:37 +01:00
Jesper Bækdahl e5f0183b0a x11: don't wait for window to be mapped
(cherry picked from commit 8f7a3884fd)
2017-03-18 19:29:46 +01:00
BastiaanOlij 8436a34305 Core motion for Godot 2.x (based on PR 7127) 2017-03-09 21:46:38 +11:00
eska 9518401100 Add window features in web export
- Add 'window' (canvas) resize, maximize and fullscreen
 - Implement get_screen_size
 - Fix fullscreen resolution

(cherry picked from commit 3e1b437315)
2017-03-07 14:11:00 +01:00
eska d34c530a7f Revert "Add fullscreen features in web export"
This reverts commit 17422f1f86.
2017-03-07 14:11:00 +01:00
volzhs c8edf071da Fix handling input for Android 2017-03-04 00:12:35 +09:00
Pedro J. Estébanez fec41c528c Fix resources for Android modules not being merged
Fixes #7421
2017-01-24 16:29:09 +01:00
Fabio Alessandrelli 8322c1aa64 Fix bug in windows TCP poll function
Bug introduced when implementing TCP disconnection detection.
(too much yank-paste).
Fixes #7545

(cherry picked from commit c356ec5e8b)
2017-01-16 15:51:43 +01:00
Fabio Alessandrelli 9c8ecb45f8 Improvements to scons defined WINVER/_WIN32_WINNT
(cherry picked from commit 65483d57bf)
2017-01-12 19:15:30 +01:00
Ignacio Etcheverry 8a5596322d Detect bits when building with MinGW
(cherry picked from commit 460f030b73)
2017-01-12 19:15:30 +01:00
Rémi Verschelde d66740175e Windows: Define _WIN32_WINRT to 0x0600 (Vista)
Passed as a compiler define to be sure it is always define before windows.h
is loaded. This means that Godot officially requires Vista API or later, it will
not work on Windows XP or earlier.

Also fix a bogus check for Windows 7 API.

(cherry picked from commit 6323779596)
2017-01-12 19:15:30 +01:00
Rémi Verschelde 5672852351 x11: Improve logic for cross-dependencies between freetype, zlib and libpng
Fixes #7373.

(cherry picked from commit d945c4e58e)
2017-01-12 19:15:30 +01:00
Rémi Verschelde d8223ffa75 Welcome in 2017, dear changelog reader!
That year should bring the long-awaited OpenGL ES 3.0 compatible renderer
with state-of-the-art rendering techniques tuned to work as low as middle
end handheld devices - without compromising with the possibilities given
for higher end desktop games of course. Great times ahead for the Godot
community and the gamers that will play our games!

(cherry picked from commit c7bc44d5ad)
2017-01-12 19:15:30 +01:00
Gustav Lund f10a78e5c0 fix for crash when no ALSA or Pulse installed on linux
(cherry picked from commit 2495e8a941)
2017-01-12 19:15:27 +01:00
Rémi Verschelde 5b27f05e7e Fix console output for MinGW compilers
Reworked patch from @jay3d (#7116).
(cherry picked from commit f28ff8a208)
2017-01-12 19:15:27 +01:00
volzhs 2e74bdab35 Add alert window on Android
(cherry picked from commit 9a20068ab7)
2017-01-12 19:15:26 +01:00
BastiaanOlij ef009a8b91 Set minimum version to 10.9 building OSX
(cherry picked from commit da5651fbb9)
2017-01-12 19:15:26 +01:00
Fabio Alessandrelli 00fdcf3cd0 IP_Address now handle IPv4 and IPv6 transparently
IP_Address changes:
- Converts to and from String transparently while handling IPv4 as IPv6
  mapped (::ffff:[IP]) address internally.
- Completely remove AddrType enum.
- Setting/Getting of ip array is now only possible through dedicated functions
  (ie. set_ipv4, get_ipv4, set_ipv6, get_ipv6)
- Add function to know if the address is a valid IPv4 (for IP implementation and enet)

(cherry picked from commit 1aff508dd9)
2017-01-04 00:46:33 +01:00
Fabio Alessandrelli e8a6cbc897 Migrate int.IP_TYPE_ constants to IP.TYPE_
(cherry picked from commit c18c5013f8)
2017-01-04 00:46:32 +01:00
Fabio Alessandrelli 47ae6c6507 Move V6ONLY flag selection inside helpers
(cherry picked from commit 4d90a4fcd5)
2017-01-04 00:46:32 +01:00
Fabio Alessandrelli 5e79ac72b7 Automatically map IPv4 address to IPv6 when needed
(cherry picked from commit 9200da58e4)
2017-01-04 00:46:32 +01:00
Fabio Alessandrelli a46a643f90 Use an instance variable for ip_type in raw sockets
PacketPeerUDP/StreamPeerTCP/TCP_Server now uses an instance variable
to store the selected ip_type (IPv4/IPv6/ANY, where ANY = dual stack).
All calls to resolve addresses, sending/receving data, connecting/listening
will use that socket type.

(cherry picked from commit 95bdd97768)
2017-01-04 00:46:32 +01:00
Fabio Alessandrelli c030e602e5 Properly handle tcp connection failure
(cherry picked from commit 4f07b595a1)
2017-01-04 00:46:32 +01:00
Fabio Alessandrelli 1a7f14b206 [IPv6] Fix windows build script (link to ws2_32) 2016-12-11 18:12:46 +01:00
Fabio Alessandrelli 754e9aa60a TCP/UDP Listen sockets can now be set to IPv6 only
(cherry picked from commit eb27e993f0)
2016-12-11 18:12:46 +01:00
Fabio Alessandrelli 70a6791150 Fix windows debugger connection problems.
Unify network socket creation between platform.
Ensure IPV6_V6ONLY flag is not set on sockets (allow IPv4 connection in IPv6 socket, dual-stack).

(cherry picked from commit 812908e236)
2016-12-11 18:12:45 +01:00
Fabio Alessandrelli 6e0de0cce8 TCPServer listen now default to IP type ANY (v6 socket with v4 support)
(cherry picked from commit ee69bd81cf)
2016-12-11 18:12:45 +01:00
Fabio Alessandrelli 04def2161e Fix PacketPeerUDP get_packet_port()
Properly convert port field from network to system ordering on incoming packets.

(cherry picked from commit 25e29972a9)
2016-12-11 18:12:45 +01:00
Fabio Alessandrelli b3443fd848 Pass correct address size (ipv4,ipv6) to socket connect, bind, sendto
The address size passed to network system calls now reflects the the actual IP type (v4 or v6).
Fix Windows and OSX ipv6 sockets

(cherry picked from commit 80e911647c)
2016-12-11 12:35:06 +01:00
Ariel Manzur d8b0070b8c added windows support for ipv6, cleaned up unix code
(cherry picked from commit 672225b710)
2016-12-11 12:35:06 +01:00
eska 5ede1a1226 Emit asm.js code into a dedicated file for asm.js export
This helps prevent browser lockups during start-up at the cost of having
to distribute an extra file.
2016-12-04 02:52:14 +01:00
eska 17422f1f86 Add fullscreen features in web export
- Implement fullscreen control, get_window_size, get_screen_size
 - Fix fullscreen resolution
2016-12-04 02:52:14 +01:00
eska 49e22aa83f Fix some mouse bugs in WebAssembly/asm.js
- Emit mouse wheel release events
 - Set button masks, fixes #5092
2016-12-03 15:33:59 +01:00
eska 6d86a63648 OS additions and fixes for WebAssembly/asm.js
- Implement alert, shell_open, set_window_title
 - Add locale lookup, fixes #2477
 - Print without color control sequences
 - Move get_executable_path implementation to OS_JavaScript
2016-12-03 15:33:32 +01:00
Rémi Verschelde a3582fa3cb png: Allow building shared freetype with bundled libpng
This was the behaviour when building Godot 2.1, which allows to build against
Ubuntu 12.04 and its freetype that links old libpng12, while still bundling
libpng16.

(cherry picked from commit 4965ddfaa1)
2016-11-19 14:09:12 +01:00
Rémi Verschelde 326978dcce Revert "libpng: Fix erroneously linking against libpng12 on old distros"
This reverts commits 5fa1bb331a
and ec4be71fad.

Looks like Debian/Ubuntu are not even shipping libpng16 nowadays in their
stable releases, we'll have to go back to statically linking our own
libpng16 to wait for them to stop being 5 years behind everybody.

(cherry picked from commit c32766a482)
2016-11-19 13:40:53 +01:00