forked from luanti-org/luanti
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
10 changed files
with
115 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,33 @@ | ||
#pragma once | ||
|
||
#include "irrTypes.h" | ||
|
||
#include <bitset> | ||
|
||
struct ClientDynamicInfo | ||
{ | ||
enum InputMethodId | ||
{ | ||
IM_TOUCHSCREEN_CONTROLS = 0, | ||
IM_TOUCHSCREEN_GUI, | ||
IM_KEYBOARD, | ||
IM_MOUSE, | ||
IM_GAMEPAD, | ||
}; | ||
|
||
v2u32 render_target_size; | ||
f32 real_gui_scaling; | ||
f32 real_hud_scaling; | ||
|
||
std::bitset<5> input_methods; | ||
|
||
inline bool hasInputMethod(InputMethodId method) const { | ||
return input_methods.test(method); | ||
} | ||
|
||
bool equal(const ClientDynamicInfo &other) const { | ||
return render_target_size == other.render_target_size && | ||
abs(real_gui_scaling - other.real_gui_scaling) < 0.001f && | ||
abs(real_hud_scaling - other.real_hud_scaling) < 0.001f; | ||
abs(real_hud_scaling - other.real_hud_scaling) < 0.001f && | ||
input_methods == other.input_methods; | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters