Add desynchronize_mapblock_texture_animation setting and improve minetest.conf.exampl...
authorPerttu Ahola <celeron55@gmail.com>
Sat, 16 Jun 2012 19:37:20 +0000 (22:37 +0300)
committerPerttu Ahola <celeron55@gmail.com>
Sat, 16 Jun 2012 19:37:20 +0000 (22:37 +0300)
minetest.conf.example
src/defaultsettings.cpp
src/mapblock_mesh.cpp

index ebfa70aacbfc8e3d8692350d94d41855f639b083..ef1b8d2615bf4c66cd98038b208d5f6f3db99f19 100644 (file)
@@ -52,7 +52,8 @@
 # Some (temporary) keys for debugging
 #keymap_print_debug_stacks = KEY_KEY_P
 
-# The desired FPS
+# Minimum FPS
+# The amount of rendered stuff is dynamically set according to this
 #wanted_fps = 30
 # If FPS would go higher than this, limit it by sleeping
 # (to not waste CPU power for no benefit)
 # Sound settings
 #enable_sound = true
 #sound_volume = 0.7
+# Whether node texture animations should be desynchronized per MapBlock
+#desynchronize_mapblock_texture_animation = true
 
 #
 # Server stuff
 #give_initial_stuff = false
 # New users need to input this password
 #default_password = 
-# Available privileges: build, teleport, settime, privs, shout
-#default_privs = build, shout
+# Available privileges: interact, shout, teleport, settime, privs, ...
+# See /privs in game for a full list on your server and mod configuration.
+#default_privs = interact, shout
 # Whether players are shown to clients without any range limit
 #unlimited_player_transfer_distance = true
 # Whether to enable players killing each other
index 13cfab72b8dc1a64b52003978110cb9bc7e690a8..a9c0de6a7d9bd7c6401db4c61520f35b7fe4095b 100644 (file)
@@ -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.
index fd5937bbe36c420da8c0633f9a94728c781c8ae3..a928b82ff764c24c4f3d2ca446affba3d28ac735 100644 (file)
@@ -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);