69 Commits

Author SHA1 Message Date
Rogier
c1f2df705b Add an option to print progress information while generating the map. 2014-04-10 01:15:58 +02:00
Rogier
db2d27c077 Catch failure of gdImageCreateTrueColor & terminate gracefully. 2014-04-09 18:56:04 +02:00
Rogier
96a9c937ab Really ignore colors.txt lines that failed to parse 2014-04-09 12:47:59 +02:00
Sfan5
a7a45b5a55 Tabs -> spaces 2014-04-09 12:02:21 +02:00
Rogier
84e1fac7d7 Improve parsing of colors file
The colors file is now parsed line by line, which means
that parse failures on one line will not carry over to the next line.

When a line fails to parse, the rest of the file is no longer silently
ignored, but the error is reported, and just the failed line is ignored.
2014-04-09 11:47:18 +02:00
Sfan5
e96c23a8f7 Add alpha transparency ability for blocks 2014-04-09 11:03:54 +02:00
ShadowNinja
dc10bd20b1 Remove embedding of colors.txt in executable 2014-04-09 10:49:46 +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
fdc73f0374 Fix computation of origin location and player locations (off-by-one) 2014-04-07 19:11:24 +02:00
Rogier
266c1eaaf0 Small improvement to for loop iteration code 2014-03-30 01:42:43 +01:00
Rogier
a2205eb9fb Geometry: w and h are the map dimensions
For a 100x100 map, the w and h parameters would have to be
specified as +99+99. This is not intuitive. Changed this,
so that +100+100 results in a 100x100 map.
2014-03-26 11:51:48 +01:00
Rogier
1c8cb878ab Report area rendered as well (with --verbose) 2014-03-26 09:17:56 +01:00
Rogier
5442db19dc Set default map geometry to the maximum world size (i.e. 4096x4096) 2014-03-26 08:55:20 +01: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
440edca394 Report number of 16x16x16 blocks in world and map as well, with --verbose 2014-03-23 20:53:13 +01:00
Rogier
5296f9f9e7 Report world coordinate limits and map heigth and depth limits with --verbose 2014-03-23 20:52:58 +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
a2bec337a9 Fix vertical limits handling
Node and map-block coordinates were mixed up, causing the min/max
vertical coordinate limitation to be broken.

The confusion was removed, and --min-y and --max-y now work as they
should.
2014-03-23 19:47:49 +01:00
Rogier
a32516d5be Add option '--verbose', and make it report requested and actual map coordinates. 2014-03-23 18:35:00 +01:00
Rogier
18303eda33 Fix SEGV after failing to open output file: throw runtime error
The result of opening the file was not checked, resulting in a
NULL pointer dereference if it failed.
2014-03-23 17:31:50 +01:00
Rogier
4f504a6357 Set initial y limits to INT_MIN/INT_MAX (instead of -/+30000) 2014-03-23 17:15:03 +01:00
Rogier
2a7c53b55a Fix computation of block number bounds (off-by-one)
The block numbers could be off by one due to incorrect rounding.

m_geom* now contain the minimum and maximum block numbers that
should be in the map.
2014-03-23 16:47:00 +01:00
Sfan5
f8edccffb7 Small optimization 2014-03-22 09:30:14 +01:00
Sfan5
5bf2039bbb Make sure whole map is always drawn 2014-03-16 20:55:09 +01:00
Sfan5
46023f77f5 Make it (almost) compile for windows 2014-03-09 12:32:13 +01:00
Sfan5
0a5a0d0d51 Fix sqlite3 not being usable as backend 2014-03-05 22:40:01 +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
6b511e5e79 Fix unknown nodes showing up as black 2013-03-18 14:12:02 -04:00
Miroslav Bendík
7d15dbf4ed Added --geometry support. 2012-11-24 19:25:13 +01:00
Miroslav Bendík
5969c61e54 Removed hard size limit. 2012-11-24 18:43:48 +01:00
Miroslav Bendík
28e9450573 Zlib moved into separate module. 2012-09-18 10:43:34 +02:00
Miroslav Bendík
6133aff2f3 Small cast cleaning. 2012-09-18 10:15:50 +02:00
Miroslav Bendík
7c5f4751f6 Player attributes moved to separate class. 2012-09-01 16:40:18 +02:00
Miroslav Bendík
88bf8bc88b Fixed windows compatibility. 2012-09-01 16:01:08 +02:00
Miroslav Bendík
112ccc5d08 File colors.txt compiled into binary 2012-09-01 15:51:02 +02:00
Miroslav Bendík
1edbba5a94 Added path separator handling. 2012-09-01 13:41:00 +02:00
Miroslav Bendík
6dff561ec0 Rendering Z blocks in reverse order. 2012-09-01 13:34:27 +02:00
Miroslav Bendík
b9e40ed972 Removed Boost dependency. 2012-09-01 13:01:31 +02:00
Miroslav Bendík
cb65bbbc4c Better sqlite3_open error reporting. 2012-09-01 12:19:33 +02:00
Miroslav Bendík
4d9a3cc5d9 Added windows support. 2012-08-28 11:27:51 +02:00
Miroslav Bendík
e5cafeb8b8 Fixed crash on std::length_error 2012-08-27 07:46:11 +02:00
Miroslav Bendík
5a2375e608 Added printing of unknown nodes. 2012-08-25 16:41:53 +02:00
Miroslav Bendík
8396275bf8 Implemented rendering of names. 2012-08-25 16:29:41 +02:00
Miroslav Bendík
3349bee3a4 Added draworigin. 2012-08-25 15:21:51 +02:00
Miroslav Bendík
b0f36ba4cf Implemented drawscale. 2012-08-25 15:06:11 +02:00
Miroslav Bendík
908697427b Removed drawunderground parameter. 2012-08-25 14:12:54 +02:00
Miroslav Bendík
a009d3e191 Added border support. 2012-08-25 14:11:55 +02:00