This commit is contained in:
2026-04-04 23:03:34 +02:00
parent a4ee304a79
commit 63424429ca
10 changed files with 407 additions and 160 deletions

View File

@@ -183,6 +183,10 @@ namespace Overlay {
render_info_text_ = text;
}
auto isEscConsumed() -> bool {
return esc_waiting_;
}
auto handleEscape() -> bool {
if (!esc_waiting_) {
// Primera pulsació: mostra avís i consumeix

View File

@@ -19,4 +19,6 @@ namespace Overlay {
// Gestió d'eixida amb doble ESC
// Retorna true si l'ESC ha sigut consumit (no s'ha de passar al joc)
auto handleEscape() -> bool;
// True mentre s'espera la segona pulsació d'ESC
auto isEscConsumed() -> bool;
} // namespace Overlay

View File

@@ -304,6 +304,7 @@ auto Screen::getActiveShaderName() const -> const char* {
}
void Screen::updateRenderInfo() {
static const Uint32 start_ticks = SDL_GetTicks();
std::string driver = gpu_driver_.empty() ? "sdl" : toLower(gpu_driver_);
std::string info = std::to_string(fps_.last_value) + " fps - " + driver;
@@ -314,6 +315,15 @@ void Screen::updateRenderInfo() {
if (Options::video.supersampling) info += " (ss)";
}
// Temps de joc: m:ss.cc
Uint32 elapsed = SDL_GetTicks() - start_ticks;
int minutes = elapsed / 60000;
int seconds = (elapsed / 1000) % 60;
int centis = (elapsed / 10) % 100;
char time_buf[32];
snprintf(time_buf, sizeof(time_buf), " - %d:%02d.%02d", minutes, seconds, centis);
info += time_buf;
Overlay::setRenderInfoText(info.c_str());
}