1
0
Fork 0
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:
grorp 2024-09-16 10:16:27 +02:00 committed by GitHub
parent 4aec4fbe6f
commit 47f199e6cb
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 12 additions and 52 deletions

View file

@ -140,8 +140,10 @@ bool ClientLauncher::run(GameStartData &start_data, const Settings &cmd_args)
// Create the menu clouds
// This is only global so it can be used by RenderingEngine::draw_load_screen().
assert(!g_menucloudsmgr && !g_menuclouds);
std::unique_ptr<IWritableShaderSource> ssrc(createShaderSource());
ssrc->addShaderConstantSetterFactory(new FogShaderConstantSetterFactory());
g_menucloudsmgr = m_rendering_engine->get_scene_manager()->createNewSceneManager();
g_menuclouds = new Clouds(g_menucloudsmgr, nullptr, -1, rand());
g_menuclouds = new Clouds(g_menucloudsmgr, ssrc.get(), -1, rand());
g_menuclouds->setHeight(100.0f);
g_menuclouds->update(v3f(0, 0, 0), video::SColor(255, 240, 240, 255));
scene::ICameraSceneNode* camera;