This adds to the changes that commit
98d16e0d9a "Android: Tell make about sub-makes to speed up build"
did, and enables parallel builds for minetest
itself as well.
Fixes#2122Fixes#1454
Addendum (est31)
According from its docs in android_native_app_glue.h (from the NDK), the
onInputEvent should "Return 1 if you have handled the event, 0 for any
default dispatching". Before, we always returned 1, meaning we blocked
all hardware keys to be given to the OS.
This broke the volume keys and has caused #2122 and #1454.
Although it bases on lots of guesswork, it can probably safely be said that
CGUIEnvironment::postEventFromUser returns true if the event was handled,
and false if not. Therefore, set the status variable depending on what
postEventFromUser returned.
The change keys dialog can't be left. It doesn't make
much sense to show it on Android in the first place,
therefore disable it, just like commit
aed70cb0b6 'Disable sound and key binding settings in "pause" menu on android'
has disabled it for the esc menu.
Fixes#4115.
The path finding code works fairly well except that it considers
anythin not CONTENT_AIR to be "above the surface". This results in
paths that are unwalkable for entities since e.g. plants are not
walkable. The path would force them to jump on top of grass plants,
etc..
The obvious solution is not to use CONTENT_AIR as a criteria, but
instead distinguish between walkable and non-walkable nodes. This
results in paths that properly walk through grass nodes.
This was extensively tested by a flock of electric sheep.
Note that for underwater purposes this changes the behaviour from
"the surface is walkable" to "ignore water entirely" making the
path go across the water bottom, and pathing fail likely from the
water surface. This is intentional.
Before, the GridNodes were stored in vector<vector<vector<T>>>,
and initialized in advance. Putting three vectors inside each other
puts lots of unneccessary stress onto the allocator, costs more memory,
and has worse cache locality than a flat vector<T>.
For larger search distances, an the array getting initialized means
essentially O(distance^3) complexity in both time and memory,
which makes the current path search a joke. In order to really
profit from the dijkstra/A* algorithms, other data structures
need to be used for larger distances.
For shorter distances, a map based GridNode storage may be slow as
it requires lots of levels of indirection, which is bad for things like
cache locality, and an array based storage may be faster.
This commit does:
1. remove the vector<vector<vector<T>>> based GridNodes storage that
is allocated and initialized in advance and for the whole
possible area.
2. Add a vector<T> based GridNodes storage that is allocated and
initialized in advance for the whole possible area.
3. Add a map<P,T> based GridNodes storage whose elements are
allocated and initialized, when the path search code
demands it.
4. Add code to decide between approach 2 and 3,
based on the length of the path.
5. Remove the unused "surfaces" member of the PathGridnode class.
Setting this isn't as easy anymore for the
map based GridNodes storage.