summaryrefslogtreecommitdiffstats
path: root/scene/resources/bit_map.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Avoid expensive sqrt operation in hot loop of BitMap.grow_maskLuiz Fernando Silva2024-09-121-2/+3
|
* Fix potential integer underflow in rounded up divisionsEddieBreeg2024-01-021-1/+1
| | | | | | | | | | A new `Math::division_round_up()` function was added, allowing for easy and correct computation of integer divisions when the result needs to be rounded up. Fixes #80358. Co-authored-by: Rémi Verschelde <rverschelde@gmail.com>
* Fix size error in `BitMap.opaque_to_polygons`Ninni Pipping2023-04-281-1/+1
| | | | Previous estimate of upper limit on size was incorrect
* One Copyright Update to rule them allRémi Verschelde2023-01-051-29/+29
| | | | | | | | | | | | | | | | | | | | As many open source projects have started doing it, we're removing the current year from the copyright notice, so that we don't need to bump it every year. It seems like only the first year of publication is technically relevant for copyright notices, and even that seems to be something that many companies stopped listing altogether (in a version controlled codebase, the commits are a much better source of date of publication than a hardcoded copyright statement). We also now list Godot Engine contributors first as we're collectively the current maintainers of the project, and we clarify that the "exclusive" copyright of the co-founders covers the timespan before opensourcing (their further contributions are included as part of Godot Engine contributors). Also fixed "cf." Frenchism - it's meant as "refer to / see".
* Fix typos with codespellRémi Verschelde2022-12-151-1/+1
|
* BitMap polygon code cleanupNinni Pipping2022-11-221-78/+23
|
* Fix polygon generation in BitMapNinni Pipping2022-11-171-39/+123
|
* Make some Image methods statickobewi2022-10-141-3/+1
|
* Refactor BitMap and add testsHendrik Brucker2022-09-011-65/+85
| | | | Co-authored-by: Resul Çelik <resul_celik@hotmail.com>
* Replace Array return types with TypedArraykobewi2022-08-221-2/+3
|
* Add tests for empty/unnamed arguments to ClassDB, Variant, GDScriptYuri Sizov2022-08-081-1/+1
|
* Add a new HashSet templatereduz2022-05-201-2/+2
| | | | | * Intended to replace RBSet in most cases. * Optimized for iteration speed
* Replace most uses of Map by HashMapreduz2022-05-161-2/+2
| | | | | | | | | | | | * Map is unnecessary and inefficient in almost every case. * Replaced by the new HashMap. * Renamed Map to RBMap and Set to RBSet for cases that still make sense (order matters) but use is discouraged. There were very few cases where replacing by HashMap was undesired because keeping the key order was intended. I tried to keep those (as RBMap) as much as possible, but might have missed some. Review appreciated!
* Merge pull request #55841 from OverloadedOrama/expose-bitmap-methodsRémi Verschelde2022-01-251-0/+2
|\
| * Expose BitMap's `convert_to_image` and `resize` methods to GDScriptManolis Papadeas2021-12-121-0/+2
| |
* | Update copyright statements to 2022Rémi Verschelde2022-01-031-2/+2
|/ | | | Happy new year to the wonderful Godot community!
* Rename `PROPERTY_USAGE_NOEDITOR` to `PROPERTY_USAGE_NO_EDITOR`Hugo Locurcio2021-11-031-1/+1
| | | | | This is consistent with other constants that include `NO`, such as `PROPERTY_HINT_COLOR_NO_ALPHA`.
* Construct values only when necessary.Anilforextra2021-09-231-1/+1
|
* Rename `instance()`->`instantiate()` when it's a verbLightning_A2021-06-191-4/+4
|
* BitMask::create Don't request more memory than needed when size is a ↵kleonc2021-05-081-1/+1
| | | | multiply of 8
* Core: Drop custom `copymem`/`zeromem` definesRémi Verschelde2021-04-271-1/+1
| | | | | | | | We've been using standard C library functions `memcpy`/`memset` for these since 2016 with 67f65f66391327b2967a20a89c3627e1dd6e84eb. There was still the possibility for third-party platform ports to override the definitions with a custom header, but this doesn't seem useful anymore.
* Fixes small typos and grammar correctionAnshul7sp12021-03-121-1/+1
|
* Initialize class variables with default values in scene/ [2/2]Rafał Mikrut2021-02-091-7/+4
|
* Update copyright statements to 2021Rémi Verschelde2021-01-011-2/+2
| | | | | | | | | | | | | | Happy new year to the wonderful Godot community! 2020 has been a tough year for most of us personally, but a good year for Godot development nonetheless with a huge amount of work done towards Godot 4.0 and great improvements backported to the long-lived 3.2 branch. We've had close to 400 contributors to engine code this year, authoring near 7,000 commit! (And that's only for the `master` branch and for the engine code, there's a lot more when counting docs, demos and other first-party repos.) Here's to a great year 2021 for all Godot users 🎆
* Rename empty() to is_empty()Marcel Admiraal2020-12-281-1/+1
|
* Rename Rect2 and Rect2i clip() to intersection()Marcel Admiraal2020-12-191-3/+3
|
* Style: Enforce braces around if blocks and loopsRémi Verschelde2020-05-141-16/+27
| | | | | Using clang-tidy's `readability-braces-around-statements`. https://clang.llvm.org/extra/clang-tidy/checks/readability-braces-around-statements.html
* Style: Enforce separation line between function definitionsRémi Verschelde2020-05-141-0/+1
| | | | | | | | | | | | | | | | | | | | | | | 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.
* Style: clang-format: Disable KeepEmptyLinesAtTheStartOfBlocksRémi Verschelde2020-05-141-29/+0
| | | | | | | | | | | | | | 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.
* Style: Set clang-format Standard to Cpp11Rémi Verschelde2020-03-171-3/+3
| | | | | | | | | | For us, it practically only changes the fact that `A<A<int>>` is now used instead of the C++03 compatible `A<A<int> >`. Note: clang-format 10+ changed the `Standard` arguments to fully specified `c++11`, `c++14`, etc. versions, but we can't use `c++17` now if we want to preserve compatibility with clang-format 8 and 9. `Cpp11` is still supported as deprecated alias for `Latest`.
* PoolVector is gone, replaced by VectorJuan Linietsky2020-02-181-7/+5
| | | | | Typed `PoolTypeArray` types are now renamed `PackedTypeArray` and are sugar for `Vector<Type>`.
* Update copyright statements to 2020Rémi Verschelde2020-01-011-2/+2
| | | | | | | | | | | 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.
* Small fixes to redundand code, copy paste bugsqarmin2019-10-141-1/+1
|
* Sprite to polygon conversion improvementsPouleyKetchoupp2019-10-071-17/+39
| | | | | | | | | | - No reduced Rect in march square algorithm, it was causing inconsistent cases near the borders and made the outline less accurate - Ignore invalid generated polygons (under 3 points) to avoid unnecessary errors and crashes - Error popup only when no polygon could be generated at all - Added option to shrink pixels (to get rid of small separate islands) - Fixed polygon preview (lines were sometimes not showing along the borders) Fixes #32564, #29267
* Style: Fix issues with clang-format 8.0Rémi Verschelde2019-05-201-21/+19
|
* Added ability for multiple images to be imported as an atlasJuan Linietsky2019-04-191-0/+58
| | | | | This adds support for groups in the import system, which point to a single file. Add property hint for saving files in file field
* Fix BitMap calculating incorrect true bit countAndrii Doroshenko (Xrayez)2019-04-041-1/+2
|
* Fix -Wsign-compare warnings.marxin2019-02-271-1/+1
| | | | | I decided to modify code in a defensive way. Ideally functions like size() or length() should return an unsigned type.
* Scene: Ensure classes match their header filenameRémi Verschelde2019-02-121-0/+625
Also drop some unused files. Renamed: - `scene/2d/navigation2d.h` -> `navigation_2d.h` - `scene/2d/screen_button.h` -> `touch_screen_button.h` - `scene/3d/scenario_fx.h` -> `world_environment.h` - `scene/audio/audio_player.h` -> `audio_stream_player.h` - `scene/resources/bit_mask.h` -> `bit_map.h` - `scene/resources/color_ramp.h` -> `gradient.h` - `scene/resources/shape_line_2d.h` -> `line_shape_2d.h` - `scene/resources/scene_format_text.h` -> `resource_format_text.h` - `scene/resources/sky_box.h` -> `sky.h` Dropped: - `scene/resources/bounds.h`