0
Commit Graph

28 Commits

Author SHA1 Message Date
Jens
221ac26829 Add Heatmap RenderPrimitive (chunk mtime) 2021-06-04 15:02:47 +02:00
Nicolas F
e348a548b6 Initial Python 3 port
Many things work, some don't. Notably, genPOI doesn't work, and
there's some signedness comparison stuff going on in the C extension.

This also completely drops support for Python 2, as maintaining a C
extension for both Python 2 and 3 is a pain and not worth it for the
9 months that Python 2 is still going to be supported upstream.

The documentation needs to be adjusted as well.

All of the few tests we have pass, and rendering a map works, both
with a configuration file and without. We can also use optimizeimages.

Concerns #1528.
2019-03-17 17:57:07 +01:00
Franz Dietrich
086820ac72 Adding StructureOverlay an overlay to color the map according to structures.
A usecase to demonstrate a possible application of the extended functionality:

**"Rails Overlay that draws only the rails that are on Cobblestone for a subway map."**

With this patch it is very easy to achive that:

```python
MineralOverlay(minerals=[(((0, 0, 0, 66), (0, -1, 0, 4)), (255, 0, 0, 255)),
                         (((0, 0, 0, 27), (0, -1, 0, 4)), (0, 255, 0, 255))])
```

In this case the overlay will be red for rails on cobblestone and green for powerrails on cobblestone.
The syntax is `(<tuple of conditions>, <target color>)`
 * where `<target color>` is a 4 tuple with a `(r, g, b, a)` color
 * and `<tuple of conditions>` is a tuple with an arbitrary number of conditions with the following syntax:
`((relx, rely, relz, blkid), ...)` where the `rel<>` parameters specify the relative coordinates to the block that is checked if it matches bklid.

In the example the fist tuple `(0,0,0,66)` checks if at the current position is a
rail while `(0,-1,0,4)` checks if at one below the current position is a cobblestone.
If both are true then the color `(255, 0, 0, 255)` is used.

A Sample Config file exploiting the capabilities:

``` python
worlds['My World'] = "~/.minecraft/saves/test/"
outputdir = "/tmp/test_render"
rendermode = "lighting"

renders["render1"] = {
    'world': 'My World',
    'title': 'A regular render',
}
renders["render_overlay_dafault_rails"] = {
    'world': 'My World',
    'title': 'Default Rails',
    'rendermode': [ClearBase(), StructureOverlay()],
    'overlay': ['render1'],
}
renders["render_overlay_cust_rails"] = {
    'world': 'My World',
    'title': 'Custom Rails',
    #relative coordinates [[(relx, rely, relz, mineral)], (red, green, blue, alpha)]
    'rendermode': [ClearBase(), StructureOverlay(structures=[(((0, 0, 0, 66), (0, -1, 0, 4)), (255, 0, 0, 255)),
                                                            (((0, 0, 0, 27), (0, -1, 0, 4)), (0, 255, 0, 255))])],
    'overlay': ['render1'],
}
```

The "Default Rails" overlay uses default coloring of the structures overlay. "Custom Rails" uses some custom coloring.

fixes overviewer/Minecraft-Overviewer#556 and fixes overviewer/Minecraft-Overviewer#787
2014-09-03 12:05:11 +02:00
Andrew Chin
dc345ba75d Renamed the current nether to netherold, and made the new nether2 the default 2012-11-28 22:03:17 -05:00
Mark Crichton
4ced35e9e5 Add new nether render mode. 2012-09-18 22:05:15 -04:00
Thomas Lake
06a7f6ebdc Add support for 'alpha' option and change default 2012-08-25 09:26:13 +01:00
Thomas Lake
c453637e47 Add BiomeOverlay rendermode.
A "biomes" option is specified in rendermodes.py but not yet wired up!
May do unexpected things if used :-)
2012-08-22 19:30:46 +01:00
Richard Pastrick
28099deaf6 Add customizable overlay colors, works for base overlay, spawn, and slime.
I left minerals as it is so you have to still define the minerals option to get that to work.
2012-06-08 12:07:21 -07:00
Aaron Griffith
05bfaaf967 added slime overlay, colors chunks green if slimes can spawn 2012-06-05 23:18:15 -04:00
Aaron Griffith
f4a1c32d1a added sealevel option to HeightFading primitive 2012-06-05 01:09:47 -04:00
Aaron Griffith
08b0ed17e6 Merge remote-tracking branch 'interfect/master' into devel 2012-05-06 12:52:24 -04:00
Adam Novak
9df1446276 Added a NoFluids render mode primitive, and documented it. 2012-04-24 20:29:27 -07:00
Adam Novak
5184c8d321 Added and documented the "exposed" render mode primitive. 2012-04-24 17:04:51 -07:00
Aaron Griffith
f5797dd8a0 added a Hide() render primitive 2012-04-12 15:16:19 -04:00
Aaron Griffith
9be414e540 added biomes option to Base primitive (default: True)
fixes Issue #644
2012-03-15 04:54:20 -04:00
Andrew Brown
8e559be824 added a built-in cave rendermode 2012-03-02 23:50:04 -05:00
Aaron Griffith
9aee71b953 updated default max height on Depth render primitive 2012-03-01 21:09:17 -05:00
Aaron Griffith
5d50f35ac1 broke out background-clearing code from base overlay primitive 2012-02-26 11:52:43 -05:00
Aaron Griffith
2b7af1886a overlays converted into render primitives 2012-02-26 11:39:07 -05:00
Andrew Brown
9c0a8c01ee re-arranged config docs, relaxed validator for north direction 2012-02-15 19:18:51 -05:00
Andrew Brown
ba12cdf12e added some built-in rendermodes to rendermodes.py 2012-02-03 20:39:04 -05:00
Aaron Griffith
16fec5085e converted smooth-lighting into a primitive
for the first time ever, smooth-lit cave mode is now possible \o/
2012-01-08 22:49:20 -05:00
Aaron Griffith
ae88b6e27b converted lighting mode into a primitive 2012-01-08 22:31:41 -05:00
Aaron Griffith
c93715ebfa migrated cave mode into cave and depth-tinting primitives 2012-01-08 18:29:32 -05:00
Aaron Griffith
30c4bb26c3 default values for options are now specified alongside their definitions 2012-01-08 01:09:43 -05:00
Aaron Griffith
a682b8a689 broke out nether, heightfading, depth, and edgelines from base primitive 2012-01-08 00:08:16 -05:00
Aaron Griffith
e3610f8ac5 moved to a layer-based rendermode system, moved normal mode to base primitive
options are now handled partially in the python side, in rendermodes.py
2012-01-08 00:08:16 -05:00
Aaron Griffith
4eaf103213 fixes to get lighting mode working again 2012-01-06 20:23:15 -05:00