1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-02-03 13:01:33 +02:00

Relax UI locking to reduce delays in AI actions

This commit is contained in:
Ivan Savenko 2023-11-18 19:41:00 +02:00
parent c0e54b338a
commit a3f9450d83

View File

@ -114,16 +114,20 @@ void CGuiHandler::renderFrame()
{
boost::mutex::scoped_lock interfaceLock(GH.interfaceMutex);
if(nullptr != curInt)
if (nullptr != curInt)
curInt->update();
if(settings["video"]["showfps"].Bool())
if (settings["video"]["showfps"].Bool())
drawFPSCounter();
}
SDL_UpdateTexture(screenTexture, nullptr, screen->pixels, screen->pitch);
SDL_UpdateTexture(screenTexture, nullptr, screen->pixels, screen->pitch);
SDL_RenderClear(mainRenderer);
SDL_RenderCopy(mainRenderer, screenTexture, nullptr, nullptr);
SDL_RenderClear(mainRenderer);
SDL_RenderCopy(mainRenderer, screenTexture, nullptr, nullptr);
{
boost::mutex::scoped_lock interfaceLock(GH.interfaceMutex);
CCS->curh->render();