mirror of
https://github.com/luanti-org/luanti.git
synced 2025-06-27 16:36:03 +00:00
Add desynchronize_mapblock_texture_animation setting and improve minetest.conf.example a bit
This commit is contained in:
parent
9e21204f8b
commit
6b598f61a6
3 changed files with 18 additions and 7 deletions
|
@ -28,6 +28,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
|
|||
#include "mesh.h"
|
||||
#include "content_mapblock.h"
|
||||
#include "noise.h"
|
||||
#include "settings.h"
|
||||
|
||||
/*
|
||||
MeshMakeData
|
||||
|
@ -996,10 +997,15 @@ MapBlockMesh::MapBlockMesh(MeshMakeData *data):
|
|||
// Add to MapBlockMesh in order to animate these tiles
|
||||
m_animation_tiles[i] = p.tile;
|
||||
m_animation_frames[i] = 0;
|
||||
// Get starting position from noise
|
||||
m_animation_frame_offsets[i] = 100000 * (2.0 + noise3d(
|
||||
data->m_blockpos.X, data->m_blockpos.Y,
|
||||
data->m_blockpos.Z, 0));
|
||||
if(g_settings->getBool("desynchronize_mapblock_texture_animation")){
|
||||
// Get starting position from noise
|
||||
m_animation_frame_offsets[i] = 100000 * (2.0 + noise3d(
|
||||
data->m_blockpos.X, data->m_blockpos.Y,
|
||||
data->m_blockpos.Z, 0));
|
||||
} else {
|
||||
// Play all synchronized
|
||||
m_animation_frame_offsets[i] = 0;
|
||||
}
|
||||
// Replace tile texture with the first animation frame
|
||||
std::ostringstream os(std::ios::binary);
|
||||
os<<tsrc->getTextureName(p.tile.texture.id);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue