Age | Commit message (Collapse) | Author |
|
Using clang-tidy's `readability-braces-around-statements`.
https://clang.llvm.org/extra/clang-tidy/checks/readability-braces-around-statements.html
|
|
I couldn't find a tool that enforces it, so I went the manual route:
```
find -name "thirdparty" -prune \
-o -name "*.cpp" -o -name "*.h" -o -name "*.m" -o -name "*.mm" \
-o -name "*.glsl" > files
perl -0777 -pi -e 's/\n}\n([^#])/\n}\n\n\1/g' $(cat files)
misc/scripts/fix_style.sh -c
```
This adds a newline after all `}` on the first column, unless they
are followed by `#` (typically `#endif`). This leads to having lots
of places with two lines between function/class definitions, but
clang-format then fixes it as we enforce max one line of separation.
This doesn't fix potential occurrences of function definitions which
are indented (e.g. for a helper class defined in a .cpp), but it's
better than nothing. Also can't be made to run easily on CI/hooks so
we'll have to be careful with new code.
Part of #33027.
|
|
Which means that reduz' beloved style which we all became used to
will now be changed automatically to remove the first empty line.
This makes us lean closer to 1TBS (the one true brace style) instead
of hybridating it with some Allman-inspired spacing.
There's still the case of braces around single-statement blocks that
needs to be addressed (but clang-format can't help with that, but
clang-tidy may if we agree about it).
Part of #33027.
|
|
Using clang-tidy's `modernize-use-bool-literals`.
https://clang.llvm.org/extra/clang-tidy/checks/modernize-use-bool-literals.html
|
|
Part of #33027.
|
|
Also added an easier way to load native GLSL shaders.
Extras:
Had to fix no-cache for subresources in resource loader, it was not properly working, making shaders not properly reload.
Note:
The precommit hooks are broken because they don't seem to support enums from one class being used in another.
Feel free to fix this after merging this PR.
|
|
|
|
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.
|
|
This addresses the issue godotengine/godot#37143
|
|
|
|
Typed `PoolTypeArray` types are now renamed `PackedTypeArray` and are
sugar for `Vector<Type>`.
|
|
-Texture renamed to Texture2D
-TextureLayered as base now inherits 2Darray, cubemap and cubemap array
-Removed all references to flags in textures (they will go in the shader)
-Texture3D gone for now (will come back later done properly)
-Create base rasterizer for RenderDevice, RasterizerRD
|
|
Happy new year to the wonderful Godot community!
We're starting a new decade with a well-established, non-profit, free
and open source game engine, and tons of further improvements in the
pipeline from hundreds of contributors.
Godot will keep getting better, and we're looking forward to all the
games that the community will keep developing and releasing with it.
|
|
|
|
For clarity, assign-to-release idiom for PoolVector::Read/Write
replaced with a function call.
Existing uses replaced (or removed if already handled by scope)
|
|
ResourceFormatLoader and ResourceFormatSaver are meant to be overridden
to add support for different formats in ResourceLoader and ResourceSaver.
Those should be exposed as they can be overridden in plugins.
On the other hand, all predefined subclasses of those two base classes
are only meant to register support for new file and resource types, but
should not and cannot be used directly from script, so they should not
be exposed.
Also unexposed ResourceImporterOGGVorbis (and thus its base class
ResourceImporter) which are editor-only.
|
|
Fix pvrtc encoder
|
|
Always resize image to square of power2
Enable mipmaps only if original texture has it enabled
Fix #28534, #28541
|
|
Include paths are processed from left to right, so we use Prepend to
ensure that paths to bundled thirdparty files will have precedence over
system paths (e.g. `/usr/include` should have lowest priority).
|
|
I decided to modify code in a defensive way. Ideally functions
like size() or length() should return an unsigned type.
|
|
Use constructor via placement new and swap colors directly.
|
|
Happy new year to the wonderful Godot community!
|
|
|
|
Also remove unnecessary `Export('env')` in other SCsubs,
Export should only be used when exporting *new* objects.
|
|
This allows more consistency in the manner we include core headers,
where previously there would be a mix of absolute, relative and
include path-dependent includes.
|
|
|
|
|
|
This allows to disable modules based on the environment,
in particular `env[tools]` which tells us if we are
building the editor or not.
|
|
Fixes most current reports on Coverity Scan of uninitialized scalar
variable (CWE-457): https://cwe.mitre.org/data/definitions/457.html
These happen most of the time (in our code) when instanciating structs
without a constructor (or with an incomplete one), and later returning
the instance. This is sometimes intended though, as some parameters are
only used in some situations and should not be double-initialized for
performance reasons (e.g. `constant` in ShaderLanguage::Token).
|
|
Using `misc/scripts/fix_headers.py` on all Godot files.
Some missing header guards were added, and the header inclusion order
was fixed in the Bullet module.
|
|
Happy new year to the wonderful Godot community!
|
|
|
|
|
|
Rename user facing methods and variables as well as the corresponding
C++ methods according to the folloming changes:
* pos -> position
* rot -> rotation
* loc -> location
C++ variables are left as is.
|
|
The forth in my quest to make Godot 3.x compile with -Werror on GCC7
|
|
|
|
|
|
|
|
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
|
|
|
|
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.
|
|
String.get_basename()
|
|
renamed to PoolVector
|
|
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()
|
|
Various merge conflicts have been fixed manually and some mistakes
might have been made - time will tell :)
|
|
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!
|
|
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.
|
|
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.
|
|
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.
|
|
Also switch existing shebangs to "better" /usr/bin/env python.
|