-
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
FIXME cleanup #143
Comments
Putting this in the 1.2.50 milestone, but once we've made a pass over all the FIXMEs (many of them extremely aggressive wishlist stuff that may never get changed), we should close this bug, even if most of the FIXMEs remain. |
PR #145 is in. Anything left? |
There are still a whole bunch of FIXMEs left. I don't think we need to get all of them, but PR #145 only covered the few easy ones I got to over the weekend. Here are my notes on the others. I don't expect to have time to get to these soon, and I think many of them we probably can ignore for now. Any thoughts? Feature Requests:
FIXME("Does this need to call Init12Video?");
FIXME("In 1.2, this only fails (-1) if you haven't SDL_Init()'d.");
Keyboard mapping gaps:
FIXME("we should probably drop a lot of these events.");
FIXME("bgr instead of rgb?");
FIXME("Should we force a compatibility context here?");
FIXME("setup screen saver");
FIXME("don't do anything if the window's dimensions, etc haven't changed.");
Dest Alpha Stuff:
FIXME("is it legal to display multiple yuv overlays?");
FIXME("Support non-default delay and interval for Key Repeat");
FIXME("wrap surface");
Bunch of CDDA issues:
FIXME("Respect 1.2 environment variables for defining format here.");
Misc OpenAudio() FIXMEs:
|
And 4601def added two new FIXMEs. Heh he :) |
There is also an |
IIRC, there was a Loki game (I forget which), which uses X11_KeyToUnicode, which was an internal function in the X11 backend. At the time, it was non-trivial to mark non-static symbols in shared libraries as private, so Loki used one of them they shouldn't have. |
...I want to say it was Heavy Gear II, but I could be wrong. |
Actually, it appears to be the Torque Engine having this issue in more modern times (although perhaps they inherited this from Tribes 2?)...this means Space Pirates and Zombies, on Steam, will need this symbol exported, if nothing else. We should open a bug for this. |
So the primary reason for the parachute was to reset the video mode if an app crashes, so you didn't end up with a 320x200 desktop or whatever on X11...but this is not an issue with FULLSCREEN_DESKTOP, so the only case where we could hit this now is if the user has forced off OpenGL Scaling in a GL app. (Actually, this might have been an XVidMode issue we don't get with XRandR...?) |
It's I don't think these are super-important, as only an end-user would set them, and it's not something you hear a lot about in real life. |
Turns out SDL2 already checks the same environment variable (as an SDL2 hint, specifically), so we don't have to manage this in sdl12-compat. Reference issue #143.
Just stealing @sulix's comment to turn it into a checklist... Feature Requests:
Keyboard mapping gaps:We probably should look into fixing these, but I think some of them are nastily platform×layout specific, so probably need people with the appropriate setups to find the mappings and test.
Various video stuff
Dest Alpha Stuff:A bunch of FIXMEs here
CDDA issues:I think these are nominally still tracked in #32 There seems to be a bit of work still here to make this robust, but it's a relatively rarely used feature which needs to be manually enabled by the user.
Misc OpenAudio() FIXMEs:Largely related to the cdrom stuff above
|
I was wondering if it would have been better for modern GPUs to use BGR color order instead of RGB. This was true in the early 2000's, but it honestly probably doesn't matter in modern times, especially for this particular workload. We should probably just remove these and not think more about it. |
Presumably we're going to get the system default, which is _probably_ the compatibility profile anyhow, and likely SDL 1.2 would have shook out the same way. We can revisit if bug reports suggest otherwise later, though. Reference Issue #143.
Not sure _what_ this meant, but it was likely saying at one point that we need to convert the 1.2 surface to be 2.0 compatible...but we obviously do that now. It might have just been a note to myself to finish implementing this thing, and I forgot to remove the FIXME after? I'm not sure. Reference Issue #143.
I'm inclined to say the rest of these shouldn't be changed for 1.2.50, as a lot are wishlist stuff and corner cases, and it's not worth destabilizing things just for the sake of removing them. |
I'm putting this in the 1.2.54 milestone, but let's all agree that some of these should be fixed for completeness's sake and some we should just agree will probably live as FIXMEs forever. |
This was wondering if using BGR pixel layout would be more correct/efficient, but honestly it's not hurting anything as it is now, so I'm just deleting the FIXMEs. Reference Issue #143.
If anyone is bored and wants to run with it, there's an extremely basic patch and test case sitting in #192 now. |
@slouken SDL_INIT_PARACHUTE was in 1.2 mostly to reset the video mode in case of a segfault, right? Now that we're free of XVidMode, we probably don't need this on modern systems (and SDL2 doesn't offer this at all anyhow). Do you agree, or was there some case where this was still important? Trying to decide if I should wire up a signal handler in sdl12-compat or just remove the FIXME. |
Yep, we might still need it for KMSDRM, but otherwise we shouldn't need it anymore. |
It's risky to find out we broke something this way when nothing is actually having a problem at the moment, we'd have to juggle the state between what SDL 1.2 is pretending for the app and what SDL2 actually used, and we're not talking about _that_ large a resource savings anyhow. Reference Issue #143.
Before we save the original alpha values of the whole surface, now only save off the rectangle being blitted. Reference Issue #143.
What alpha format would we have that isn't 2 or 4 bytes...? Reference Issue #143.
I don't know if this was ever used in the wild, or if this would have caused problems with actual hardware, but most (or all) of the platform APIs that 1.2 uses ostensibly supported it. Reference Issue #143.
This is how classic SDL 1.2 behaves, too. Reference Issue #143.
Okay, I implemented logical scaling for windowed modes in bf38589. Here's my 4K monitor on x11 with testsprite at normal size, at 1.5x, and 2.0x. Or, if you prefer OpenGL apps, here's UT2004: This will refuse to scale for resizable windows (under the assumption that they know how to handle arbitrary sizes already). I mention this here instead of quietly clicking the checkbox because this feels like it might have corner cases I haven't considered. @sulix, any opinions on this one (including "this is a terrible idea, back this change out")? |
Neat! I can't think of any particular corner-cases which could cause problems. There are maybe a few extra features / interactions we could add / change (do we always advertise HIGHDPI support now? do we make this add scaled "fullscreen" modes?, would it make sense to support this for resizable windows as well, in case of small text on high-DPI screens?) but I think the actual implementation should be pretty robust. Fractional scaling can get hairy, but since this only computes the final size of the window once, it should be as close to perfect as that can get, as far as I can tell. I played around with a few different programs, and it seems to work well for me on all of them so far. |
(I put the SDL_WINDOWID patch in, which is probably going to generate a bug report later when it doesn't work exactly right, but it's better than nothing.) |
So making key repeat work like SDL 1.2 expects is surprisingly little code. I set out to add a timer that deals with lists of currently-pressed keys, but in practice 1.2 is less complex than that. However, there's one little issue here: sdl12-compat/src/SDL12_compat.c Lines 2363 to 2396 in ebfcc6e
Basically SDL2 key repeat (or rather, I guess, operating system key repeat?) will keep generating TEXTINPUT events as you hold down most keys, and if sdl12-compat can't match the repeated input to a pending KEYDOWN event, it just pushes a new 1.2 KEYDOWN event. The end result of this is that we end up with two competing key repeat mechanisms, and one that can't be controlled by SDL_EnableKeyRepeat. How crucial is this code? I assume the careful tapdance to match TEXTINPUT to KEYDOWN events is extremely delicate, but if this is just here as a "maybe we missed it, send a keydown just in case" sort of thing, then can we remove the code that generates an event if FlushPendingKeydownEvent returns false? |
(and of course, @sulix warned about this in the original TODO list. :) ) |
I took a flamethrower to it. We can revisit (and revert!) if this proves to be a problem, but this code looked like it was trying to do more-correct Unicode support, and SDL 1.2 did not do anything correct at all about it. |
In 1.2 each subsystem has a flag that tracks if it's initialized, so quitting a subsystem once cancels all previous init attempts. In SDL2, each subsystem has a reference count. So keep a bitmask here that tracks 1.2-style init and only init SDL2 once. Reference Issue #143.
SDLK_COMPOSE was only referenced in the x11 backend, as a sort of "I have nothing better to assign to this random set of keys." SDLK_BREAK is generally the same key as SDLK_PAUSE. SDLK_EURO appears to only be used by the 1.2 BeOS backend, and The Be Book can't identify a physical key that generates this keycode: https://www.haiku-os.org/legacy-docs/bebook/TheKeyboard_KeyCodes.html So nothing reasonable maps to these things (and if they _are_ reasonable, SDL2 doesn't report anything equivalent to them), so in the best case they aren't goign concerns, in the worst case we just pretend the user never pressed them. So the FIXME is simply removed. Reference Issue #143.
See comments in previous commit. Reference Issue #143.
…ayout. This is a lesser-used codepath that probably doesn't need this feature, which we probably can't supply in any reasonable way anyhow. Reference Issue #143.
This got fixed at some point, checking it off the list. |
Holy moly, all the FIXMEs are gone. :O |
Woo! Congrats! :) |
Originally posted by @sulix in #53 (comment)
The text was updated successfully, but these errors were encountered: