Commit Graph

37 Commits (98fa76bb6b87ae31078f526cf445834be2a8b4ec)

Author SHA1 Message Date
Rogier 15bab71533 Allow setting verbosity back to 0 2014-05-22 10:41:47 +02:00
Rogier 2c00ad665c Fix SEGV caused by unknown/unrecognised option name 2014-05-22 10:41:47 +02:00
Rogier f60fd0a9aa Search world's minetest directory for colors file as well.
(which is assumed to be the directory two levels up from the
 world's directory, if it contains 'minetest.conf')
2014-05-22 10:41:12 +02:00
Rogier 65b37bec25 Allow player and origin colors to have an alpha component.
Values: 0: fully transparent, 255: fully opaque.

Note that this doesn't yield the expected color blending just
yet, due to libgd messing it up. (Seemingly, the libgd arc
drawing function draws some pixels repeatedly, resulting in a
more opaque circle than desired)
2014-05-22 10:41:12 +02:00
Rogier 1c7b31a5dc When not using a geometry option, *do* generate the smallest possible map 2014-05-22 10:41:12 +02:00
Rogier d5b3b2a7da Improve error messages for zlib decompression errors 2014-05-22 10:41:12 +02:00
Rogier 0117556550 Make --geometrymode accept an empty option list
An empty option list modifies the behavior of a subsequent plain
--geometry to not make the old mode (shrink,block) the default.
2014-05-12 09:26:17 +02:00
Rogier 5915e1712a Add error messages when failing to parse command-line
Mention the help option as well in the help text.
2014-05-12 09:26:17 +02:00
Rogier 5e4ee45575 Move color string parsing to constructor of class Color & add a constructor using an integer
Added formats for Color constructor:
- plain interger (2^24 * alpha + 2^16 * red + 2^8 * green + blue)
- Color string consisting of:
  - '#'
  - 3, 4, 6 or 8 hex digits
2014-05-12 09:26:17 +02:00
Rogier e97e19921c Search more locations for the colors.txt file
The colors.txt file can now be located:
- in the directory of the world being mapped
- in the user's private minetest directory ($HOME/.minetest)
- in the current directory as a last resort

The location can also be specified using a command-line option
2014-04-16 15:13:09 +02:00
Rogier 06237f5abc Improve layout of verbose geometry messages & tune their verbosity 2014-04-16 15:12:59 +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 ec7178dde3 Change --tileorigin to accept ',' as separator
The previous separator (':') still works, but is not advertised.
2014-04-16 10:57:21 +02:00
Rogier 13463f2214 Catch option parsing errors & colors.txt errors. 2014-04-14 01:30:17 +02:00
Rogier b9993d68cf Allow disabling tiles on the command line (i.e. accept 0 as tile size) 2014-04-14 01:29:29 +02:00
Rogier c1f2df705b Add an option to print progress information while generating the map. 2014-04-10 01:15:58 +02:00
Sfan5 e96c23a8f7 Add alpha transparency ability for blocks 2014-04-09 11:03:54 +02:00
Rogier f18d5de26a Add the option to divide the map into tiles, rendered with a border in-between.
The net effect of making an image tiled, is that a grid is added
to the image, *without* obscuring part of the image with
grid lines: all pixel information is preserved. The lines
(aka borders) are added in-between the pixels of the image.
As a result, the image dimensions increase, and the image
may look slightly distorted. (a straight slanted line crossing
a tile border, will not look straight at the crossing).

Example:
Picture:
	[                                                  ]
	[ H   H  III     TTTTT  H   H  EEEEE  RRRR   EEEEE ]
	[ H   H   I        T    H   H  E      R   R  E     ]
	[ HHHHH   I        T    HHHHH  EEE    RRRR   EEE   ]
	[ H   H   I        T    H   H  E      R   R  E     ]
	[ H   H  III       T    H   H  EEEEE  R   R  EEEEE ]
	[                                                  ]
Same picture with 10x5 tiles:
	[          |          |          |          |          ]
	[ H   H  II|I     TTTT|T  H   H  |EEEEE  RRR|R   EEEEE ]
	[ H   H   I|        T |   H   H  |E      R  | R  E     ]
	[ HHHHH   I|        T |   HHHHH  |EEE    RRR|R   EEE   ]
	[ H   H   I|        T |   H   H  |E      R  | R  E     ]
	[----------|----------|----------|----------|----------]
	[ H   H  II|I       T |   H   H  |EEEEE  R  | R  EEEEE ]
	[          |          |          |          |          ]
2014-04-08 04:40:09 +02:00
Rogier 10e6a746cd Database performance tweaks
Added the option to bulk load and cache entire world rows at
a time when using sqlite. Caching is implemented in the
database class this time around.
Enabled using --sqlite-cacheworldrow on the command line.

This is essentially re-introduces the database access strategy
that was used originally, but as an option.

Currently, one block is read at a time from the database.
The original behavior was to read and cache one entire world
row at a time, irrespective of whether or not only a (small)
subsection of the world was being mapped.
Under some circumstances, in particular if the entire world is
mapped or a relatively large percentage of it (blocks-wise), the
bulk loading and caching may outperform the one-by-one strategy,
even though it usually loads many more blocks than are actually
needed.

It seems that leveldb won't benefit from any kind of caching or
bulk loading of blocks, so none was implemented.

Leveldb does compile now. Still not tested on a database :-(

Improved the database statistics (printed with --verbose).
2014-03-26 00:23:33 +01:00
Rogier ecbe59ac82 Optimize database access - load only blocks that are needed 2014-03-24 22:43:32 +01:00
Rogier 6420eb48fb Add option --forcegeometry to force using the requested geometry
Instead of reducing the map size to the minimum necessary for the
size of the world, a map of the requested size is always generated.
2014-03-23 20:06:35 +01:00
Rogier a32516d5be Add option '--verbose', and make it report requested and actual map coordinates. 2014-03-23 18:35:00 +01:00
Sfan5 46023f77f5 Make it (almost) compile for windows 2014-03-09 12:32:13 +01:00
Sfan5 393d7e2ac0 LevelDB support 2014-03-05 21:42:21 +01:00
Sfan5 15444ff8f6 Add --min-y and --max-y options 2014-03-05 18:06:05 +01:00
Sfan5 33f323b1e3 Add --noshading option, Fix SIGABRT because of uncaught exception when any exception occured 2014-03-05 17:20:06 +01:00
ShadowNinja de94ab8aa6 Fix usage text and rename executable 2013-07-29 12:16:08 -04:00
Miroslav Bendík 7d15dbf4ed Added --geometry support. 2012-11-24 19:25:13 +01:00
Miroslav Bendík 908697427b Removed drawunderground parameter. 2012-08-25 14:12:54 +02:00
Miroslav Bendík 65ae97f54b Added block position decoder. 2012-08-23 13:32:22 +02:00
Miroslav Bendík 957a72e2b4 Parsing of colors moved to TileGenerator. 2012-08-23 12:55:31 +02:00
Miroslav Bendík 3d54e5edaa Added class TileGenerator. 2012-08-23 12:46:22 +02:00
Miroslav Bendík 6a4083d28c Added ColorMap definition. 2012-08-23 12:32:59 +02:00
Miroslav Bendík 375812ea15 Added parsing of colors.txt. 2012-08-23 12:30:09 +02:00
Miroslav Bendík 2adc11fdb5 Added parsing. 2012-08-22 16:04:43 +02:00
Miroslav Bendík efe280f988 Added commandline parameters. 2012-08-22 15:49:45 +02:00
Miroslav Bendík b15a8d4de4 Created project. 2012-08-22 15:22:01 +02:00