aboutsummaryrefslogtreecommitdiff
path: root/src/mapblock_mesh.cpp
diff options
context:
space:
mode:
authorCraig Robbins <kde.psych@gmail.com>2015-02-11 17:45:49 +1000
committerCraig Robbins <kde.psych@gmail.com>2015-02-11 17:45:49 +1000
commitc8f60bd224bf910d7521669ff4f90c372b289c3e (patch)
tree9b4afbaac6e71c7ab257fe86b989fd570cfee51d /src/mapblock_mesh.cpp
parent98b37e3e0d4d0bcea4d0a202f8519a39163b7493 (diff)
downloadminetest-c8f60bd224bf910d7521669ff4f90c372b289c3e.tar.gz
minetest-c8f60bd224bf910d7521669ff4f90c372b289c3e.tar.bz2
minetest-c8f60bd224bf910d7521669ff4f90c372b289c3e.zip
Remove workaround in itemdef.cpp to enable/disable/enable "enable_shaders" setting
* Increase performance (client) * Avoid changing a global value to solve a local problem
Diffstat (limited to 'src/mapblock_mesh.cpp')
-rw-r--r--src/mapblock_mesh.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/mapblock_mesh.cpp b/src/mapblock_mesh.cpp
index cf311acba..b3a1a73d7 100644
--- a/src/mapblock_mesh.cpp
+++ b/src/mapblock_mesh.cpp
@@ -42,7 +42,7 @@ static void applyFacesShading(video::SColor& color, float factor)
MeshMakeData
*/
-MeshMakeData::MeshMakeData(IGameDef *gamedef):
+MeshMakeData::MeshMakeData(IGameDef *gamedef, bool use_shaders):
m_vmanip(),
m_blockpos(-1337,-1337,-1337),
m_crack_pos_relative(-1337, -1337, -1337),
@@ -50,7 +50,8 @@ MeshMakeData::MeshMakeData(IGameDef *gamedef):
m_smooth_lighting(false),
m_show_hud(false),
m_highlight_mesh_color(255, 255, 255, 255),
- m_gamedef(gamedef)
+ m_gamedef(gamedef),
+ m_use_shaders(use_shaders)
{}
void MeshMakeData::fill(MapBlock *block)
@@ -1028,7 +1029,7 @@ MapBlockMesh::MapBlockMesh(MeshMakeData *data, v3s16 camera_offset):
m_last_daynight_ratio((u32) -1),
m_daynight_diffs()
{
- m_enable_shaders = g_settings->getBool("enable_shaders");
+ m_enable_shaders = data->m_use_shaders;
m_enable_highlighting = g_settings->getBool("enable_node_highlighting");
// 4-21ms for MAP_BLOCKSIZE=16 (NOTE: probably outdated)