aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPerttu Ahola <celeron55@gmail.com>2011-10-18 23:55:55 +0300
committerPerttu Ahola <celeron55@gmail.com>2011-10-18 23:55:55 +0300
commitd47120aeb3bf344be3f414a1a3505bd772eebf54 (patch)
tree5c70c232a68d04a7eb236657bad71da706dcd358
parent9b907dd65a2c045d10605894fdaea504200e2be7 (diff)
downloadminetest-d47120aeb3bf344be3f414a1a3505bd772eebf54.tar.gz
minetest-d47120aeb3bf344be3f414a1a3505bd772eebf54.tar.bz2
minetest-d47120aeb3bf344be3f414a1a3505bd772eebf54.zip
Add enable_2d_clouds setting for usage on lower-end machines
-rw-r--r--src/clouds.cpp9
-rw-r--r--src/defaultsettings.cpp1
2 files changed, 8 insertions, 2 deletions
diff --git a/src/clouds.cpp b/src/clouds.cpp
index 8981b42d9..063a4b111 100644
--- a/src/clouds.cpp
+++ b/src/clouds.cpp
@@ -21,8 +21,9 @@ with this program; if not, write to the Free Software Foundation, Inc.,
#include "noise.h"
#include "constants.h"
#include "debug.h"
+#include "main.h" // For g_profiler and g_settings
#include "profiler.h"
-#include "main.h" // For g_profiler
+#include "settings.h"
Clouds::Clouds(
scene::ISceneNode* parent,
@@ -80,6 +81,10 @@ void Clouds::render()
ScopeProfiler sp(g_profiler, "Rendering of clouds, avg", SPT_AVG);
+ int num_faces_to_draw = 6;
+ if(g_settings->getBool("enable_2d_clouds"))
+ num_faces_to_draw = 1;
+
driver->setTransform(video::ETS_WORLD, AbsoluteTransformation);
driver->setMaterial(m_material);
@@ -148,7 +153,7 @@ void Clouds::render()
f32 ry = 8*BS;
f32 rz = cloud_size;
- for(int i=0;i<6;i++)
+ for(int i=0; i<num_faces_to_draw; i++)
{
switch(i)
{
diff --git a/src/defaultsettings.cpp b/src/defaultsettings.cpp
index d88440812..8429ff22c 100644
--- a/src/defaultsettings.cpp
+++ b/src/defaultsettings.cpp
@@ -77,6 +77,7 @@ void set_default_settings(Settings *settings)
settings->setDefault("invisible_stone", "false");
settings->setDefault("screenshot_path", ".");
settings->setDefault("view_bobbing_amount", "1.0");
+ settings->setDefault("enable_2d_clouds", "false");
// Server stuff
// "map-dir" doesn't exist by default.