Commit Graph

5942 Commits

Author SHA1 Message Date
Pedro J. Estébanez 48da11372e Fix random crashes when using yield() 2017-03-21 02:54:46 +01:00
Rémi Verschelde 9c75b9dddf Merge pull request #8091 from RandomShaper/fix-particles-2d-2.1
Fix Particles2D process mode back-compat issue (2.1)
2017-03-20 19:49:58 +01:00
Pedro J. Estébanez 98ba3db502 Fix Particles2D process mode back-compat issue 2017-03-20 19:47:25 +01:00
Rémi Verschelde ea987256f6 Revert "Fix drag and drop on 2d viewport"
This reverts commits a9d8da91b7
and 4230b22558.
2017-03-20 16:57:29 +01:00
Rémi Verschelde 51c5a12f43 Travis: Run clang-format static check
Commits or PRs that do not respect the clang-format style that we
enforce will fail the test.

Adding ubuntu-toolchain-r-test as its libstdc++ is necessary to install
libllvm-3.9.

(cherry picked from commit 6aee289b3e)
2017-03-19 16:14:53 +01:00
Rémi Verschelde 3251e93cee Fix linking order for builtin freetype
Before this change the libfreetype_builtin.a lib would be appended
at the very end of the linking flags, after system libs such as -lX11
or -lkernel32.

(cherry picked from commit 26c6c2b01a)
2017-03-19 16:14:47 +01:00
Rémi Verschelde 4230b22558 Fix cherry-pick mistake using 3.0 method
Bug introduced in a9d8da91b7.
2017-03-19 10:01:53 +01:00
Rémi Verschelde f4f0a6c609 Merge pull request #8073 from Hinsbart/bind_parse_ev
Input: bind parse_input_event() [2.1]
2017-03-19 10:00:00 +01:00
Andreas Haas 2f1a0448a7
Input: bind parse_input_event()
When using get_tree().input_event(ev), the engine will JUST send the event down the SceneTree.
However, you won't get any of the benefits of the Input singleton:
- No InputMap actions will be emitted
- The internal input state won't be modified, so methods like `Input.get_mouse_pos()` or `Input.is_joy_button_pressed` won't return the expected output after sending the event.

This is fixed by using `Input.parse_input_event(ev)` instead.
I guess we'll also have to update the docs to reflect that this is the preferred method of sending custom InputEvents.
2017-03-19 08:33:07 +01: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
Andreas Haas 3c16e7842f Editor: Fix "About" dialog
Use a HBoxContainer instead of hardcoded positions.

(cherry picked from commit 7ec697695f)
2017-03-19 00:44:05 +01:00
mbalint12 82ad45024f Fixed typo in gdscript autocompletion.
There was a missing '!' sign, but autocompletion shows parent script members too.

(cherry picked from commit edaf77abd6)
2017-03-19 00:43:07 +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
CrazyGuy108 10119f7b04 List Control::has_point as a virtual method
According to Issue #8018, a BIND_VMETHOD macro wasn't present in scene/gui/control.cpp, while it was declared to be a virtual method in scene/gui/control.h.

classes.xml was updated to also list this method in Control.

(cherry picked from commit 9589936d6e)
2017-03-19 00:42:34 +01:00
volzhs a9d8da91b7 Fix drag and drop on 2d viewport
(cherry picked from commit 4d0a75750f)
2017-03-19 00:40:54 +01:00
AlexHolly cf7ba8e390 fix remove_and_skip()
(cherry picked from commit 3f78f1f17d)
2017-03-19 00:38:36 +01:00
Ignacio Etcheverry 94653f0e88 Fix connection errors when replacing node
- Avoid connecting the signals to nonexistent methods
- Preserve only persistent connections

(cherry picked from commit d210ac66ef)
2017-03-19 00:38:30 +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 1d418afe86 Prevent cyclical dependency issue after clang-format includes reorder 2017-03-19 00:33:35 +01:00
Rémi Verschelde d4e0be7632 Add missing map.h include in color defs
(cherry picked from commit 5e13a762ec)
2017-03-19 00:32:58 +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 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 9d2c0f6c6e clang-format: Add pre-commit hook
Derived from https://github.com/githubbrowser/Pre-commit-hooks
and https://gitlab.cern.ch/GeantV/geant/blob/master/hooks/pre-commit-clang-format

(cherry picked from commit 0e4ee5935a)
2017-03-18 23:29:45 +01:00
Rémi Verschelde 19f90b59d5 Style: Add .clang-format based on LLVM style
Adapted some parameters to fit the de facto Godot style as closely as possible
(tab indentation, long lines with no wrapping - for now -, indented case labels,
left-aligned pointer operators).

(cherry picked from commit 503c98ead4)
2017-03-18 23:29:45 +01:00
Rémi Verschelde 6e5246e312 Reorder the folders in tools to prepare moving tools/editor
- `certs` and `editor_fonts` go to `thirdparty`
- `dist` and `scripts` go to a new `misc` folder
- `collada` and `doc` go to `tools/editor`

The next step will be to rename `tools/editor` to `editor` directly,
but this will be done at the right time to avoid breaking too many PRs.

(cherry picked from commit b87a232668)
2017-03-18 23:29:43 +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 75bf6a9978 Style: Keep long lines for now
clang-format does not play well with tab-aligned multiline statements...
Some more research will be needed if we want to set a column limit.

(cherry picked from commit e2a3f06f3d)
2017-03-18 21:06:07 +01:00
Rémi Verschelde 4bfecab813 Style: No break before list brace
clang-format does not handle that well *at all*.

For the reference, found the relevant pieces of code with:
`ag "=[ "$'\t'"]?"$'\n'"[ "$'\t'"]?{" --ignore=thirdparty`

(cherry picked from commit 40323407df)
2017-03-18 21:05:58 +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
volzhs 5ac097a035 Fix wrong TreeItem reference after reconstructing
(cherry picked from commit 66b7586fb0)
2017-03-18 20:21:05 +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
volzhs db6d9cdc22 Fix crash when click icon while editing node name
(cherry picked from commit 3ae0ffa182)
2017-03-18 20:17:13 +01:00
Andreas Haas 96e0fd5570 Tween: Fix undefined behavior found by static code analyzer.
Adresses the issue mentioned in https://software.intel.com/en-us/articles/the-ultimate-question-of-programming-refactoring-and-everything

(cherry picked from commit 0157969ccc)
2017-03-18 20:16:40 +01:00
Bojidar Marinov ecb4d41d20 Add Rect2 TileMap::get_used_rect(), closes #4390
(cherry picked from commit 136e1e18ba)
2017-03-18 20:16:14 +01:00
Andreas Haas 7bf7fe854f Don't switch to script on breakpoint hit when using external editor.
Fixes #7705

(cherry picked from commit 10fa752ae7)
2017-03-18 20:13:59 +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
Vincent 02d711eb61 RichTextLabel add function remove_line
(cherry picked from commit c20b186e73)
2017-03-18 20:11:42 +01:00
Hein-Pieter van Braam 4cf49bb6f4 Allow preload to accept a const string.
In preload() parsing this code will lookup the identifier in the local
constant database. If the identifier corresponds to a string constant
it is used as the path for preload().

Currently this does not work for global constants, only constants
declared in the same class as the preload is happening. We can implement
a full fix too. Maybe we can use this PR to discuss the possibilities.

This (partially) fixes #6798

(cherry picked from commit 3e5743ca36)
2017-03-18 20:10:36 +01:00
Andreas Haas 674a090e59 Spinbox: don't ignore double clicks.
Fixes the problem with spinboxes not updating when clicking too fast.

(cherry picked from commit dd4c2709e4)
2017-03-18 20:09:55 +01:00
Hein-Pieter van Braam 38e86c8c24 Remove bounds check when resuming from yield.
The code would get a pointer to the beginning of the call_args by using
operator[] at the stack Vector. This does bound checking. When there are
no call_args this bound check fails and the error mentioned in #7796
gets triggered.

This bound check is actually not necessary as call_args just gets set to
NULL and never dereferenced. This new code will just unconditionally set
the pointer to the place where the call_args are if there are any. There
is no NULL check for call_args anywhere so this is safe.

Fixes #7796

(cherry picked from commit e8611966de)
2017-03-18 20:09:45 +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
Andreas Haas 12a1b517ca ProjectSettings: InputMap dialog fixes
Now the selection jumps to the correct action after a new event has been added.
Also sets the default device id for Joypad button events to 0.

(cherry picked from commit 92ac7067e6)
2017-03-18 20:08:25 +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
Andreas Haas fb2173174d Particles2D: implement texture flip parameters.
(cherry picked from commit 6a2dccaf77)
2017-03-18 20:06:11 +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