Hack to allow Capitalism2/CapLab's custom double-buffer system to draw. #91
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Caplab seems to use some non-standard double-buffering system, wherein the dev creates three surfaces, one presentation surface and two working surfaces (call them A and B). The two working surfaces are Attached together, and the game will blit into surface B, then when the frame is done blit A into the presentation surface. It seems that this system relies on some arcane property of Surface Attachments to copy or rotate from B into A, but afaict only the official windows ddraw.dll actually works this way, and this has been a complaint on Wine for years. When debugging the issue, I was able to get the rendering system working by making AddAttachSurface link both surfaces to the same backend buffer, thus """"fixing"""" the bug, but I can't fathom all the potential damage this would cause, so I'm leaving this here with a massive asterisk and a request to maybe find a better way to do this, or at least gate it behind a config option.