* Add test nodes for alpha compositing and the fill texture modifier
Texture test nodes can be helpful to test if `blit_with_alpha` works correctly.
The alpha compositing test node covers different cases where pixel colors are mixed with each other.
The test currently fails because `blitPixel` does not work correctly if a semi-transparent color
is drawn on top of another semi-transparent color.
The test nodes for the fill texture modifier show if the size and position arguments of the modifier work correctly.
They do not cover special cases such as very large or negative position or size values.
* Faster blit_with_alpha()
The `blit_with_alpha` function has a noticeable effect on the time it takes to join a game.
To reduce the join times, I replace the `blit_with_alpha` function with a new one:
* It does not uses floating-point numbers.
* It directly operates on the raw pixel data instead of using the comparatively
slow `setPixel` and `getPixel` functions from Irrlicht.
Only ECF_A8R8G8B8 base images are supported now.
If the top image does not have the ECF_A8R8G8B8 color format, it is converted;
I assume that this happens rarely.
* There are case distinctions for fully opaque, fully transparent and semi-transparent pixels.
This empirically increases the performance since the mixing between two semi-transparent happens rarely.
* The new function no longer has the `src_pos` argument since it was always the zero vector.
* The function is only documented once where it is declared.
For backwards compatibility, `blit_with_alpha` still mixes colors without gamma correction.
`blit_with_alpha` nonetheless behaves slightly different than before:
If a semi-transparent pixel is drawn on top of another semi-transparent pixel,
the color is mixed in a way which we can consider to be more correct now.
* Make falling liquid source nodes replace flowing nodes
This makes falling liquid source nodes in group:float replace
flowing nodes on the ground instead of being placed above
the flowing node.
* Make flowing liquids "fall through" for source nodes
This makes liquids in float and falling_node groups fall through
flowing liquid nodes instead of being supported by them in the air.
---------
Co-authored-by: SmallJoker <SmallJoker@users.noreply.github.com>
Co-authored-by: Lars Mueller <appgurulars@gmx.de>
4dir is like facedir, but only for 4 horizontal directions: NESW. It is identical in behavior to facedir otherwise. The reason why game makers would want to use this over facedir is 1) simplicity and 2) you get 6 free bits.
It can be used for things like chests and furnaces and you don't need or want them to "flip them on the side" (like you could with facedir).
color4dir is like colorfacedir, but you get 64 colors instead of only 8.
* Add a simple PNG image encoder with Lua API
Add ColorSpec to RGBA converter
Make a safety wrapper for the encoder
Create devtest examples
Co-authored-by: hecktest <>
Co-authored-by: sfan5 <sfan5@live.de>
set_sky: New feature, keep note about the old syntax
get_us_time: Document overflow
localplayer: Document "nil" behaviour before initialization
collision_box: Safe limit of "1.45"
The inventory image size of the inventory image of nodes with drawtype allfaces (and related) is scaled as well if visual_scale is set (previously, the inventory image size was always the same)