aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Deutsch <ben@bendeutsch.de>2017-08-04 05:58:10 +0200
committerrubenwardy <rubenwardy@gmail.com>2017-08-12 19:37:53 +0100
commit9ef9c72e5ac71e0877bad9552f18bd0e9e3885ea (patch)
tree1af87ef4bc291979dc237a10c5790735c9429fa1
parent7e23532bc2982fe8c3b23eb8f3b536184b43021f (diff)
downloadminetest-9ef9c72e5ac71e0877bad9552f18bd0e9e3885ea.tar.gz
minetest-9ef9c72e5ac71e0877bad9552f18bd0e9e3885ea.tar.bz2
minetest-9ef9c72e5ac71e0877bad9552f18bd0e9e3885ea.zip
Remove cloud_height setting
With the cloud API, the cloud_height setting has become obsolete and replaceable by a mod. It, and supporting code, can be removed.
-rw-r--r--builtin/settingtypes.txt3
-rw-r--r--minetest.conf.example4
-rw-r--r--src/client/clientlauncher.cpp3
-rw-r--r--src/clouds.cpp8
-rw-r--r--src/clouds.h4
-rw-r--r--src/defaultsettings.cpp1
-rw-r--r--src/guiEngine.cpp3
7 files changed, 7 insertions, 19 deletions
diff --git a/builtin/settingtypes.txt b/builtin/settingtypes.txt
index 93520aa5e..bb1eb75ef 100644
--- a/builtin/settingtypes.txt
+++ b/builtin/settingtypes.txt
@@ -610,9 +610,6 @@ texture_path (Texture path) path
# The rendering back-end for Irrlicht.
video_driver (Video driver) enum opengl null,software,burningsvideo,direct3d8,direct3d9,opengl
-# Height on which clouds are appearing.
-cloud_height (Cloud height) int 120
-
# Radius of cloud area stated in number of 64 node cloud squares.
# Values larger than 26 will start to produce sharp cutoffs at cloud area corners.
cloud_radius (Cloud radius) int 12
diff --git a/minetest.conf.example b/minetest.conf.example
index cca40cdf1..8128c9b82 100644
--- a/minetest.conf.example
+++ b/minetest.conf.example
@@ -690,10 +690,6 @@
# type: enum values: null, software, burningsvideo, direct3d8, direct3d9, opengl
# video_driver = opengl
-# Height on which clouds are appearing.
-# type: int
-# cloud_height = 120
-
# Radius of cloud area stated in number of 64 node cloud squares.
# Values larger than 26 will start to produce sharp cutoffs at cloud area corners.
# type: int
diff --git a/src/client/clientlauncher.cpp b/src/client/clientlauncher.cpp
index 66e3f9a72..a5c1784aa 100644
--- a/src/client/clientlauncher.cpp
+++ b/src/client/clientlauncher.cpp
@@ -128,7 +128,8 @@ bool ClientLauncher::run(GameParams &game_params, const Settings &cmd_args)
if (!g_menucloudsmgr)
g_menucloudsmgr = RenderingEngine::get_scene_manager()->createNewSceneManager();
if (!g_menuclouds)
- g_menuclouds = new Clouds(g_menucloudsmgr, -1, rand(), 100);
+ g_menuclouds = new Clouds(g_menucloudsmgr, -1, rand());
+ g_menuclouds->setHeight(100.0f);
g_menuclouds->update(v3f(0, 0, 0), video::SColor(255, 200, 200, 255));
scene::ICameraSceneNode* camera;
camera = g_menucloudsmgr->addCameraSceneNode(0,
diff --git a/src/clouds.cpp b/src/clouds.cpp
index eeac774a9..a8c27f42a 100644
--- a/src/clouds.cpp
+++ b/src/clouds.cpp
@@ -37,14 +37,12 @@ static constexpr const float cloud_size = BS * 64.0f;
static void cloud_3d_setting_changed(const std::string &settingname, void *data)
{
- // TODO: only re-read cloud settings, not height or radius
((Clouds *)data)->readSettings();
}
Clouds::Clouds(scene::ISceneManager* mgr,
s32 id,
- u32 seed,
- s16 cloudheight
+ u32 seed
):
scene::ISceneNode(mgr->getRootSceneNode(), mgr, id),
m_seed(seed)
@@ -58,13 +56,13 @@ Clouds::Clouds(scene::ISceneManager* mgr,
//m_material.MaterialType = video::EMT_TRANSPARENT_VERTEX_ALPHA;
m_material.MaterialType = video::EMT_TRANSPARENT_ALPHA_CHANNEL;
+ m_params.height = 120;
m_params.density = 0.4f;
m_params.thickness = 16.0f;
m_params.color_bright = video::SColor(229, 240, 240, 255);
m_params.color_ambient = video::SColor(255, 0, 0, 0);
m_params.speed = v2f(0.0f, -2.0f);
- m_passed_cloud_y = cloudheight;
readSettings();
g_settings->registerChangedCallback("enable_3d_clouds",
&cloud_3d_setting_changed, this);
@@ -370,8 +368,6 @@ void Clouds::update(const v3f &camera_p, const video::SColorf &color_diffuse)
void Clouds::readSettings()
{
- m_params.height = (m_passed_cloud_y ? m_passed_cloud_y :
- g_settings->getS16("cloud_height"));
m_cloud_radius_i = g_settings->getU16("cloud_radius");
m_enable_3d = g_settings->getBool("enable_3d_clouds");
}
diff --git a/src/clouds.h b/src/clouds.h
index 66bd9269c..b8d292c3b 100644
--- a/src/clouds.h
+++ b/src/clouds.h
@@ -38,8 +38,7 @@ class Clouds : public scene::ISceneNode
public:
Clouds(scene::ISceneManager* mgr,
s32 id,
- u32 seed,
- s16 cloudheight=0
+ u32 seed
);
~Clouds();
@@ -133,7 +132,6 @@ private:
video::SMaterial m_material;
aabb3f m_box;
- s16 m_passed_cloud_y;
u16 m_cloud_radius_i;
bool m_enable_3d;
u32 m_seed;
diff --git a/src/defaultsettings.cpp b/src/defaultsettings.cpp
index 797beb3d7..e5b2c8da4 100644
--- a/src/defaultsettings.cpp
+++ b/src/defaultsettings.cpp
@@ -179,7 +179,6 @@ void set_default_settings(Settings *settings)
settings->setDefault("view_bobbing_amount", "1.0");
settings->setDefault("fall_bobbing_amount", "0.0");
settings->setDefault("enable_3d_clouds", "true");
- settings->setDefault("cloud_height", "120");
settings->setDefault("cloud_radius", "12");
settings->setDefault("menu_clouds", "true");
settings->setDefault("opaque_water", "false");
diff --git a/src/guiEngine.cpp b/src/guiEngine.cpp
index 65ef1605a..d8d8d3b11 100644
--- a/src/guiEngine.cpp
+++ b/src/guiEngine.cpp
@@ -313,7 +313,8 @@ GUIEngine::~GUIEngine()
/******************************************************************************/
void GUIEngine::cloudInit()
{
- m_cloud.clouds = new Clouds(m_smgr, -1, rand(), 100);
+ m_cloud.clouds = new Clouds(m_smgr, -1, rand());
+ m_cloud.clouds->setHeight(100.0f);
m_cloud.clouds->update(v3f(0, 0, 0), video::SColor(255,200,200,255));
m_cloud.camera = m_smgr->addCameraSceneNode(0,