Commit graph

25 commits

Author SHA1 Message Date
Rémi Verschelde cd4e46ee65 SCons: Format buildsystem files with psf/black
Configured for a max line length of 120 characters.

psf/black is very opinionated and purposely doesn't leave much room for
configuration. The output is mostly OK so that should be fine for us,
but some things worth noting:

- Manually wrapped strings will be reflowed, so by using a line length
  of 120 for the sake of preserving readability for our long command
  calls, it also means that some manually wrapped strings are back on
  the same line and should be manually merged again.

- Code generators using string concatenation extensively look awful,
  since black puts each operand on a single line. We need to refactor
  these generators to use more pythonic string formatting, for which
  many options are available (`%`, `format` or f-strings).

- CI checks and a pre-commit hook will be added to ensure that future
  buildsystem changes are well-formatted.
2020-03-30 09:05:53 +02:00
Juan Linietsky 69c95f4b4c Reworked signal connection system, added support for Callable and Signal objects and made them default. 2020-02-20 08:24:50 +01:00
Juan Linietsky 9b0dd4f571 A lot of progress with canvas rendering, still far from working. 2020-02-11 11:53:27 +01:00
qarmin aab8da25ad Fix some code found by Coverity Scan and PVS Studio 2019-07-23 09:14:31 +02:00
Andrettin e2a3ed3cd8 Added support for passing functions pointers (with a class instance as the first parameter) to method bindings 2019-07-09 21:18:39 +02:00
Ignacio Etcheverry 3380565e4b C#: Generate the correct integer and floating point types 2019-04-27 01:30:46 +02:00
dragmz 8fd337e2df fix windows build using python 3.7
fixes NameError (missing "subprocess_main" and "basestring")
2018-07-28 18:13:48 +02:00
Viktor Ferenczi c5bd0c37ce Running builder (content generator) functions in subprocesses on Windows
- Refactored all builder (make_*) functions into separate Python modules along to the build tree
- Introduced utility function to wrap all invocations on Windows, but does not change it elsewhere
- Introduced stub to use the builders module as a stand alone script and invoke a selected function

There is a problem with file handles related to writing generated content (*.gen.h and *.gen.cpp)
on Windows, which randomly causes a SHARING VIOLATION error to the compiler resulting in flaky
builds. Running all such content generators in a new subprocess instead of directly inside the
build script works around the issue.

Yes, I tried the multiprocessing module. It did not work due to conflict with SCons on cPickle.
Suggested workaround did not fully work either.

Using the run_in_subprocess wrapper on osx and x11 platforms as well for consistency. In case of
running a cross-compilation on Windows they would still be used, but likely it will not happen
in practice. What counts is that the build itself is running on which platform, not the target
platform.

Some generated files are written directly in an SConstruct or SCsub file, before the parallel build starts. They don't need to be written in a subprocess, apparently, so I left them as is.
2018-07-27 21:37:55 +02:00
Viktor Ferenczi 272ecddb28 Properly closing all files in Python code 2018-03-11 14:55:50 +01:00
Marc Gilleron e415fd05bb Added all missing VisualServer bindings
- Added bindings for multimesh, immediate, skeleton, light, reflection probe, gi probe, lightmap, particles, camera, environment, scenario, instance
- Removed draw and sync, were duplicates of force_* equivalents
- Bumped binders max arguments from 11 to 13
- Wrote some wrappers as not all methods were variant-friendly
2018-01-20 16:59:26 +01:00
Leon Krause cf3919b228 Bind some VisualServer functions 2017-10-20 00:24:49 +02:00
Hein-Pieter van Braam cacced7e50 Convert Object::cast_to() to the static version
Currently we rely on some undefined behavior when Object->cast_to() gets
called with a Null pointer. This used to work fine with GCC < 6 but
newer versions of GCC remove all codepaths in which the this pointer is
Null. However, the non-static cast_to() was supposed to be null safe.

This patch makes cast_to() Null safe and removes the now redundant Null
checks where they existed.

It is explained in this article: https://www.viva64.com/en/b/0226/
2017-08-24 23:08:24 +02:00
Juan Linietsky 05a6785344 GCC fixes 2017-08-24 00:50:16 -03:00
Juan Linietsky 3d1c031871 Changed MethodBind API to request information from methods. It's much claner now.
Also changed PropertyInfo to include informatino about class names.
2017-08-23 19:11:11 -03:00
Ignacio Etcheverry 46fdf16399 Improves method bind detection of signature types 2017-08-10 07:17:44 +02: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 817dd7ccbb style: Fix PEP8 blank lines issues in Python files
Done with `autopep8 --select=E3,W3`, fixes:

- E301 - Add missing blank line.
- E302 - Add missing 2 blank lines.
- E303 - Remove extra blank lines.
- E304 - Remove blank line following function decorator.
- E309 - Add missing blank line.
- W391 - Remove trailing blank lines.
2016-11-01 00:35:16 +01: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
Rémi Verschelde 97c8508f5e style: Start applying PEP8 to Python files, indentation issues
Done with `autopep8 --select=E1`, fixes:

- E101 - Reindent all lines.
- E112 - Fix under-indented comments.
- E113 - Fix over-indented comments.
- E115 - Fix under-indented comments.
- E116 - Fix over-indented comments.
- E121 - Fix a badly indented line.
- E122 - Fix a badly indented line.
- E123 - Fix a badly indented line.
- E124 - Fix a badly indented line.
- E125 - Fix indentation undistinguish from the next logical line.
- E126 - Fix a badly indented line.
- E127 - Fix a badly indented line.
- E128 - Fix a badly indented line.
- E129 - Fix a badly indented line.
2016-11-01 00:33:51 +01:00
Juan Linietsky ad313097eb WIP visual scripting, not working yet but you can check out stuff 2016-08-02 19:11:05 -03:00
Rémi Verschelde 0f54ab93bc Fix typo to PTRCALL_ENABLED from previous commit
And boo @reduz, those trailing spaces :p
2016-06-23 07:54:30 +02:00
Juan Linietsky d6225b1e00 Improved binding system (ObjectTypeDB::bind_method) to be friendlier to statically typed languages, should help in the Mono integration.
Disabled by default.
2016-06-22 23:13:41 -03:00
Rémi Verschelde 0a5472e697 Remove trailing spaces 2016-04-02 20:26:12 +02:00
Juan Linietsky fa004d5c0f Small Fixes
-----------

-Added Ability for centering on top left for centercontainer
-Added ability to bind more than 5 parameters (must include an extra file)
2014-09-17 11:53:29 -03:00
Juan Linietsky 0b806ee0fc GODOT IS OPEN SOURCE 2014-02-09 22:10:30 -03:00