Skip to content
Permalink
main

Commits on Apr 14, 2021

  1. builds with c++ compilers

    sezero committed Apr 14, 2021
  2. whitespace fixes

    sezero committed Apr 14, 2021
  3. updated os/2 makefile

    sezero committed Apr 14, 2021
  4. Attempt to merge KEYDOWN and TEXTINPUT events to prevent duplicates

    This change makes all KEYDOWN events be stored temporarily as a "pending
    keydown event". If a TEXTINPUT event comes in before the next time
    PumpEvents() is called (or another KEYDOWN or KEYUP event appears), then
    one of the events generated from the 'text' string is merged with the
    KEYDOWN event, thus having both a valid 'sym' and 'unicode' value.
    
    Also add some basic support for UTF-16 surrogate pairs, as that was
    annoying me.
    
    Note that this doesn't quite match what SDL 1.2 does, which depends
    pretty heavily on what backend was being used. The closest backend (XIM,
    I think) does basically the same thing as this, but puts the real keysym
    on the last character of a mult-character TEXTINPUT, whereas we put it
    in the first one. (The last one may actually be more sensible, in case
    there are bugs where a 'last key pressed' is being maintained by an
    application, and the correct one is being overwritten by SDLK_UNKNOWN,
    but this was easier to implement for now.)
    sulix authored and sezero committed Apr 14, 2021

Commits on Apr 12, 2021

  1. SDL_ListModes: Treat formats with the same bpp as identical

    Some games do some interesting things with SDL_ListModes(),
    SDL_VideoModeOK() and similar in order to choose and/or validate video
    modes.
    
    In particular, Darwinia, Defcon, and Multiwinia all take the desktop
    mode's format (via SDL_GetVideoInfo()->vfmt), replace the BitsPerPixel
    field with their desired bpp, and then validate that SDL_ListModes()
    returns a list of modes. (It then goes on to verify the mode it selects
    with SDL_VideoModeOK(), and very aggressively falls back to 800×600
    windowed at 16-bit.)
    
    With sdl12-compat, this never yields a valid mode under X11. By just
    checking if there's a mode with the same bit depth (which, after all, is
    what the game is really asking for), then — under X11 and XWayland —
    24bpp modes are working fine (32 and 16 bpp modes aren't, which is still
    a regression from SDL 1.2, but at least _something_ works.)
    
    Note the SDL 1.2 is much more lenient still, at least under X11, where
    there is only one list of modes (as X11 can't change bit depths at
    runtime), and it is returned whenever the format has the same bpp as any
    valid visual.
    sulix authored and sezero committed Apr 12, 2021
  2. Basic unicode input support

    This change adds unicode input support via the SDL_TEXTINPUT events.
    These are turned into a number of new KEYDOWN events, one per input
    character. These generated events all have a sym of SDLK_UNKNOWN, so
    shouldn't register as spurious keyboard inputs. Normal key messages
    (i.e., those which did not originate with an SDL_TEXTINPUT event) now
    have a unicode value of 0 all the time.
    
    Note that this also includes a basic UTF-8 decoder, which depends on a
    copy of SDL_MostSignificantBitIndex32().
    
    It also doesn't yet support codepoints greater than 0xFFFF, as we don't
    yet generate surrogate pairs.
    
    I've tested this against a few different games, and input works. This
    also includes using the compose key to input accented characters and
    IBUS for more complicated input. While CJK characters weren't working
    (likely due to the UTF-16 surrogate pair issue), and there were issues
    with some games which have limited font support or similar, it seems to
    work so far.
    sulix authored and sezero committed Apr 12, 2021

Commits on Apr 4, 2021

Commits on Mar 5, 2021

  1. minor re-order

    sezero committed Mar 5, 2021
  2. minor warning fixes

    sezero committed Mar 5, 2021
  3. Support optional logical scaling for OpenGL rendering.

    This lets you do FULLSCREEN_DESKTOP windows with OpenGL games. The game
    will render to an FBO and blit it, scaled and centered, to the window
    framebuffer, which both avoids the problems on non-_DESKTOP fullscreen
    _and_ makes these games work like SDL 1.2 did: find a reasonable resolution
    and center the game window in it.
    
    This only works on games that don't use OpenGL framebuffer objects
    (for now), so it's disabled unless you set an environment variable
    (fow now).
    icculus committed Mar 5, 2021

Commits on Mar 3, 2021

  1. first shot at fixing the SDL_OpenAudio and SDL_LoadWAV_RW FIXME()s:

    * SDL1.2 doesn't support AUDIO_S32 or AUDIO_F32 formats:
      - SDL_LoadWAV_RW: Reject WAV files with such formats.
      - Always pass NULL as the 'obtained' pointer to SDL_OpenAudio().
        If a field of the spec is 0, assign some reasonable default to
        it.
    * Library is leaking AudioCallbackWrapper data:
      - Store the data in a global var, change SDL_CloseAudio to not
        be a passthrough, free the data from SDL_CloseAudio.
    sezero committed Mar 3, 2021
  2. minor tweak to README

    sezero committed Mar 3, 2021
  3. Merge pull request #33 from albertvaka/patch-1

    [Readme] Fix reference to the 1.2 repo
    sezero committed Mar 3, 2021
  4. Readme] Fix reference to the 1.2 repo

    There's no 1.2 branch in the repo
    albertvaka committed Mar 3, 2021

Commits on Mar 2, 2021

  1. style cleanup

    sezero committed Mar 2, 2021
  2. removed the IMPLEMENT_ME notes: all are implemented

    kept only 'IMPLEMENT_ME X11_KeyToUnicode'...
    sezero committed Mar 2, 2021
Older