-
Notifications
You must be signed in to change notification settings - Fork 160
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
SDL2 Port #1137
Merged
ivan-mogilko
merged 41 commits into
adventuregamestudio:ags3--sdl2
from
ivan-mogilko:ags3--sdl2
Dec 2, 2020
Merged
SDL2 Port #1137
ivan-mogilko
merged 41 commits into
adventuregamestudio:ags3--sdl2
from
ivan-mogilko:ags3--sdl2
Dec 2, 2020
Conversation
This file contains 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
SDL2: general backend; SDL_Sound: for reading and decoding sound formats; MojoAL: a SDL-based implementation of OpenAL API.
Based on the work of @sonneveld (Nick Sonneveld); only relevant code, plus tidied up a little.
Based on the work of @sonneveld (Nick Sonneveld); only relevant code, plus tidied up a little.
Based on the work of @sonneveld (Nick Sonneveld). Audio now plays only on a separate thread, unconditionally. Removed: * Allegro4-based SOUNDCLIP implementations; * old audio thread (now implemented in audio core module); * obsolete config settings; * PSP sound cache (may be reimplemented later).
There's some kind of race condition with MojoAL which may try to mix-in our new clip before it gets properly initialized with data. When it does so, it drops the clip out of the slot. Here we prevent this by polling at least some data in before calling alSourcePlay.
Based on the work of @sonneveld (Nick Sonneveld).
Unfortunately, game processing is not fit for a single event poll, as game thread may be looping in a certain state for a while before returning to the main loop (such as running a dialog script, waiting for a blocking action to complete, etc). Fixing this is a task for another time. At the moment we are adding event polls into each sub-state.
Based on the work of @sonneveld (Nick Sonneveld). Plans for the future refactoring: make gfx driver *return* SDL_Window it creates from SetDisplayMode(), and let engine save it as current render window.
Based on the work of @sonneveld (Nick Sonneveld). This simplifies the code and makes it uniform for Linux, Windows and MacOSX altogether.
Based on the work of @sonneveld (Nick Sonneveld).
Based on the work of @sonneveld (Nick Sonneveld).
Mouse speed control was necessary mostly for Direct3D fullscreen, because Allegro4 had some issues with mouse input in that mode. SDL2 does not seem to have such problem. But I'd like to keep this functionality in the engine just in case, at least for some time.
Based on the work of @sonneveld (Nick Sonneveld) with certain simplifications.
Based on the work of @sonneveld (Nick Sonneveld) with certain simplifications. This keeps original AGS keycodes (based on allegro scancodes, although that's irrelevant now) throughout the engine, and only replaces the way it's generated from backend events. Note that this won't be compatible with unicode text events, and simple AGS code will have to be replaced with something to optionally store unicode text as well. Also, in the future it may be beneficial to refactor event handling globally, and pass all wanted events to the engine components, either directly, or converted to convenient custom data.
Based on the work of @sonneveld (Nick Sonneveld) with minor modifications and fixes.
AGS still uses following from Allegro lib: * bitmaps, drawing, blending and palette functions; * functions for loading/saving bitmaps and pcx; * playing FLIC; * PACKFILE (used in limited situations, e.g. FLIC); * fixed math functions; * file path and find-file functions; * unicode functions;
Based on the work of @ericoporto (Érico Vieira Porto)
ivan-mogilko
added
backend: allegro
related to allegro 4 library
ags3
related to ags3 (version with full backward compatibility)
backend: sdl2
related to sdl2 library
labels
Nov 29, 2020
Closed
Ok, I merged this into ags3--sdl2 branch, guess it's easier for letting more people test it and find issues to fix. I wonder, when would be a good time to merge this into ags4? Considering ags4 branch does not have any deadline/milestone yet, doubt it needs preliminary release with allegro 4 backend? |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
ags3
related to ags3 (version with full backward compatibility)
backend: allegro
related to allegro 4 library
backend: sdl2
related to sdl2 library
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.
Resolves #1096.
Replaces Allegro 4 backend with SDL2.
Main bulk of work was done by @sonneveld previously, now gathered it up, tidied the code, amended and fixed where necessary.
CMake changes by @ericoporto.
Library changes
Notable issues / future todo:
Audio
Audio playback is completely rewritten, uses OpenAL (through MojoAL currently) and SDL2_Sound.
Audio is now played only on a separate thread (this was optional previously).
Notable issues / future todo:
Rendering
Notable issues / future todo:
Building
Must update CI scripts. What is necessary here?
Notable issues / future todo: