resolt bug en jail_audio

treballant en Screen::renderInfo() deixa el programa congelat
This commit is contained in:
2025-03-28 17:23:08 +01:00
parent 25cd6b00eb
commit 1db80485a6
4 changed files with 49 additions and 18 deletions

View File

@@ -214,23 +214,21 @@ void Screen::renderShake()
SDL_SetRenderTarget(renderer_, current_target);
}
}
#ifdef DEBUG
// Muestra información por pantalla
void Screen::renderInfo()
{
if (show_debug_info_ && Resource::get())
if (debug_info_.show)
{
auto text = Resource::get()->getText("smb2");
// FPS
const std::string FPS_TEXT = std::to_string(fps_.lastValue) + " FPS";
text->writeColored(param.game.width - text->lenght(FPS_TEXT), 0, FPS_TEXT, ORANGE_SOFT_COLOR);
debug_info_.text->writeColored(param.game.width - debug_info_.text->lenght(FPS_TEXT), 0, FPS_TEXT, ORANGE_SOFT_COLOR);
// Resolution
text->writeColored(0, 0, options.video.info, ORANGE_SOFT_COLOR);
debug_info_.text->writeColored(0, 0, options.video.info, ORANGE_SOFT_COLOR);
}
}
#endif
// Carga el contenido del archivo GLSL
void Screen::loadShaders()
{
@@ -285,8 +283,10 @@ void Screen::renderOverlays()
renderFlash();
renderAttenuate();
OnScreenHelp::get()->render();
renderInfo();
Notifier::get()->render();
#ifdef DEBUG
renderInfo();
#endif
}
// Atenua la pantalla