mirror of
https://github.com/luanti-org/luanti.git
synced 2025-06-27 16:36:03 +00:00
Avoid cloud jump when switching between mainmenu and loading screen (#15163)
... by using the same Clouds object for both. The mainmenu clouds already used shaders before. I had to choose between both or neither, so now both the mainmenu clouds and the loading screen clouds use shaders if available.
This commit is contained in:
parent
4aec4fbe6f
commit
47f199e6cb
5 changed files with 12 additions and 52 deletions
|
@ -28,11 +28,9 @@ with this program; if not, write to the Free Software Foundation, Inc.,
|
|||
#include "settings.h"
|
||||
#include <cmath>
|
||||
|
||||
|
||||
// Menu clouds are created later
|
||||
class Clouds;
|
||||
Clouds *g_menuclouds = NULL;
|
||||
scene::ISceneManager *g_menucloudsmgr = NULL;
|
||||
scene::ISceneManager *g_menucloudsmgr = nullptr;
|
||||
Clouds *g_menuclouds = nullptr;
|
||||
|
||||
// Constant for now
|
||||
static constexpr const float cloud_size = BS * 64.0f;
|
||||
|
@ -49,9 +47,8 @@ Clouds::Clouds(scene::ISceneManager* mgr, IShaderSource *ssrc,
|
|||
scene::ISceneNode(mgr->getRootSceneNode(), mgr, id),
|
||||
m_seed(seed)
|
||||
{
|
||||
assert(ssrc);
|
||||
m_enable_shaders = g_settings->getBool("enable_shaders");
|
||||
// menu clouds use shader-less clouds for simplicity (ssrc == NULL)
|
||||
m_enable_shaders = m_enable_shaders && ssrc;
|
||||
|
||||
m_material.Lighting = false;
|
||||
m_material.BackfaceCulling = true;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue