On Windows with mingw-w64, Pillow includes windows.h, and thus
including Imaging.h would result in a name conflict of "TRANSPARENT",
which windows.h #defines but overviewer.h wants to use as enum.
For the record, this used to not be broken back when I initially
fixed Pillow for mingw-w64, so the change got somewhere introduced
between then and now.
Note that this commit changes the pseudo-ancil-data type from unsigned
int to an unsigned short. Our pseudoancil code creates 5 bits of data
to store adjacency information for glass. Glass also has 4 bits for
color info. This means we need a total of 9 bits to render these (thus
int --> short)
is_transparent returns 1 for every unknown block because that's an easy way to
make them ignore lighting, however, this makes cave render useless with a map
containing unknown ores.
The definition is_known_transparent checks whether a block is transparent and is known.
This is a workaround, a proper fix would be to have unknown blocks be neither transparent nor
solid. Or make them both. But don't prefer one of the two.
The nether rendering mode was not properly handling x and z values
outside of the range 0 to 15. This was causing an out-of-bounds
segfault when accessing the remove_block array.
Fixes#881Fixes#851Fixes#852
Added resize_half() and resize_half_wrap() functions to composite.c and
overviewer.h, to replace the call to PIL's resize function made by
tileset.py. Also added "resize_half" to COverviewerMethods in main.c, so
it can be called from Python. Should increase performance by 10 to 20%
for the entire program.
closes issue #708
Props to mkor for taking advantage of the existing average loop, and
CounterPillow for sussing out the correct biome multiplication
color. This commit is just a teensy bit more future-proof.
Also removed some code that I accidentially left in.
Also added a traceback printing decorator around get_chunk() because the
C code can potentially swallow those exceptions.