[pull] main from libsdl-org:main - #36
Open
pull[bot] wants to merge 608 commits into
Open
Conversation
When we're logically scaling, and preserving the aspect ratio (so are letterboxing or pillarboxing), the scaled mouse coordinates may be outside the application window (backbuffer). These can even be negative, which get underflowed to very large positive values, as SDL 1.2 uses unsigned coordinates here. We were already clamping these values for OpenGL logical scaling, which we do ourselves, but the event filter used with SDL_Renderer doesn't, so we'll manually clamp these all the time.
Reference issue #215.
This makes 1.2 apps compiled with sdl12-compat's headers work with a real SDL 1.2 library on macOS. Otherwise: missing symbol.
Reference Issue #215.
Signed-off-by: Simon McVittie <smcv@debian.org>
1.2 (on many video backends) would allow smaller surfaces that it would center in a larger mode, so emulate that here. Reference Issue #228.
Reference Issue #228.
Reference Issue #230.
It was actually fixed by 4fc061c !
There was no Hint API, so environment variables might change on the fly as apps needed different things. SDL3 (an thus, sdl2-compat) will ignore envvar changes after startup, since it copies the OS environment table to an SDL_Environment, and will miss these later changes. So sdl12-compat will use the "unsafe" (that is: not thread safe) methods to pull in environment variables, ignoring SDL2's SDL_getenv, and will take measures to explicitly set hints that SDL2 and later might need, so they are seen internally despite the state of the SDL3 internal SDL_Environment table. Reference Issue https://github.com/libsdl-org/sdl2-compat/issues/540
…e changes. This is noticable in, for example, Loki's port of Sid Meier's Alpha Centauri, where it wants to show static Loki/Firaxis logos on an 8-bit screen surface, then set the video mode to 16-bit for intro videos through SMPEG, then back to an 8-bit surface for the main menu and gameplay. Before this, windows would be destroyed and immediately pop back up: an unnecessary visual glitch, but also it caused rendering to fail on at least one system. Since software surfaces already go through a conversion to whatever format the SDL2 renderer's texture wants, it was better to avoid all the damage by letting the conversion surface absorb the format change. Fixes #389.
SDL12_compat.c(3030): Warning! W472: col(165) expression with side effect in sizeof discarded
SDL12_compat.c(1171): Warning! W687: col(20) expression for 'while' is always true
Previously it would adjust it without failing if SDL_ANYFORMAT was set, but that was a misunderstanding of what this flag does; it decides if its okay to give you a shadow surface if you have an otherwise-reasonable bpp that the hardware doesn't support. Real SDL1.2 would fail with an error message with bpp=232 and flags=ANYFORMAT, as made clear to us by the tests for a perl SDL1 binding, so while this change makes sdl12-compat less forgiving, it makes it more _correct_ to what real 1.2 would do.
We probably need to add this quirk for Linux and Mac, too, but I need the exe names for those platforms. Reference Issue #395.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
See Commits and Changes for more details.
Created by
pull[bot]
Can you help keep this open source service alive? 💖 Please sponsor : )