0
Commit Graph

104 Commits

Author SHA1 Message Date
Aaron Griffith
248ea42dd2 Merge branch 'master' into python3-fun-times 2019-06-21 22:08:58 -04:00
Nicolas F
134d6063bf primitives: misc char -> short fixes 2019-04-07 20:25:53 +02:00
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
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
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
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
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
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
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
Aaron Griffith
9ec0a75eaa fix lighting for flowing water and ice
fix for issue #1205
2015-02-23 10:27:08 -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
Andrew Chin
af47000079 Lighting fixes for red sandstone stairs and slabs
Closes #1150
Closes #1149
2014-09-02 22:23:33 -04:00
Aaron Griffith
2967032ecc added smooth-lighting exception for ice (see issue #1032) 2013-12-01 16:54:01 -05: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
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
63e9226415 Merge branch 'snapshot'
Conflicts:
	overviewer_core/src/iterate.c
2013-10-25 23:35:22 -04:00
Andrew Brown
ca63ccb4f5 Merge pull request #1006 from maruohon/blockid-range-fix
Fix transparency check for block IDs > 255
2013-10-14 09:08:19 -07:00
Matti Ruohonen
51e5f3f2b6 Fix transparent check for block ids > 255. (getArrayByte3D -> getArrayShort3D) 2013-10-14 16:48:41 +03:00
Gavin M. Roy
b4be151c80 Add new Biomes, guessing on correct color schemes 2013-10-11 22:34:22 -04:00
Andrew Chin
1a587e783b Merge Pull Request #987 2013-09-17 19:28:37 -04:00
Nicolas Frattaroli
89fc9b01b6 Fixed cave render for solid unknown blocks.
is_transparent returns 1 for every unknown block because that's an easy way to
make them ignore lighting, however, this makes cave render useless with a map
containing unknown ores.

The definition is_known_transparent checks whether a block is transparent and is known.

This is a workaround, a proper fix would be to have unknown blocks be neither transparent nor
solid. Or make them both. But don't prefer one of the two.
2013-09-13 23:54:58 +02:00
Jer Wilson
3050f4099e Adding blocks for new flowers and doublePlants 2013-09-13 14:25:24 -07:00
Andrew Chin
d8a70f2d9a Improve nether rendering with minecraft 1.5
The new nether quartz ore block was not recognized and was causing "pillars"
of netherrock to be rendered (with a quartz ore on top).  the same
seemed to be happened with Lava, so included taht as well
2013-03-15 19:53:01 -04:00
Alejandro Aguilera
4febc51fd8 Merge branch 'snapshot' 2013-03-13 15:53:36 +01:00
Alejandro Aguilera
5bba5dab75 - Fixed lighting for anvils.
- Added vertical orientations for dispensers and droppers
- Added special cases of stone and sandstone double slabs
2013-03-11 14:02:36 +01:00
skeight
f40049a79c 1.5 Pre-Release updates/fixes
Fix for Ender Portal Frame, w/eye of ender, in all orientations
Minor fix for Comparator back torches
Update to lighting on Quartz stairs
Added Quartz Half Slabs
2013-03-08 07:48:25 -08:00
Andrew Chin
2377b3cd52 Fixed nether rendering crash
The nether rendering mode was not properly handling x and z values
outside of the range 0 to 15.  This was causing an out-of-bounds
segfault when accessing the remove_block array.

Fixes #881
Fixes #851
Fixes #852
2013-02-07 19:53:37 -05: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
c5a0687701 Improve default colours for BiomeOverlay 2012-08-23 18:30:57 +01:00
Thomas Lake
9dbc58fccf Add option support to BiomeOverlay()
BiomeOverlay([("Biome", (r,g,b)), ... ])
2012-08-23 08:57:31 +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
Thomas Lake
5e12e93e87 Refactor biome information into biomes.h 2012-08-22 17:49:36 +01:00
Alejandro Aguilera
2685fe3595 Fixed special case for edge line between slabs and stairs. 2012-08-03 19:24:18 +02:00
Andrew Chin
e86084e0ca Merge remote branch 'origin/snapshot' 2012-08-01 09:52:53 -04:00
Andrew Chin
39f96909e9 Fix long int too large issue on windows
Use a long long instead of a long, which is 8-bytes on all platforms

Fixes #757
2012-07-28 22:41:22 -04:00
Alejandro Aguilera
5d32e722ff Add all the new stairs in 1.3. 2012-07-26 17:25:53 +02:00
Richard Pastrick
dc7a32d66d Make the defaults actually work properly. 2012-06-08 14:42:25 -07:00