aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPerttu Ahola <celeron55@gmail.com>2012-06-16 22:37:20 +0300
committerPerttu Ahola <celeron55@gmail.com>2012-06-16 22:37:20 +0300
commit6b598f61a6920823aad7c8814bad8e68f85ad66b (patch)
tree17f0866c7733d1f540f073db9f711071a2c4b5cb /src
parent9e21204f8b25025fc0f0057cb68d8b2b2b13c71a (diff)
downloadminetest-6b598f61a6920823aad7c8814bad8e68f85ad66b.tar.gz
minetest-6b598f61a6920823aad7c8814bad8e68f85ad66b.tar.bz2
minetest-6b598f61a6920823aad7c8814bad8e68f85ad66b.zip
Add desynchronize_mapblock_texture_animation setting and improve minetest.conf.example a bit
Diffstat (limited to 'src')
-rw-r--r--src/defaultsettings.cpp1
-rw-r--r--src/mapblock_mesh.cpp14
2 files changed, 11 insertions, 4 deletions
diff --git a/src/defaultsettings.cpp b/src/defaultsettings.cpp
index 13cfab72b..a9c0de6a7 100644
--- a/src/defaultsettings.cpp
+++ b/src/defaultsettings.cpp
@@ -103,6 +103,7 @@ void set_default_settings(Settings *settings)
settings->setDefault("console_alpha", "200");
settings->setDefault("enable_sound", "true");
settings->setDefault("sound_volume", "0.8");
+ settings->setDefault("desynchronize_mapblock_texture_animation", "true");
// Server stuff
// "map-dir" doesn't exist by default.
diff --git a/src/mapblock_mesh.cpp b/src/mapblock_mesh.cpp
index fd5937bbe..a928b82ff 100644
--- a/src/mapblock_mesh.cpp
+++ b/src/mapblock_mesh.cpp
@@ -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);