Commit graph

224 commits

Author SHA1 Message Date
Rémi Verschelde 7ad14e7a3e Dead code tells no tales 2017-08-27 22:13:45 +02:00
Rémi Verschelde bd282ff43f Use HTTPS URL for Godot's website in the headers 2017-08-27 14:16:55 +02:00
Pedro J. Estébanez d806ad4a3d Implement custom thread numbering for POSIX
For every UNIX-derived (Android, Linux, macOS, iOS) flavor, a global counter is atomically incremented on thread start. That id is kept as thread-local storage.

Therefore, thread ids are sequential numbers, trivially comparable. This improves the previous state of things, in which `pthread_t` were casted to `Thread::ID` and unportabily compared. Also big, ugly thread ids appeared.
2017-08-24 07:02:55 +02:00
Pedro J. Estébanez a560a62118 Make OS::delay_usec() more reliable on UNIX
Implemented with `nanosleep()`. `usleep()` is deprecated.
Also loops to ensure that __at least__ the requested time is waited, accounting for spurious interruptions.

May help in situations like reattempting to connect to the debugger.
2017-08-24 07:02:55 +02:00
Juan Linietsky 247c2f7be3 Revert "Reworked change_dir to support symlinks" 2017-08-21 18:06:01 -03:00
Rémi Verschelde 22d21ebef0 Merge pull request #8144 from supagu/symlink
Reworked change_dir to support symlinks
2017-08-17 11:50:21 +02:00
TwistedTwigleg 00f6c85928 Synchronize parameter names in definition and declaration
Fixes #10244.
2017-08-16 17:22:23 +02:00
Wilson E. Alvarez 21d281c4a9 Use const reference where favorable 2017-08-14 13:28:06 -04:00
Fabio Alessandrelli f863c0ca14 Explicitily unsed AI_NUMERICHOST flag to fix HTML5 2017-08-11 19:39:36 +02:00
Indah Sylvia 5ae78fdf6a Makes all Godot API's methods Lower Case 2017-08-07 18:24:35 +07:00
Karroffel 135c2112ad added an optional parameter to OS symbol lookup
When looking up a symbol from a library, previously an error was
shown when the symbol did not exist. That caused confusion when the
lookup was completely optional.
This adds a new parameter to that method so that those errors can
be handled manually if needed.
2017-07-27 11:13:21 +02:00
Juan Linietsky 25678b1876 -Renamed GlobalConfig to ProjectSettings, makes more sense.
-Added system for feature overrides, it's pretty cool :)
2017-07-19 17:06:03 -03:00
Juan Linietsky bbada82f80 -Reorganized all properties of project settings (Sorry, Again).
(Lot's of bloat accumulated, so it was time for clean up.)
-Made EditorSettings and ProjectSettings search more useful (search in sections too)
2017-07-17 22:18:58 -03:00
David Carlier df87ad14d0 get_executable_path slight change to make it work under OpenBSD 2017-07-16 10:53:51 +01:00
Poommetee Ketson e3998528e0 BuildSystem: generated files have .gen.extension 2017-06-25 07:55:01 +07:00
Fabio Alessandrelli a1c41be569 Fix local ip addresses (interfaces) detection.
Ignore non-IP addresses for both windows and unix
2017-05-08 22:27:06 +02:00
Fabio Alessandrelli 020f6a7f20 Socket helpers now fall back to ipv4 on systems where ipv6 is disabled. 2017-05-08 21:53:23 +02:00
Fabio Alessandrelli 5c6715a291 Fix UDP wait() not returning after first received packet 2017-05-05 17:41:11 +02:00
Sergey Pusnei 8589ca3903 Rename [gs]et_pos to [gs]et_position for Controls
Control set_pos -> set_position
Control set_global_pos -> set_global_position
[gs]et_mouse_pos -> [gs]et_mouse_position
[gs]et_global_mouse_pos -> [gs]et_global_mouse_position
fixes #8005
2017-04-10 08:27:34 +02:00
Rémi Verschelde df61dc4b2b Add "Godot Engine contributors" copyright line 2017-04-08 00:11:42 +02:00
Karroffel 741800f5cc [DLScript] fixed android builds now
... really.
2017-04-06 14:00:54 +02:00
Fabian Mathews d3b7d42784 Reworked change_dir to support symlinks 2017-04-06 20:43:34 +09:30
Karroffel fd55308786 added dlscript module
This module was written by bojidar-bg and me, with the help of ClikCode and touilleMan.

This adds a module to Godot that enables the use of dynamic libraries as a source for scripts.
That also allows third party libraries to be linked to Godot more easily and without creating modules.

For a readme see https://github.com/GodotNativeTools/godot_headers/blob/master/README.md
2017-04-03 17:20:11 +02:00
Karroffel 67f59bc2d9 increased maximum number of scripting languages 2017-04-03 16:10:26 +02:00
Karroffel 2281942fb3 Added methods for opening dynamic libraries to OS 2017-03-29 23:05:15 +02:00
Fabio Alessandrelli 5f681d0b0f 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.
2017-03-24 02:30:11 +01:00
Rémi Verschelde 15c4d5006e Fix build issue with MSVC
windows.h is a mess.
2017-03-06 09:11:03 +01:00
Rémi Verschelde 5dbf1809c6 A Whole New World (clang-format edition)
I can show you the code
Pretty, with proper whitespace
Tell me, coder, now when did
You last write readable code?

I can open your eyes
Make you see your bad indent
Force you to respect the style
The core devs agreed upon

A whole new world
A new fantastic code format
A de facto standard
With some sugar
Enforced with clang-format

A whole new world
A dazzling style we all dreamed of
And when we read it through
It's crystal clear
That now we're in a whole new world of code
2017-03-05 16:44:50 +01:00
Rémi Verschelde e1c1d7d1d7 Add a bunch of missing Godot headers in own files 2017-03-05 15:47:28 +01:00
Juan Linietsky de0045cf1b -renamed globals.h to global_config.cpp (this seems to have caused a few modified files)
-.pck and .zip exporting redone, seems to be working..
2017-02-21 00:06:30 -03:00
Rémi Verschelde 70b9aa379d Merge pull request #7581 from Faless/v6_wild_bind
TCP/UDP listen bind to address and bugfixes
2017-02-12 23:31:40 +01:00
Hein-Pieter van Braam cff6840ff7 Add a simple signal handler for SIGCHLD on Unix
This fixes #6631
2017-02-09 22:08:35 +01:00
Juan Linietsky 6f2e16306a Several bugfixes, improving the import workflow 2017-02-06 00:38:39 -03:00
Fabio Alessandrelli 5dc7c920bf 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)
2017-01-23 20:18:23 +01:00
Fabio Alessandrelli 9336857132 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.
2017-01-23 20:18:23 +01:00
Fabio Alessandrelli 68dc969f8c 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
2017-01-23 20:18:23 +01:00
Fabio Alessandrelli fa0cb7da0e 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.
2017-01-23 20:18:23 +01:00
Fabio Alessandrelli 619e7a2c8b Bind to IPv4 on OpenBSD when using wildcard
OpenBSD does not support binding on both IPv4 and IPv6 using the same socket
2017-01-23 20:18:23 +01:00
Fabio Alessandrelli 88a56ba783 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)
2017-01-23 20:18:22 +01:00
Fabio Alessandrelli 2fe4ef6699 Implement UDP listen bind address 2017-01-23 20:18:18 +01:00
Fabio Alessandrelli b2839343ca Implement TCP Server bind address 2017-01-23 20:15:20 +01:00
Fabio Alessandrelli 98a7e2b4e0 Convert validity checks of IP_Address to is_valid method. 2017-01-23 20:15:20 +01:00
Fabio Alessandrelli e4b9b37ccf Avoid calling close when polling a UDP peer without socket 2017-01-23 20:15:20 +01:00
Rémi Verschelde a992d3f74f Merge pull request #7510 from Faless/tcp_connect
TCP connect always opens the correct socket type
2017-01-15 00:26:46 +01:00
Rémi Verschelde 479790a841 StreamPeerWinsock: Fix changed declarations
Bug introduced in dcb95ec147.
2017-01-14 16:23:01 +01:00
Juan Linietsky dcb95ec147 removed duplicated functions in class hierarchy that were bound more than once
added a check to detect this case in the future
2017-01-14 11:10:42 -03:00
Rémi Verschelde 93ab45b6b5 Style: Fix whole-line commented code
They do not play well with clang-format which aligns the `//` part
with the rest of the code block, thus producing badly indented commented code.
2017-01-14 14:52:23 +01:00
Juan Linietsky da4170540c Fixed dir access return value, changed it to Error like all other funcs 2017-01-14 09:17:15 -03:00
Juan Linietsky 6c512b88c2 UDP.set_send_address to UDP.set_dest_address 2017-01-14 00:54:21 -03:00
Fabio Alessandrelli 55b4f3686d TCP connect always opens correct socket type
TCP client connections does not need to rely on ipv6 dual stack sockets
2017-01-13 19:02:39 +01:00
Fabio Alessandrelli 65483d57bf Improvements to scons defined WINVER/_WIN32_WINNT 2017-01-12 17:13:19 +01:00
Rémi Verschelde b24fe6879a 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.
2017-01-09 12:10:25 +01:00
Rémi Verschelde 6323779596 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.
2017-01-08 20:41:26 +01:00
Juan Linietsky d9ca9d778d Use more compatible initializarion of RWLockPosix 2017-01-08 11:35:32 -03:00
Juan Linietsky 2ab83e1abb Memory pool vectors (DVector) have been enormously simplified in code, and renamed to PoolVector 2017-01-07 18:26:38 -03:00
Juan Linietsky 53ce643e52 -Changed memory functions, Memory::alloc_static*, simplified them, made them aligned to 16
-Changed Vector<> template to fit this.
2017-01-06 10:15:44 -03:00
Juan Linietsky 0f7af4ea51 -Changed most project settings in the engine, so they have major and minor categories.
-Changed SectionedPropertyEditor to support this
-Renamed Globals singleton to GlobalConfig, makes more sense.
-Changed the logic behind persisten global settings, instead of the persist checkbox, a revert button is now available
2017-01-05 09:16:00 -03:00
Juan Linietsky 118eed485e ObjectTypeDB was renamed to ClassDB. Types are meant to be more generic to Variant.
All usages of "type" to refer to classes were renamed to "class"
ClassDB has been exposed to GDScript.
OBJ_TYPE() macro is now GDCLASS()
2017-01-02 23:03:46 -03:00
Rémi Verschelde 3f3f5a5359 Merge remote-tracking branch 'origin/gles3' into gles3-on-master
Various merge conflicts have been fixed manually and some mistakes
might have been made - time will tell :)
2017-01-02 21:52:26 +01:00
Rémi Verschelde 0b2771bd65 Merge pull request #7271 from Faless/ipv6_cleanup
Fixes and improvementes for IPv6 implementation.
2017-01-02 15:51:45 +01:00
Rémi Verschelde c7bc44d5ad 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!
2017-01-01 22:03:33 +01:00
Fabio Alessandrelli de23ce11b5 Remove old unused AI_V4MAPPED flag to getaddrinfo 2016-12-09 23:38:14 +01:00
Fabio Alessandrelli 1aff508dd9 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)
2016-12-09 18:24:59 +01:00
Fabio Alessandrelli c18c5013f8 Migrate int.IP_TYPE_ constants to IP.TYPE_ 2016-12-09 18:24:59 +01:00
Fabio Alessandrelli 4d90a4fcd5 Move V6ONLY flag selection inside helpers 2016-12-09 18:24:59 +01:00
Fabio Alessandrelli 9200da58e4 Automatically map IPv4 address to IPv6 when needed 2016-12-09 18:24:59 +01:00
Fabio Alessandrelli 95bdd97768 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.
2016-12-09 18:24:59 +01:00
Fabio Alessandrelli 311f1f165b Fix getaddrinfo failing on android 2016-12-09 18:24:58 +01:00
Fabio Alessandrelli 4f07b595a1 Properly handle tcp connection failure 2016-12-09 18:24:58 +01:00
Fabio Alessandrelli cdc1ca0f13 Fix _set_ip_addr_port not setting the address. 2016-12-09 18:24:58 +01:00
eska a6ae3204fb 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-11-30 22:01:55 +01:00
George Marques b113c7b7a3
Rename WINRT_ENABLED to UWP_ENABLED 2016-11-03 14:51:08 -02:00
George Marques 3958171a7a Merge pull request #7006 from vnen/fix-ipv6-uwp
Fix IPv6 linking for UWP
2016-11-01 12:39:45 -02:00
George Marques 4160b3c9fe
Fix IPv6 linking for UWP 2016-10-31 21:39:45 -02:00
Rémi Verschelde d4c17700aa style: Fix PEP8 whitespace issues in Python files
Done with `autopep8 --select=E2,W2`, fixes:

- E201 - Remove extraneous whitespace.
- E202 - Remove extraneous whitespace.
- E203 - Remove extraneous whitespace.
- E211 - Remove extraneous whitespace.
- E221 - Fix extraneous whitespace around keywords.
- E222 - Fix extraneous whitespace around keywords.
- E223 - Fix extraneous whitespace around keywords.
- E224 - Remove extraneous whitespace around operator.
- E225 - Fix missing whitespace around operator.
- E226 - Fix missing whitespace around operator.
- E227 - Fix missing whitespace around operator.
- E228 - Fix missing whitespace around operator.
- E231 - Add missing whitespace.
- E231 - Fix various deprecated code (via lib2to3).
- E241 - Fix extraneous whitespace around keywords.
- E242 - Remove extraneous whitespace around operator.
- E251 - Remove whitespace around parameter '=' sign.
- E261 - Fix spacing after comment hash.
- E262 - Fix spacing after comment hash.
- E265 - Format block comments.
- E271 - Fix extraneous whitespace around keywords.
- E272 - Fix extraneous whitespace around keywords.
- E273 - Fix extraneous whitespace around keywords.
- E274 - Fix extraneous whitespace around keywords.
- W291 - Remove trailing whitespace.
- W293 - Remove trailing whitespace.
2016-11-01 00:35:16 +01:00
Fabio Alessandrelli bdc7ca84ca Define IPV6_V6ONLY flag if not defined on windows (old mingw versions) 2016-10-30 22:58:15 +01:00
Fabio Alessandrelli eb27e993f0 TCP/UDP Listen sockets can now be set to IPv6 only 2016-10-30 17:46:05 +01:00
Fabio Alessandrelli 812908e236 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).
2016-10-30 17:46:05 +01:00
Fabio Alessandrelli ee69bd81cf TCPServer listen now default to IP type ANY (v6 socket with v4 support) 2016-10-30 17:46:05 +01:00
Fabio Alessandrelli 25e29972a9 Fix PacketPeerUDP get_packet_port()
Properly convert port field from network to system ordering on incoming packets.
2016-10-26 18:27:01 +02:00
Rémi Verschelde c67e3a485d Merge pull request #6925 from godotengine/ipv6
Adding IPv6 support
2016-10-26 14:32:51 +02:00
Fabio Alessandrelli 80e911647c 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
2016-10-26 08:20:31 +02:00
Ariel Manzur 672225b710 added windows support for ipv6, cleaned up unix code 2016-10-20 07:04:10 -03:00
Ariel Manzur 1d45f35a4a fixed some byte order and parsing problems 2016-10-19 18:32:36 -03:00
Ariel Manzur 887a897c02 adding ipv6 2016-10-18 18:53:18 -03:00
Rémi Verschelde fc8ccd5b8c SCsub: Add python shebang as a hint for syntax highlighting
Also switch existing shebangs to "better" /usr/bin/env python.
2016-10-17 20:10:46 +02:00
Rémi Verschelde 248bc9159c drivers: Refactor SCsub and drop redundant env_drivers clone
The reordering of the SConscript includes allows to ensure that
stuff like the builtin zlib headers will be available for libpng.

Also moved glew back into global env, otherwise windows seems
not to find it... Kind of shooting in the dark with this multi-env
setup.
2016-10-15 18:10:18 +02:00
Juan Linietsky 1527cf8c0d 2D Shaders are working again using the new syntax, though all is buggy in general 2016-10-10 18:31:01 -03:00
Juan Linietsky fc61eb37ce Merge pull request #5920 from 29jm/fix-warnings
Fix some more warnings
2016-09-10 12:21:02 -03:00
George Marques c9b82498b4
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.
2016-09-03 19:36:44 -03:00
Johan Manuel 046f94d3ac Remove some unused variables 2016-08-13 13:21:35 +02:00
Rémi Verschelde 22419082d9 Remove some noisy debug prints
Part of #5031
2016-07-17 18:25:21 +02:00
Juan Linietsky f9bd038ca7 Removed no longer needed check 2016-07-02 13:32:07 -03:00
Juan Linietsky ffbc2e56c9 Fix some bugs in diraccess, closes #5288 2016-06-30 18:23:39 -03:00
Juan Linietsky 8dac3bf3b1 Added function to notify ScriptLanguage when a thread is created/freed, allows scripts to allocate a stack there via TLS 2016-06-25 10:41:23 -03:00
Daniel J. Ramirez 422fac5066 Removed lots of prints 2016-06-18 18:01:06 -05:00
Juan Linietsky e3905a084e -made get_space_left() return values more homogenous, also for script, converted to mb, closes #4617 2016-06-18 11:32:45 -03:00
Juan Linietsky 61655d6dc2 Fixed make_dir and make_dir_recursive erros, closes #1680 closes #1872 2016-06-18 11:13:03 -03:00
Rémi Verschelde a7fc04626a Add missing license headers in our source files (#5255)
Also removes a couple wrong Godot headers from third-party source files.
2016-06-18 14:46:12 +02:00
Juan Linietsky 7f02627290 -Add visible IO errors when closing a file fails due to it being locked (most likely on windows), closes #4760 2016-06-13 10:10:50 -03:00