Răsfoiți Sursa

Update texture while UI is locked to avoid concurrent accesses to pixel
data if netpack applier causes redraw

Ivan Savenko 1 an în urmă
părinte
comite
5b0b1ad7f7
1 a modificat fișierele cu 2 adăugiri și 2 ștergeri
  1. 2 2
      client/gui/CGuiHandler.cpp

+ 2 - 2
client/gui/CGuiHandler.cpp

@@ -118,9 +118,9 @@ void CGuiHandler::renderFrame()
 
 
 		if (settings["video"]["showfps"].Bool())
 		if (settings["video"]["showfps"].Bool())
 			drawFPSCounter();
 			drawFPSCounter();
-	}
 
 
-	SDL_UpdateTexture(screenTexture, nullptr, screen->pixels, screen->pitch);
+		SDL_UpdateTexture(screenTexture, nullptr, screen->pixels, screen->pitch);
+	}
 
 
 	SDL_RenderClear(mainRenderer);
 	SDL_RenderClear(mainRenderer);
 	SDL_RenderCopy(mainRenderer, screenTexture, nullptr, nullptr);
 	SDL_RenderCopy(mainRenderer, screenTexture, nullptr, nullptr);