Commit graph

592 commits

Author SHA1 Message Date
Rémi Verschelde 734045667d Merge pull request #9100 from RandomShaper/optimize-2d-lighting-2.1
Add optimizing AT_LIGHT_PASS builtin to canvas shaders (2.1)
2017-06-15 15:12:43 +02:00
Rémi Verschelde 8536d21931 Merge pull request #9101 from RandomShaper/filtered-texscreen-2.1
Add option for filtered texscreen (2.1)
2017-06-15 13:35:33 +02:00
Pedro J. Estébanez 184ef18420 Add optimizing AT_LIGHT_PASS builtin to canvas shaders
This one allows for complex shaders paired with a simple lighting shader to skip code that would otherwise be pointlessly (and wastefully) run during the light pass.
You can use `if (AT_LIGHT_PASS) , negated or not, and that will be converted to a preprocessed #if when the shader is compiled.
Depending on your game (number of items and lights), this can be a *significant* performance gain, or at least avoids relying on the driver's optimizing abilities.
2017-06-15 02:03:25 +02:00
Pedro J. Estébanez 8e4c60756a Add option for filtered texscreen 2017-06-08 20:19:04 +02:00
George Marques b2f8a365f2
Fix cherry-picking issues caused by code updates 2017-06-07 12:59:42 -03:00
George Marques 1cb77c3684
Patch thirdy-party libraries to build for WinRT
- Patch enet code.
- Patch OpenSSL code and add shims for unavailable API.
- Add extra definition header for Freetype.
2017-06-07 11:36:00 -03:00
George Marques c51f54749f
Fix drivers coding for WinRT
- Add a proper function to retrieve IP addresses.
- Solve issues with Windows FileAccess and DirAccess to use the same code
  for WinRT.
- Add patches to the GLES2 rasterizer to workaround ANGLE issues.
2017-06-07 11:36:00 -03:00
Rémi Verschelde 6cf507f004 Move other lone thirdparty files to thirdparty/misc
Also move Box2D ConvexDecomposition contrib code to
thirdparty/b2d_convexdecomp.

(cherry picked from commit d4029aa51a)
2017-05-26 23:39:47 +02:00
Fabio Alessandrelli baa175d7f8 Fix local ip addresses (interfaces) detection.
Ignore non-IP addresses for both windows and unix

(cherry picked from commit a1c41be569)
2017-05-12 20:01:53 +02:00
Fabio Alessandrelli 0dc62633e6 Socket helpers now fall back to ipv4 on systems where ipv6 is disabled.
(cherry picked from commit 020f6a7f20)
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 e9b045d9e5 Add "Godot Engine contributors" copyright line 2017-04-08 00:45:24 +02:00
Rémi Verschelde 93107f4245 Merge pull request #8141 from elasota/fix-unshaded-spillover
Fix renderer sometimes not applying "unshaded" flag (2.1)
2017-03-27 08:47:15 +02:00
elasota 5d691350c4 Fixed "unshaded" flag not being updated if light_type and receive_shadows_state didn't change. 2017-03-24 20:27:06 -04: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 86de0bd081 Bind to IPv4 on OpenBSD when using wildcard
OpenBSD does not support binding on both IPv4 and IPv6 using the same socket

(cherry picked from commit 619e7a2c8b)
2017-03-22 21:01:14 +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
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 2664549916 Prevent MSVC build issue after clang-format includes reorder 2017-03-18 23:49:09 +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 dbf0137576 Style: Fix statements ending with ';;'
(cherry picked from commit f44ee891be)
2017-03-18 21:14:33 +01:00
Hein-Pieter van Braam c67b08300a Add a simple signal handler for SIGCHLD on Unix
This fixes #6631

(cherry picked from commit cff6840ff7)
2017-03-18 20:05:57 +01:00
Pedro J. Estébanez 1e79f80b90 Finish fix for POSITION in 2D shaders 2017-03-06 18:31:29 +01:00
saltpowered 6a62831195 fix for https://github.com/godotengine/godot/issues/3226 2017-01-17 01:05:58 -06:00
Fabio Alessandrelli 9c8ecb45f8 Improvements to scons defined WINVER/_WIN32_WINNT
(cherry picked from commit 65483d57bf)
2017-01-12 19:15:30 +01:00
Rémi Verschelde 93a83c81f0 Windows: Workaround missing includes in MinGW-w64 < 4
The MinGW-w64 version we have on our Travis build environment (Ubuntu 12.04,
mingw-w64 2.0.1, gcc 4.6) is old and has some missing includes in the
dependencies of the `tcpmib.h` header [0] [1] [2].
Those were not triggered before 6323779596
probably due to conflicting WINVER definitions which prevented triggering the code
specific to >= 0x0600 (Vista). We ensure it won't be triggered by defining the
_WIN32_WINNT macro to Windows XP compatibility.
(cherry picked from commit b24fe6879a)
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
lonesurvivor d2240404e3 Fix for the huge audio latency of the SamplePlayer (>200 ms)
- fixes PulseAudio, ALSA and RtAudio driver
- cleans up the driver files for better readability (mostly whitespace-related stuff)
- makes ALSA and Pulseaudio actually use the global setting "audio/mix_rate" for the sample rate instead of a
fixed value (RtAudio did this already)

(cherry picked from commit da6b6c2dd7)
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
REBELLIOUSX\Rebel_X 2fbae72d14 Fix issue #7331
A Drive with "Z" letter assigned to it on Windows will be shown.

(cherry picked from commit 20d6af6028)
2017-01-12 19:15:28 +01:00
Pedro J. Estébanez 8589a1b117 Fix uniforms with the same name shadowing others
Follow-up of #7344
2017-01-10 17:05:31 +01:00
Rémi Verschelde a86dae5761 Merge pull request #7141 from Faless/2.1.x-ipv6
Cherry pick IPv6 patches to 2.1.x
2017-01-04 08:38:28 +01:00
Fabio Alessandrelli ac9f0aea1a Remove old unused AI_V4MAPPED flag to getaddrinfo
(cherry picked from commit de23ce11b5)
2017-01-04 00:46:33 +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 19b31297ec Fix _set_ip_addr_port not setting the address.
(cherry picked from commit cdc1ca0f13)
2017-01-04 00:46:32 +01:00
Fabio Alessandrelli 4635671de5 Fix getaddrinfo failing on android
(cherry picked from commit 311f1f165b)
2017-01-04 00:46:32 +01:00