* 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.
Many functions expect RemotePlayer to have a valid peer ID,
this however is not the case immediately after disconnecting
where the object is still alive and pending for removal.
ServerEnvironment::getPlayer(const char *, bool) now only
returns players that are connected unless forced to.
Restores backwards compatibility for death sounds or other sounds that are not supposed to be "cut off" abruptly.
---------
Co-authored-by: sfan5 <sfan5@live.de>
Co-authored-by: grorp <gregor.parzefall@posteo.de>
Consistently applying this setting requires some code work,
because Irrlicht does not provide a global toggle.
At the same time I don't see any reason for someone to disable this.
* Fix incorrect shootline after releasing pointer if touch_use_crosshair=false
This happened because Android reuses pointer IDs.
Also includes a refactor to merge "m_known_ids" and "m_pointer_pos".
* Restore pre-5.9.0-dev behavior of shootline when !m_has_move_id
* Detect air-only blocks instead day/night differences
* Write !is_air into the former day-night-diff bit on disk, so that old server can still read maps written by new servers
* Only set is_air bit when reading from disk
This may improve performance substantially if there are many meshes with "few" vertices that would otherwise be retransmitted to the GPU every frame. In testing, this does not seem to decrease performance, even if as few as 4 vertices are used (e.g. particles).
The recently added ioctl use is reported as a false-positive by valgrind.
I tried moving it to different compilers/versions two times and only
hit further issues that were valgrind's fault.
Also includes a tiny fix.
Increases the tolerance from one node to five nodes.
Also optimizes the "sphere" used for pre-filtering entities
to start in the middle of the line segment rather than at the start.
Upon disconnect, RemotePlayer still had a peer ID assigned even though
the PlayerSAO object was maked as gone (for removal). This commit makes
that the following always holds true:
(!sao || sao->isGone()) === (peer_id == PEER_ID_INEXISTENT)