-
Notifications
You must be signed in to change notification settings - Fork 40
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Alpha Centauri - Artifacts around video playback #279
Comments
More details on the Alpha Centauri build used to trigger this bug is shared in another issue: #277 (comment) |
I can't reproduce this (at least with the opening video) with my copy of SMAC here. That's the full Loki version (with the 6.0a patch applied), not the ./play.it modified version, with some version of my wrapper library, which looks pretty similar to the one you mentioned in another of these threads. |
My bad, I forgot to add this precision: this does not happen with the opening video, only during gameplay when a secret project video is played. I updated the issue description to avoid the confusion. To spawn such a video quickly, I start a game and play a couple turns with everything automated, then start the building of a secret project as soon as one is available. I could share a saved game one turn before the completion of such a project for easier reproducing. |
The ./play.it version uses the assets from GOG Windows build + a copy of Loki binaries updated to 6.0b (I don’t remember the origin of the patch, the file is named |
Please do! |
The attached saved game is one turn before the completion of a secret project. Ending the turn triggers the video playback: secret-project-video.sav.gz The file needs to be ungzipped, then copied into |
I can reproduce this with the savegame, but only under Wayland. The corruption forms a nice border around the final text part of the video: the rest of it renders properly. Interestingly, this text screen doesn't appear to be a part of the actual video file (at last according to mplayer). It seems to me like the cause is the (I also wondered if this could be a threading issue itself — |
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...) This hopefully fixes video artefacts in Alpha Centauri (bug libsdl-org#279)
My tests have all been with X.org, I am not using Wayland on this computer.
I can confirm that it is not included in the video file itself, but added by the game engine from a text file. |
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...) This hopefully fixes video artefacts in Alpha Centauri (bug #279)
Closing this because @sulix's pull request solved the problem! |
Alpha Centauri used to be provided with a native engine developed by Loki, that can still be used with ./play.it (using the game build sold on GOG as a basis): https://www.dotslashplay.it/en/games/alpha-centauri
Video of secret projects are surrounded by some artifacts, see the following screenshot:
With the real SDL 1.2 library, the parts of the screen surrounding the video playback are regular black bars, with no visible artifact.
The opening video (played when launching the game) is not affected.
The attached saved game is one turn before the completion of a secret project. Ending the turn triggers the video playback: secret-project-video.sav.gz
The file needs to be ungzipped, then copied into
~/.loki/smac/saves/
.Since this would require access to a commercial game for investigating the issue, I would be OK to buy a gift code to someone willing to work on this issue but does not own a copy of the game yet.
I am of course willing to provide more information, but since I’m quite new to anything related to SDL I would need step-by-step instructions on how to debug the issue.
The text was updated successfully, but these errors were encountered: