2024-10-28 15:57:39 +01:00
|
|
|
// Luanti
|
|
|
|
// SPDX-License-Identifier: LGPL-2.1-or-later
|
|
|
|
// Copyright (C) 2022-3 rubenwardy <rw@rubenwardy.com>
|
2023-02-27 23:58:41 +01:00
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
2023-07-07 21:42:43 +02:00
|
|
|
#include "irrlichttypes_bloated.h"
|
2024-10-15 15:47:23 +02:00
|
|
|
#include "config.h"
|
2023-02-27 23:58:41 +01:00
|
|
|
|
|
|
|
|
|
|
|
struct ClientDynamicInfo
|
|
|
|
{
|
2023-07-07 21:42:43 +02:00
|
|
|
public:
|
2023-02-27 23:58:41 +01:00
|
|
|
v2u32 render_target_size;
|
|
|
|
f32 real_gui_scaling;
|
|
|
|
f32 real_hud_scaling;
|
|
|
|
v2f32 max_fs_size;
|
2023-12-17 20:47:07 +01:00
|
|
|
bool touch_controls;
|
2023-02-27 23:58:41 +01:00
|
|
|
|
|
|
|
bool equal(const ClientDynamicInfo &other) const {
|
|
|
|
return render_target_size == other.render_target_size &&
|
2024-02-26 21:54:48 +01:00
|
|
|
std::abs(real_gui_scaling - other.real_gui_scaling) < 0.001f &&
|
|
|
|
std::abs(real_hud_scaling - other.real_hud_scaling) < 0.001f &&
|
2023-12-17 20:47:07 +01:00
|
|
|
touch_controls == other.touch_controls;
|
2023-02-27 23:58:41 +01:00
|
|
|
}
|
|
|
|
|
2024-10-15 15:47:23 +02:00
|
|
|
#if CHECK_CLIENT_BUILD()
|
2024-03-17 14:59:50 +01:00
|
|
|
static ClientDynamicInfo getCurrent();
|
2023-07-07 21:42:43 +02:00
|
|
|
|
|
|
|
private:
|
2024-09-06 12:11:03 +02:00
|
|
|
static v2f32 calculateMaxFSSize(v2u32 render_target_size, f32 density, f32 gui_scaling);
|
2023-07-07 21:42:43 +02:00
|
|
|
#endif
|
2023-02-27 23:58:41 +01:00
|
|
|
};
|