1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-06-27 16:36:03 +00:00

Add support for dpi based HUD scaling

Add support for (configurable) multiline hotbar
Improved screensize handling
Add userdefined gui scale by BlockMen
This commit is contained in:
sapier 2014-04-05 14:12:36 +02:00
parent 8d31534710
commit 1838a3fd69
13 changed files with 266 additions and 151 deletions

View file

@ -249,7 +249,7 @@ void Camera::step(f32 dtime)
}
void Camera::update(LocalPlayer* player, f32 frametime, f32 busytime,
v2u32 screensize, f32 tool_reload_ratio,
f32 tool_reload_ratio,
int current_camera_mode, ClientEnvironment &c_env)
{
// Get player position
@ -422,7 +422,7 @@ void Camera::update(LocalPlayer* player, f32 frametime, f32 busytime,
fov_degrees = MYMIN(fov_degrees, 170.0);
// FOV and aspect ratio
m_aspect = (f32)screensize.X / (f32) screensize.Y;
m_aspect = (f32) porting::getWindowSize().X / (f32) porting::getWindowSize().Y;
m_fov_y = fov_degrees * M_PI / 180.0;
// Increase vertical FOV on lower aspect ratios (<16:10)
m_fov_y *= MYMAX(1.0, MYMIN(1.4, sqrt(16./10. / m_aspect)));