Closed sulix closed 1 year ago
I should be able to give a try to this patch soon, I will share my feedback as soon as it’s done.
I tested both current master: I get the artifacts reported in #279; and this patch: I do not get any artifact.
So it seems good to me, it does get rid of the screen artifacts on my setup.
Currently, if there are multiple SDL_DisplayYUVOverlay() calls in a row, we force an SDL_Flip() between them, in order to make sure that the screen is updated. However, this results in the non-YUV video surface also being updated, even if it otherwise wouldn't be.
Instead, copy the code from all of the other places where we force an update of the screen, which checks if the surface is dirty, and if not calls PresentScreen() directly without updating the VideoSurface. (After checking we're in the correct thread, of course...)
Note that it's probably worth pulling the "force screen update" code out into a separate helper function, rather than copying it everywhere.
This hopefully fixes video artefacts in Alpha Centauri (bug #279)