diff options
author | Vitaliy <silverunicorn2011@yandex.ru> | 2017-10-15 10:34:14 +0300 |
---|---|---|
committer | Loïc Blot <nerzhul@users.noreply.github.com> | 2017-10-15 09:34:14 +0200 |
commit | 75320e7e88ab5088a46c9e42c1e789cbdacb13b0 (patch) | |
tree | da71a3134f8b42bdabf25ef1df14c5e1a77a439e /src/content_mapblock.cpp | |
parent | 6bab695479d42ac2b051b8a35639c32b22efbf8d (diff) | |
download | dragonfireclient-75320e7e88ab5088a46c9e42c1e789cbdacb13b0.tar.xz |
Real global textures (#6105)
* Real global textures
* Add world-aligned textures
* Update minimal to support world-aligned tiles
* Update minimal
Diffstat (limited to 'src/content_mapblock.cpp')
-rw-r--r-- | src/content_mapblock.cpp | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/src/content_mapblock.cpp b/src/content_mapblock.cpp index 4e32e27ca..c2a25037c 100644 --- a/src/content_mapblock.cpp +++ b/src/content_mapblock.cpp @@ -77,7 +77,7 @@ void MapblockMeshGenerator::useTile(int index, u8 set_flags, u8 reset_flags, boo if (special) getSpecialTile(index, &tile, p == data->m_crack_pos_relative); else - getNodeTileN(n, p, index, data, tile); + getTile(index, &tile); if (!data->m_smooth_lighting) color = encode_light(light, f->light_source); @@ -87,14 +87,19 @@ void MapblockMeshGenerator::useTile(int index, u8 set_flags, u8 reset_flags, boo } } +// Returns a tile, ready for use, non-rotated. +void MapblockMeshGenerator::getTile(int index, TileSpec *tile) +{ + getNodeTileN(n, p, index, data, *tile); +} + +// Returns a tile, ready for use, rotated according to the node facedir. void MapblockMeshGenerator::getTile(v3s16 direction, TileSpec *tile) { getNodeTile(n, p, direction, data, *tile); } -/*! - * Returns the i-th special tile for a map node. - */ +// Returns a special tile, ready for use, non-rotated. void MapblockMeshGenerator::getSpecialTile(int index, TileSpec *tile, bool apply_crack) { *tile = f->special_tiles[index]; @@ -1256,10 +1261,8 @@ void MapblockMeshGenerator::drawMeshNode() // Convert wallmounted to 6dfacedir. // When cache enabled, it is already converted. facedir = n.getWallMounted(nodedef); - if (!enable_mesh_cache) { - static const u8 wm_to_6d[6] = {20, 0, 16 + 1, 12 + 3, 8, 4 + 2}; - facedir = wm_to_6d[facedir]; - } + if (!enable_mesh_cache) + facedir = wallmounted_to_facedir[facedir]; } if (!data->m_smooth_lighting && f->mesh_ptr[facedir]) { |