0
Commit Graph

288 Commits

Author SHA1 Message Date
Nicolas F
1ab66dddea fix prismarine stairs
Sorry for the noise in mc_id.h, but somebody decided they want DOS
line endings and I couldn't allow that to happen. When not doing that
put the whole thing into diff, I decided to just fix the indentation
too while I was at it.

Needed bugfixing of some overlooked unsigned char usages for block IDs,
as otherwise the lighting would be scuffed.

Concerns issue #1486.
2019-03-31 19:20:10 +02:00
Wunkolo
4b0b50f215 Implement style fixes 2019-03-18 14:04:36 -07:00
Wunkolo
62dcfab7a0 Fix block_class_is_subset linkage 2019-03-17 20:21:03 -07:00
Wunkolo
121b0d96ab Increment extension version 2019-03-17 18:48:06 -07:00
Wunkolo
26bd4d120a Fix implicit declaration 2019-03-17 18:46:45 -07:00
Wunkolo
1271772aa1 Collapse special case logic to block_class_is_subset
Thanks demorgan's law
2019-03-17 18:02:44 -07:00
Wunkolo
5ff6a6400e Convert case switch to block_class_is_subset 2019-03-17 17:57:18 -07:00
Wunkolo
ee9a3411ba block_class_is_subset implementation pass 2019-03-17 17:33:30 -07:00
Wunkolo
2c3d54ea5d Implement block_class header 2019-03-17 15:09:33 -07:00
Wunkolo
eb9d6a98e5 Increment overviewer extension version 2019-03-17 12:05:32 -07: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
Wunkolo
50f12827f5 Block ID enum pass 2019-03-16 22:42:08 -07:00
Wunkolo
4d4df31ece Block ID to mc_id replacement pass 2019-03-16 21:15:08 -07:00
Wunkolo
7e97544f4d First pass mc_id enum implementation 2019-03-16 20:21:44 -07:00
Nicolas F
b70f1a012f Fix C extension build warnings the painful way
Some bad distributions (Debian) apparently are not good enough to
have a Pillow version from this decade packaged.

Therefore, we need to do it the painful way of prefixing our
symbols and refactoring everything to use them.

A new header file called "utils.h" has been added for this purpose,
and it is included in "overviewer.h".

The following macros have been prefixed with "OV_":
- MIN
- MAX
- CLAMP
- BLEND
- MULDIV255

Additionally, the C extension version was bumped to 56 because 55
was reverted back to 54.
2019-02-22 12:53:47 +01:00
Aaron Griffith
fc4a8ec38d Revert "Fix C extension build warnings"
This reverts commit 03a8697866.

Turns out there was a good reason for this: it makes Overviewer work on
Debian. Why? Who knows. It's a mystery.
2019-02-21 17:08:39 -05:00
Nicolas F
03a8697866 Fix C extension build warnings
Today in "why did we ever do this?", we discover we've vendored
code from PIL/Pillow, but PIL/Pillow moved some macro definitions
around, so now our vendored code conflicted with their macros that
they included in the headers we're including.

The solution is to throw out our vendored macros and update the
semantics in our vendored Draw.c. I'm not sure why we vendored it,
but we seemingly did remove some stuff from it to avoid having to
pull in all of PIL/Pillow.
2019-02-21 16:27:55 +01:00
Aaron Griffith
203715d05e do not render internal faces for water
This is closer to the old water rendering method, and better allows
users to see underwater structures.
2018-08-15 17:11:09 -04:00
Nicolas F
cf5a14a088 Increase the Overviewer C extension version 2018-05-09 14:36:11 +02:00
Mitchell Skaggs
717fcdc5fe Add 3 more touch-up points for smooth lighting
Closes #1370
2018-05-09 14:36:11 +02:00
lyknode
d36414b1bf Fix slime algo by using integer for chunk coordinates. 2017-07-16 11:48:52 +02:00
Nicolas F
d76a22e020 Fix deprecated NumPy API warnings 2017-03-09 17:28:18 +01:00
Andrew Chin
884f8548e7 Work on windows build with gitlab CI 2017-02-12 12:47:47 -05:00
Aaron Griffith
1a41d8d195 bump overviewer.h version, textures.py version 2016-06-11 16:38:19 -04:00
Aaron Griffith
1c25b16ec6 fixed typo in biomes.h 2016-06-10 20:15:18 -04:00
Dan Berglund
67a77c7c05 Revert temp & humidity changes and add missing biomes 2016-06-10 14:33:00 -07:00
Dan Berglund
d20c4a37e7 Add new 1.7.2 biomes and update colors
temp/humnidity was calculated so it matched the pixel at the start of each biome
as shown in the color template (http://minecraft.gamepedia.com/File:Biomes1.7.2.png)
TODO: switch to using coordinates in the image instead of temp/humidity
2016-06-10 14:33:00 -07:00
Andrew Chin
81be4bc6e8 Bump mc version in travis and textures.py error msg. also force rebuild 2016-03-01 21:29:51 -05:00
Andrew Chin
bc9a097957 Add some new blocks for Minecraft 1.9
* Purpur blocks, pillars, stairs, and slabs
* End brick
2016-03-01 21:25:15 -05:00
Stefan Floeren
3d3ef0c82e Remove inline for estimate_blocklevel
Inlining the function allows the compiler to optimize away the
function completely. Clang 3.7.1 does exactly that.

This leads to an error, if the library is used with python:

    % ./overviewer.py
    Traceback (most recent call last):
      File "/tmp/minecraft/Minecraft-Overviewer/overviewer_core/__init__.py", line 20, in check_c_overviewer
        import c_overviewer
    ImportError: /tmp/minecraft/Minecraft-Overviewer/overviewer_core/c_overviewer.so: undefined symbol: estimate_blocklevel

    Something has gone wrong importing the c_overviewer extension.  Please
    make sure it is up-to-date (clean and rebuild)
2016-02-13 15:46:04 +01:00
Nicolas F
a8c71d089d Fix mingw-w64 build
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.
2015-08-15 23:50:40 +02:00
Aaron Griffith
9ec0a75eaa fix lighting for flowing water and ice
fix for issue #1205
2015-02-23 10:27:08 -05:00
Aaron Griffith
bad4261cb5 Merge remote-tracking branch 'enaut/structure_overlay' 2015-02-01 12:15:56 -05: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
Ean McLaughlin
8f909f99de Added missing comma in function call for fence gate material definition. 2014-09-03 02:06:51 -06:00
Ean McLaughlin
f5b610e81c Update C extension version number. 2014-09-03 01:50:49 -06:00
Ean McLaughlin
a3b7ac12b8 Added definitions for the new fence gates. Hopefully I got the C side right. Close #1148 2014-09-03 01:36:44 -06:00
Andrew Chin
af47000079 Lighting fixes for red sandstone stairs and slabs
Closes #1150
Closes #1149
2014-09-02 22:23:33 -04:00
Ean McLaughlin
ed09c5c965 Added definitions and support for all the various red sandstone blocks. 2014-09-02 20:55:57 -04:00
Andrew Chin
5d13030834 Bump versions and docs for 1.8 support! 2014-09-02 10:54:13 -04:00
Andrew Chin
e82e7bf0b2 added support for different door types 2014-08-26 15:48:05 -04:00
Andrew Chin
df920e60de Added support for the difference fence colors 2014-08-26 14:17:40 -04:00
Aaron Griffith
2967032ecc added smooth-lighting exception for ice (see issue #1032) 2013-12-01 16:54:01 -05:00
aib
ed75d82588 Fix double trapped chests rendering as two singles 2013-11-17 17:57:56 +02:00
Nicolas Frattaroli
2346c26f37 Added dark wood and acacia wood blocks
Includes stairs, slabs, planks and saplings.
2013-11-02 15:12:44 +01:00
Andrew Chin
9d76e48481 Fix link errors on OSX 10.9? I think?
Fix for #1008
2013-10-31 23:02:18 -04:00
Andrew Chin
97ace8fa67 Bump header version to force rebuild (on account of biome code change) 2013-10-28 22:25:28 -04:00
Andrew Chin
b997c3b1d7 Merge PR #1005 : Add new Biomes, guessing on correct color schemes 2013-10-28 21:21:20 -04:00
Andrew Chin
63311fbd92 Fix missing dark-oak leaves 2013-10-26 14:18:17 -04:00
Andrew Chin
46bda131f9 Add stained glass and stained glass panels
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)
2013-10-26 01:47:07 -04:00