Skip to content

Instantly share code, notes, and snippets.

@HybridEidolon
Last active August 29, 2015 14:04
Show Gist options
  • Save HybridEidolon/ef5a24f1436a6a1c3f02 to your computer and use it in GitHub Desktop.
Save HybridEidolon/ef5a24f1436a6a1c3f02 to your computer and use it in GitHub Desktop.
SRB2 SDL2 migration status stuff

SRB2 SDL2 Migration Status

aka "things only I really care about"

Task list:

  • Mouse speed mapping (don't use SDL relative mode)
  • Joystick migration
  • OpenGL renderer support migration
  • remove non-standard resolutions from res list but allow any resolution via command line args
  • Lock resolutions in fullscreen on OpenGL to desktop native only
  • Find ways to improve software rendering

Bugs to review

  • That weird netgame ping issue (related to sdl_net code, may have existed pre-migration)
  • Mouse wheel locking issue (wheel api change made mwheel not act as a button -- need to reset wheel button state every frame that we don't get a wheel event from sdl)
  • Strange mapping with XInput controllers (almost certainly an SDL issue)

Joystick migration

SDL2 uses SDL_JoystickID for joystick events. The same joysticks would be used for p1/p2 regardless of being hotplugged. Should probably introduce a new console command for resetting joystick IDs. I don't think srb2 uses the event queue for joysticks like it does for keyboard and mouse input, hence why everything sorta half works still.

Okay the code doesn't actually need to use SDL_JoystickID. Replace SDL_JoystickName call argument with SDL_Joystick* SDLJoyInfo_t.dev. That should stop the garbage joystick name and potentially fix crashes. However we need to close joysticks when a joystick is unattached, see SDL_JoystickGetAttached, to restore previous joystick behavior (joys are unmapped when unplugged).

OpenGL migration

initial research in progress.

Mouse speed mapping

SDL relative mode totally screws the mouse sensitivity for some reason, should go back to mouse capturing the old way.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment