mirror of
https://github.com/minetest/minetest.git
synced 2024-12-25 15:42:24 +01:00
Fix rendertarget size being saved as screensize (#13313)
This commit is contained in:
parent
3e148e2810
commit
02346819f9
@ -1192,8 +1192,8 @@ void Game::run()
|
|||||||
&& client->checkPrivilege("fast");
|
&& client->checkPrivilege("fast");
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
v2u32 previous_screen_size(g_settings->getU16("screen_w"),
|
core::dimension2du previous_screen_size(g_settings->getU16("screen_w"),
|
||||||
g_settings->getU16("screen_h"));
|
g_settings->getU16("screen_h"));
|
||||||
|
|
||||||
while (m_rendering_engine->run()
|
while (m_rendering_engine->run()
|
||||||
&& !(*kill || g_gamecallback->shutdown_requested
|
&& !(*kill || g_gamecallback->shutdown_requested
|
||||||
@ -1217,16 +1217,17 @@ void Game::run()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const auto ¤t_screen_size = current_dynamic_info.render_target_size;
|
const core::dimension2du ¤t_screen_size =
|
||||||
|
RenderingEngine::get_video_driver()->getScreenSize();
|
||||||
|
|
||||||
// Verify if window size has changed and save it if it's the case
|
// Verify if window size has changed and save it if it's the case
|
||||||
// Ensure evaluating settings->getBool after verifying screensize
|
// Ensure evaluating settings->getBool after verifying screensize
|
||||||
// First condition is cheaper
|
// First condition is cheaper
|
||||||
if (previous_screen_size != current_screen_size &&
|
if (previous_screen_size != current_screen_size &&
|
||||||
current_screen_size != irr::core::dimension2d<u32>(0,0) &&
|
current_screen_size != core::dimension2du(0, 0) &&
|
||||||
g_settings->getBool("autosave_screensize")) {
|
g_settings->getBool("autosave_screensize")) {
|
||||||
g_settings->setU16("screen_w", current_screen_size.X);
|
g_settings->setU16("screen_w", current_screen_size.Width);
|
||||||
g_settings->setU16("screen_h", current_screen_size.Y);
|
g_settings->setU16("screen_h", current_screen_size.Height);
|
||||||
previous_screen_size = current_screen_size;
|
previous_screen_size = current_screen_size;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user