Primarily to prevent gcc6 complaining about it, as in practise,
there was no impact on behavior or correctness at all.
At the same time, the code in question was adapted slightly to
clarify the intentions and effects.
This is required to be able to build on Windows.
open() is not a standard ANSI C/C++ function and only available on POSIX systems.
Using fopen() provides better portability.
This does require a color definition to be added to the colors file.
Implemented as a generic option to draw or ignore types of nodes
(i.e. 'air', 'ignore'). Ignoring specific named nodes from the
command-line is not (yet??) supported.
i.e. allow minetestmapper to query the database for a list of
blocks in a specific range (corresponding to the requested geometry),
instead of always obtaining a full list off all blocks.
As postgresql is the only database which supports this efficiently,
this option is only effective for postgresql.
<stream>.eof() may require the stream to be read (peeked) before giving the
correct result. But it can't be peeked if already at EOF - see below.
<stream>.peek() is not idempotent:
If the stream is at EOF, but not known to be, it sets eofbit.
However, if the stream is known to be at EOF, it sets the failbit :-(
When using --disable-blocklist-prefetch, the database key format for every leveldb
block, which is normally determined when prefetching the block list, is not known.
In order to avoid duplicate queries using both key formats, the key format can now
be specified using --database-format
This introduces a speed tradeoff.
When mapping a small part of a large world, the prefetch time dominates
the mapping time, and it is more advantageous to skip the prefetch and
query all possible blocks in the mapped space.
When mapping a large fraction of a world, in particular when a lot of
the mapped space is empty, the time spent querying non-existing blocks can
dominate mapping time, and it is more advantageous to prefetch the list
of existing blocks, so that querying huge numbers of non-existing blocks
can be avoided.
On Windows, minetestmapper now uses the colors files from the
directory where it is installed.
If the last directory is named 'bin', that part is stripped,
and the resulting directory, and a subdirectory named 'colors'
are searched.
All depends on the whether on invocation, argv[0] contains the full
path of the exe file. It works under Wine when compiled with MinGW.
I haven't been able to test on a real copy of windows, or when
compiled using msvc, but I assume that will work too.
As tests using --sqlite-cacheworldrow showed a consistently
lower performance than without, this option was effectively
disabled. It is still recognised for compatibility, but
it may be removed some time in the future.
--heightmap: generate the height map, in colors
--heightmap-grey: use shades of grey instead of colors
--sealevel <n>: define the sea level (below sea level is drawn in blue)
--heightmap-scale <f>: scale the heights by f (for the purpose of
color selection)
When generating a heightmap, a special colors file is needed,
that defines just the blocks that should be considered part
of the ground. That means that normally, any plants, special
nodes and water should not be included.
The option --tiles has two new possible values: 'block' and 'chunk'
'block' creates tiles corresponding to map blocks
'chunk' creates tiles corresponding to map chunks
(chunks are the unit of map generation).
An option --chunksize was added to manually override the chunk size.
This new mode averages the colors of all transparent blocks, instead of
making the colors progressively darker and more opaque.
This 'average' mode is now the default when using --drawalpha. It can be
explicitly selected using --drawalpha=average. The old modes can be selected
using --drawalpha=cumulative[-darken].
It is recommended to change the colors of water as well. These are in a
separate patch.
As this comes with a significant performance penalty, this
feature must be enabled using the command-line option --drawair
For best results, the color of air should be fully transparent,
so that underlying nodes will override it.
This is useful to show invisible ('air' or 'invalid') nodes in blocks
that are in the database using a different color than blocks that are
not in the database (which will have no color at all, causing the
background color to show).
Supported figures are points, lines, ellipses, rectangles
and text.
The figures' locations can be specified using either world
coordinates, or map coordinates.
In preparation for future changes.
New geometry and new coordinate syntax has been added as well:
Additional node coordinate formats:
<block>#[<node>]
<block>.[<node>]
Additional geometry formats:
<x1>,<y1>:<x2>,<y2>
<x>,<y>:<w>x<h>
Also: the old geometry behavior (block granularity and map shrinking)
is now enabled only if the old geometry format is used (for compatibility)