Closed DominusExult closed 6 years ago
Commits that changed SDL 2.0.3 code:
To make the 2.0.6 (and 2.0.7) SDL2 release work with Exult-ios you need to patch the Exult xcode project file with xcode_for_SDL2.0.6.diff (some frameworks needed to be added and rearranged). [xcode_for_SDL2.0.6.diff.txt](https://github.com/litchie/exult-ios/files/1374827/xcode_for_SDL2.0.6.diff.txt
With the above patch Exult for iOS compiles with a dropped in SDL 2.0.6 (dropped into SDL2-2.0.3 folder). But has two issues:
The screen display does not match where things in the game are. With default settings, the "real" screen where the clicks are registered is in the upperleft corner and maybe a quarter the size (or smaller) than what is displayed. I think this could be either because we do use surface, and/or we are technicaly not in fullscreen mode and/or we need SDL_WINDOW_ALLOW_HIGHDPI (which might require explicit OpenGl rendering and actual fullscreen mode)
The onscreen controls (see screenshot, the ESC button and d-pad) are not visible, unless SDL2-2.0.3/src/video/uikit/SDL_uikitwindow.m is edited as in 84c773210c7cc60581b6e3a70e7606261481332f. If you do that the onscreen controls do actually work. Another helpful patch is menucontrols.diff that shows the onscreen controls in the main Exult menu (so you don't have to start a game to see them) menucontrols.diff.txt
Partially fixed this in the commits on the November 25. The remaining changes to the SDL2 sources are in 785400f8747394ef59d114716c571ac368d342b3
src/events/SDL_mouse.c : make double_click_radius bigger to fix big fingers
src/video/uikit/SDL_uikitviewcontroller.m: Do not stop Text Input after hitting Return
src/video/uikit/SDL_uikitwindow.m: fix our borked SDLUIKitDelegate hijacking - this is the last big one.
I Exult's code we only need to change that Exult recognizes the high dpi sizes of iOS devices so we can use better scalers.
Closing this now. SDL2 is now a pure drop-in.
I still need to figure out how to run it in HighDPI but so far so good.
There are some changes to the SDL 2.0.3 code done to make Exult work on iOS. Preferably these changes should be done in our code to make SDL just a drop in. AFAICT by looking at other projects it might be possible to do this via the SDLUIKitDelegate subclassing I added in 84c773210c7cc60581b6e3a70e7606261481332f. A good example is the iOS port of GemRB and their Cocoawrapper which also uses an SDLUIKITDelegate subclass. See https://github.com/gemrb/gemrb/tree/master/apple/CocoaWrapper/ios