Optimise and refactor protocol, better logging, optimise rendering, double buffering.

This commit is contained in:
Niellune
2026-03-23 07:00:36 +02:00
parent b9047f65b8
commit b7e131bc38
41 changed files with 1746 additions and 1748 deletions
+6 -4
View File
@@ -3,12 +3,14 @@
#include <iostream>
#include <fstream>
#include "common/logger.h"
bool Settings::load(const std::string &filename)
{
std::ifstream file(filename);
if (!file.is_open())
{
std::cerr << "[Settings] Cannot open file: " << filename << std::endl;
log_e( "Cannot open file > %s", filename.c_str());
return false;
}
@@ -46,7 +48,7 @@ bool Settings::load(const std::string &filename)
}
}
if (!found)
std::cerr << "[Settings] Unknown key “" << key << "" << std::endl;
log_w("Unknown key > %s", key.c_str());
}
return true;
}
@@ -55,7 +57,7 @@ void Settings::print()
{
for (ISetting *setting : _settings())
{
std::cout << "[Settings] " << setting->name << " = " << setting->asString() << "\n";
log_d("%s = %s",setting->name.c_str(), setting->asString().c_str());
}
}
@@ -73,4 +75,4 @@ void Settings::trim(std::string &s)
{ return !std::isspace(c); })
.base(),
s.end());
}
}