Fix risk of bad initial fullscreen mode

This commit is contained in:
Lorenzooone
2024-05-24 22:01:47 +02:00
parent ad56c2814e
commit 573050b312
4 changed files with 15 additions and 6 deletions

View File

@@ -9,6 +9,14 @@
#include <queue>
#include <cmath>
#define xstr(a) str(a)
#define str(a) #a
#define APP_VERSION_MAJOR 0
#define APP_VERSION_MINOR 0
#define APP_VERSION_REVISION 0
#define APP_VERSION_LETTER M
bool is_big_endian(void) {
union {
uint32_t i;
@@ -18,6 +26,10 @@ bool is_big_endian(void) {
return value.c[0] == 1;
}
std::string get_version_string() {
return std::to_string(APP_VERSION_MAJOR) + "." + std::to_string(APP_VERSION_MINOR) + "." + std::to_string(APP_VERSION_REVISION) + xstr(APP_VERSION_LETTER);
}
std::string get_float_str_decimals(float value, int decimals) {
float approx_factor = pow(0.1, decimals) * (0.5);
int int_part = (int)(value + approx_factor);