17 Commits

Author SHA1 Message Date
Rogier
1fbf6d3962 Use cstdint instead of stdint.h to (hopefully) fix any problems caused by C/C++ mismatches
INT64_MIN was causing problems ('not declared'), because C99 requires some
C++-specific behavior, which C++11 prohibits...

Comments from clang's stdint implementation (http://clang.llvm.org/doxygen/stdint_8h_source.html):

	// C99 7.18.3 Limits of other integer types
	//
	//  Footnote 219, 220: C++ implementations should define these macros only when
	//  __STDC_LIMIT_MACROS is defined before <stdint.h> is included.
	//
	//  Footnote 222: C++ implementations should define these macros only when
	//  __STDC_CONSTANT_MACROS is defined before <stdint.h> is included.
	//
	// C++11 [cstdint.syn]p2:
	//
	//  The macros defined by <cstdint> are provided unconditionally. In particular,
	//  the symbols __STDC_LIMIT_MACROS and __STDC_CONSTANT_MACROS (mentioned in
	//  footnotes 219, 220, and 222 in the C standard) play no role in C++.
	//
	// C11 removed the problematic footnotes.
2015-05-31 07:08:25 +02:00
Rogier
f853915404 Fix Windows build (isnan not defined -> std::isnan) 2015-03-10 12:01:55 +01:00
Rogier
5ce7ff4bce Allow scaling a map to a smaller size while generating. (1/2, 1/4 .. 1/16)
Scaling will not average nodes across block boundaries, This implies
that the only scale factors supported are 1:2, 1:4, 1:8 and 1:16.
2015-02-20 13:10:09 +01:00
Rogier
784cf9604f Replace m_nextStoredYCoord by a PixelAttributes member. 2015-02-20 13:10:09 +01:00
Rogier
b99111e038 Add a --drawalpha mode that keeps water (etc.) transparent to great depths
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.
2014-06-19 13:30:00 +02:00
Rogier
e27d181d9f Idempotent changes to PixelAttribute class (preparing for next patch) 2014-06-19 13:29:28 +02:00
Rogier
a065e68eac Make darkening of thick transparent stacks (e.g. deep water) configurable.
In order to reduce rendering surprises, this darkening is off by default
(it was on previously).
2014-06-18 21:19:14 +02:00
Rogier
9b5da3ad2c Optimize generation of horizontally sparse maps
(i.e. maps with most but not all pixels in every row empty)
2014-06-18 10:03:32 +02:00
Rogier
3df8be20bb Fix SEGV when top part of the map is empty 2014-05-22 10:41:47 +02:00
Rogier
6a26a8ef4b Make the geometry pixel-accurate instead of map-block accurate
When requesting, for instance, a 75x85 map, the mapper will
now create a 75x85 map, instead of an 80x96 (or even 96x108)
map as it did before.

This new behavior is the default when using one of the options
--centergeometry or --cornergeometry.

In addition, both of these options will no longer shrink the
map, to remove rows or columns of empty blocks at the edges.
Previously, this behavior was enabled with --forcegeometry.

An option --geometrymode has been added as well, to tune
the interpretation of the geometry. It supports 4 flags:

- pixel:  the requested geometry is interpreted with pixel
	  granularity. The map is not enlarged to include
	  entire map blocks.

- block:  the requested geometry is interpreted with block
	  granularity. The map is enlarged with at most 15
	  nodes at each of the four edges, so that it
	  includes entire map blocks only.

- fixed:  a map of the requested geometry is created (after
	  adjustmens for 'block' mode). Empty rows or
	  columns at the edges are not removed.

- shrink: Empty rows and columns at the map edges are
	  removed to generate the smallest picture possible.

Lastly, a new geometry syntax has been added, which is more
compatible with known syntax (i.e. X-Windows), and which
allows the offset to be optional. If the offset is omitted,
the picture defaults to be centered around 0,0.

`<width>x<height>[+|-<xoffset>+|-<yoffset>]`

For compatibility, the behavior of the option --geometry
was not changed. If (and only if) used before --geometrymode,
it enables block granularity and shrink.

The old option --forcegeometry is no longer documented,
but still recognised for compatibility.
2014-04-16 15:12:37 +02:00
Rogier
2119a6ae75 Make PixelAttributes more generic
In preparation for other changes
2014-04-16 10:55:58 +02:00
Rogier
ce94029c95 Merge PixelCacheEntry into PixelAttributes 2014-04-14 01:29:58 +02:00
Sfan5
e96c23a8f7 Add alpha transparency ability for blocks 2014-04-09 11:03:54 +02:00
Miroslav Bendík
f0e064744b Small refactoring. 2012-09-01 16:17:58 +02:00
Miroslav Bendík
4a8c041bc1 Small optimization of PixelAttributes. 2012-09-01 14:36:14 +02:00
Miroslav Bendík
5be190b5a1 Removed bad shadows. 2012-08-25 13:27:40 +02:00
Miroslav Bendík
1aee368837 Implemented shading. 2012-08-25 13:21:28 +02:00