adventuregamestudio / ags

AGS editor and engine source code
Other
705 stars 159 forks source link

Fixes for AGS3 SDL2 port #1148

Closed ericoporto closed 2 years ago

ericoporto commented 3 years ago

Issue to aggregate remaining fixes for AGS3 SDL2 port (now merged into master).

All Ports


Windows


Linux


MacOS


Android


iOS

iOS support is a bit tricky (for me), SDL2 supports but I lack the device to test it, so for now I think the main task is finding someone who is interested in picking it up. If no one picks it up, I can do it on an emulator.

https://hg.libsdl.org/SDL/file/bc96d65e47da/docs/README-cmake.md https://hg.libsdl.org/SDL/file/bc96d65e47da/docs/README-ios.md

mapped on #1505


Completed Tasks

Click to Expand - Finished Tasks hidden for readability

~~I marked with one asterisk `*` what is reasonably done but hasn't been merged yet, and with two asterisk `**` what the fix is made but isn't completely working yet and hasn't been merged.~~ Probably not relevant anymore, but kept for history. ### All Ports - [x] missing proper sound cancellation, [see comment]()https://github.com/adventuregamestudio/ags/issues/1148#issuecomment-761581778 - [x] Sound subsystem and thread has to be explicitly stopped on exit before shutting down backend and deleting data, otherwise there may be errors. - [x] CI/CMake update: don't use DirectX SDK anymore. (#1291) - [x] CI/CMake update: don't require DirectX SDK and SDL2/SDL_sound for editor. (#1291) - [x] Remove `hqx` filter mention from command line arguments (#1293) - [x] ~~Unresolved import DrawSprite (I think this was already solved at some point, happens when running Hell's Puppy -> https://github.com/ericoporto/dogfromhell)~~ error was the thing between the chair and the computer. - [x] Mouse Middle Click, with `on_mouse_click(MouseButton b)` callback, is not working. [mouseMiddleClickTest.zip](https://github.com/adventuregamestudio/ags/files/5668991/mouseMiddleClickTest.zip) (middle click should Display a text). - [x] ~Ctrl+~Alt+X doesn't abort the game. - [x] Add support to Window Resizing in desktop OSes - [x] Support SDL_WINDOW_FULLSCREEN along with SDL_WINDOW_FULLSCREEN_DESKTOP (in fact, maybe just add generic "desktop fullscreen" config option and apply "fullscreen" only where possible (SDL renderer and Direct3D). ### Windows - [x] Put prebuilt libraries in a more conventional place (e.g. github repo). (fixed by #1390) - [x] If we are using a separate SDL2.dll, then it needs to be added in the Editor packaging pipeline (and in the installer) (#1368) - [x] Editor doesn't put SDL2.dll together in the directory / alternatively, use SDL2 statically linked - [x] Update license files in the win installer folder(#1345) - [x] I don't know if others have this issue, but errors place the pop-up window behind the game window and if the game is Fullscreen I can't close it or load task manager, having to restart my computer. Maybe related to #1034 - [x] Investigate using newer Directx SDK ([see comment](https://github.com/adventuregamestudio/ags/issues/1148#issuecomment-757144368))Fullscreen I can't close it or load task manager, having to restart my computer. Maybe related to #1034 - [x] Fix CI system. `*` PR: #1141 - [x] Update build instructions. - [x] write code for `sys_window_set_icon`. (PR #1410 ) ### Linux - [x] Debian packaging. SDL_sound has to be statically linked since it's package is not updated. #1159 - [x] Update Licenses. - [x] Fix CI system. `**` (missing debian parts) #1157 - [x] Update Editor code that builds the port. - [x] Update build instructions. (change of dependencies) ### MacOS - [x] Minor fixes on allegro and engine code. `*` #1152 ### Android - [x] Java completely rewritten to use SDL2 class instead of AGS Glue. `*` - [x] Launcher (Java code) has to be redone. - [x] Optionally, add single game launcher (Java code) in the AGS repository. - [x] Use of CMake builds for Android to easily adapt to Android build system changes, it also reduces code. `*` - [x] Restore or not usage of android.cfg, some options relied on Allegro4 android backend.drag and drop module to work, finger hold on screen is readable by mouse.IsButtonDown(): https://youtu.be/lbdth4SHbSE. - [x] Add OpenGL ES2 support, wasn't available on previous port in the ags3 branch, but I have the code already written and it works best with newer android devices. `*` - [x] Delete unused code. Some old specific Allegro4 Android code can be deleted. - [x] Update build instructions. (`./gradlew build` or load the project in Android Studio, mention SDK and NDK versions) https://hg.libsdl.org/SDL/file/default/docs/README-android.md


If more issues are found or something is missing, please write about it below.

ivan-mogilko commented 3 years ago

By the way, SDL2 devs fixed my reported bug :) https://bugzilla.libsdl.org/show_bug.cgi?id=5329

I think they target 2.0.14 release, so we may update when it's out.

ericoporto commented 3 years ago

Ha, very cool! 😃

One thing I remembered is there were some TO-DOs on the sound part but I don't remember if they are supposed to be in the list above. 😬

ivan-mogilko commented 3 years ago

Something that might be added:

There were some problems which I met while testing random games, but I ignored them temporarily. Primarily in 8-bit games, iirc colors could have been shifted again, but not sure. I'd need to repeat tests and document these.

ivan-mogilko commented 3 years ago

Oh, also support resizing window on desktop oses; I skipped that for simplicity but it was supported in sonneveld's branch.

ericoporto commented 3 years ago

Added above in the list :)

ivan-mogilko commented 3 years ago

I was a bit distracted for a while, is my understanding correct that macos builds and works with SDL2 now? Desktop OSes are my primary concern before merging this into ags3 (master) and ags4. Applying Android changes is my first next todo. iOS may wait, because it's more niche and usually commercial gamedevs do their own fixes for it anyway.


On another topic, I was supplying prebuilt libraries for Windows in my dropbox. Is there any option to do so on github? I know one could attach these to one of the releases, but this seem an obscure place, as the links should stay permanent for a long while.

ericoporto commented 3 years ago

It worked on my Mojave box and High Sierra, yes. I haven't tried on the more recent MacOSes - but I believe it should. I can make a Catalina test but I don't have access to the latest Big Sur yet.

I am working on Android here: ericoporto/ags/ags3--sdl2-android and picking up the latest Android project from my own main branch for merging - I will write better commit messages, for now I am just figuring the commits since in some parts is a lot of things. Just haven't being able to finish yet.


About prebuilt Windows libraries, it could be a repository just for them in the organization.

As an example, I made a NuGet package for the xiph libraries but just them here: https://github.com/ericoporto/xiph-for-ags

I made it build and upload using only Azure to avoid manual steps, I could make something like this. I actually used it on the Windows Docker to avoid a vcpkg bug on our CI, but maybe a proper repo for Windows prebuilt binaries could exist in ags org, with it's own releases. I didn't went through, but by shipping it's own .prop file in it, the NuGet library can even be part of the Windows VS Solution itself if desired. Anyway, in this case, the libraries are both available in it's own GitHub releases and the NuGet package repository.

Other than making a separate repository for ags dependencies on Windows, GitHub has a packages feature that I haven't explored but it may be able to serve just that.

rofl0r commented 3 years ago

Other than making a separate repository for ags dependencies on Windows

this seems to be a good choice. i've seen various orgas on github that put their releases/binaries into dedicated repos. the files will stay available using a link with commit hash even if they are replaced in subsequent commits, unless the commits adding them become orphans (e.g. with a force-push removing them). an alternative could be sourceforge or osdn.net (located in japan).

ivan-mogilko commented 3 years ago
ericoporto commented 3 years ago

Added to the list!

ivan-mogilko commented 3 years ago

Something I forgot to test earlier, but I suspect that we may use slightly less old DirectX SDK. There was a need to use particular "August 2007" version because it contained headers necessary for Allegro 4 graphic and input drivers.

As a part of commit ae8b7369e92e2091180e27fae2cfa7dfa8a1bb0a I've removed following linked libs: ddraw.lib, dinput.lib, dsound.lib, dxguid.lib. The only lib still required is d3d9.lib (for Direct3D renderer). This means we may try to use latest SDK that still supports Direct3D 9 (iirc from 2008 or 2009, but I don't remember exactly).

UPDATE: turned out we do not require DirectX SDK at all anymore, as engine only needs d3d9.lib which is a part of Windows SDK.

ivan-mogilko commented 3 years ago

Found bug in new sound backend: it does not have a proper cancellation in case it failed to decode sound data. If the clip is told to play repeatedly it gets into infinite loop trying to fill the buffer over and over again.

ivan-mogilko commented 3 years ago

MIDI playback is broken currently. I don't remember if it happens for any midi files, but in this game for instance midi music sounds like 5-10 times slower when run on Windows.

ivan-mogilko commented 3 years ago

(+) removed vorbisfile lib link from Windows version, need to double check that it still works if we remove it from other ports (linux etc); simply did not have time to test it myself yet.

ivan-mogilko commented 3 years ago

Merged latest ags3 branch, DrawSprite fix should be there now, and maybe something else.

rofl0r commented 3 years ago

but in this game for instance midi music sounds like 5-10 times slower when run on Windows.

this sounds like the bug i reported to SDL bugtracker which is the result of libmodplug not finding midi instruments (mentioned in #367)

ericoporto commented 3 years ago

Just heads-up, SDL is migrating to GitHub: https://github.com/libsdl-org/SDL

rofl0r commented 3 years ago

Just heads-up, SDL is migrating to GitHub: https://github.com/libsdl-org/SDL

that's great. though i can't find any official announcement of the move, did you see one? the sdl hp also still links to their hg repo which has seen recent commits as of 20 hrs ago.

ericoporto commented 3 years ago

Merged latest ags3 branch, DrawSprite fix should be there now, and maybe something else

Sorry, I have rebased and am still hitting DrawSprite error. I confirmed it also happens on Linux build. I think it's from agsblend, but I have the plugins built-in, plus I really do remember this specific error being fixed but I couldn't find the commit. Problem is I don't remember how this was fixed and searching issues here I came up empty.

ivan-mogilko commented 3 years ago

I confused this with DrawImage bug. DrawSprite is probably from agsblend plugin?

So, you are saying this happens only in ags3--sdl branch? and not in current master?

ericoporto commented 3 years ago

You are right, I confused one error with the other too! Turns out I thought I had built the Engine with built-in plugins but I didn't. Sorry for the confusion. (It's alright in both the master and ags3--sdl2, I tested!)

ericoporto commented 3 years ago

Hey, I am trying to make the new SDL "Software" Renderer to work on Android and I am trying to figure out how to stretch it through the screen. I looked at source code and the new SDL Software Renderer is different from the one that was before (that one had other bugs though), anyway any guesses on where to look for why it's not stretching?

I tried using AGS Script API to alternate between windowed mode and fullscreen, and while windowed makes the game correctly stretch in the non-fullscreen area, going back to fullscreen after still makes the game tiny.

ivan-mogilko commented 3 years ago

I could look into this if I find spare time, but if I remember correctly, although the old pre-SDL renderer worked in similar principle, the essential difference was that the conversion into opengl texture and stretching was done inside patched allegro library. The engine's software renderer never really bothered what the final resolution is in case of mobile device.

So my guess would be that android backend simply does not pass final screen resolution to the engine, because it was not done before. Maybe it should work just how our OpenGL renderer works now - there is some functions or variables that retrieve device resolution. android_screen_physical_width and android_screen_physical_height? Unless they were renamed or replaced.

rofl0r commented 3 years ago

i've found this guide quite good: https://wiki.libsdl.org/MigrationGuide#Moving_from_SDL_1.2_to_2.0

if i remember correctly, one basically just has to fill a surface with pixel data in the original format and depending on fullscreen settings the chosen renderer will stretch it to screen size either in sw or hw.

ivan-mogilko commented 3 years ago

if i remember correctly, one basically just has to fill a surface with pixel data in the original format and depending on fullscreen settings the chosen renderer will stretch it to screen size either in sw or hw.

This is similar to what we do now: https://github.com/adventuregamestudio/ags/blob/ags3--sdl2/Engine/gfx/ali3dsw.cpp#L501

The point is that on desktop systems engine calculates final resolution from config, but on mobile it has to rely on corresponding backend or "glue" passing these parameters.

ericoporto commented 3 years ago

Thanks dudes! I will eat lunch and rellax a little and take a look later today. I have followed things with a debugger and haven't found anything yet but I haven't dived into SDL itself. One thing weird is I found a specific game (Suli) that is working correctly with it on Android! I also advanced a bit on CI and organizing commits and am thinking to at least have a working WIP PR just to see how it goes.

Edit: I actually removed a lot of Android specific variables, including that device size, theoretically it's not needed anymore - the OGL renderer is working fine without them. :)

ivan-mogilko commented 3 years ago

Well, sounds like it already changed beyond my knowledge.

ericoporto commented 3 years ago

I got it working, I still didn't managed to finish some small details in the new docker image for the CI but hopefully I can finish during this week.

ivan-mogilko commented 3 years ago

@ericoporto quickly looking at the branch in your repo, there are few things that bother me. One is "gml" library addition which is then used in code in commit named "ES2 support". I was thinking to investigate if this may be separated, but since you took over this, could you tell if this is necessary because ES2 no longer supports GL own matrix functions, or was done only for the reason of adding glm?

If latter, I'd propose to remove this from android pr now, and consider adding separately later (and there are more places where we may utilize matrix functions too, Direct3D renderer for instance which currently uses our custom written ones). I hope this is not too difficult to do, as it seems its used in 1 file to literally replace 5-6 code bits, so probably a matter of resetting few code changes.

ericoporto commented 3 years ago

Previous OpenGL renderer on android was really dependant of the custom backend made in Allegro and it just doesn't work on my main phone - and I have zero idea on how to make it work with SDL2. I think it used ES1.

ES2 does drawing through shaders - no glColor4f. It also doesn't have matrix functions, which is why I used glm for those. I have used and maintained the core of this renderer for an year now. Without it I can't test - older phones, that I have that worked with previous Android port, use a different API for Debug and I can't produce proper tracing on latest Android Studio.

If you look closer the new code is just like your OGL renderer but with the an additional transparency shader, and also just removed the non ES2 gl functions. I could use ifdefs for using glColor4f when using non ES2 on desktop - I actually did this for some time but the code looked ugly, which is why I dropped.

https://github.com/ericoporto/ags/tree/ags3--sdl2--android-5

For now I have been pushing force a lot trying to properly rewrite the commits so things makes sense. So you may read a commit one day and find it in a different place or a different content in the next day.

To be clear, I don't know how to do the old OpenGL and make it work on Android. If you don't take the PR this way you are free to pick my commits but I really don't know how to do it in other way - see #600 .

Also when I asked help I was talking about the Software Renderer, because that is the one that was different than the one I had - I understand now the difference and got it working.

If the only reason is to avoid glm for some reason, I can hand write the matrixes but I am not good at writing tests. I can also alternatively use glm and remove anything that is not mat4 of it so it's tinier - it reduces to 6 headers I think.

rofl0r commented 3 years ago

few things that bother me. One is "gml" library addition

i second this. we shouldn't pull in a new 3rd party library everytime an issue pops up that would require to write a few dozen lines of code to solve it.

ivan-mogilko commented 3 years ago

ES2 does drawing through shaders - no glColor4f. It also doesn't have matrix functions

Okay, this is the reason then.

ericoporto commented 3 years ago

I don't really few like writing a matrix library @rofl0r .

Directx matrix is different from OpenGL, I think it needs some conversion.

ES1 doesn't support shaders on Android: https://developer.android.com/guide/topics/graphics/opengl

ivan-mogilko commented 3 years ago

BTW we had to write our own matrix functions for Direct3D for the reason to not link with some utility lib from Windows SDK. (First were written by Chris Jones, and I amended them later)

Directx matrix is different from OpenGL, I think it needs some conversion.

Afaik they need only a transpose operation, because they have columns and rows switched.

I wonder if glm allows operations in both styles or not, I'd like to investigate that. E: perhaps in worst case matrix may be filled using helper function that fills them in mirrored way.

ivan-mogilko commented 3 years ago

I can also alternatively use glm and remove anything that is not mat4 of it so it's tinier - it reduces to 6 headers I think.

Yes that would be nice to only include what is strictly necessary for now. (Unless there's some problem with glm license)

ericoporto commented 3 years ago

Ah, the only reason to put in the repository is because Windows doesn't have a package manager and we aren't using anyplace to store Windows dependencies. On Linux glm just ships on package managers and I could just fetch it also on Android, iOS, MacOS, ... It would be nice if we had a place to store Windows dependencies.

ericoporto commented 3 years ago

I looked into and it's just not worth it trying to reduce to less than the 60k loc in 400kb it has, so I won't. Anyone else is free to try. I don't understand why other things in the repository gets a free pass to inclusion in the repository - like Freetype.

These are the includes, ideally all other things that are nice on glm need to be preserved.

// this goes in ali3dogl.cpp
#include <glm/gtx/transform.hpp>
#include <glm/gtc/type_ptr.hpp>

//this goes in the ali3dogl.h
#include <glm/ext/matrix_float4x4.hpp>

Problem is it has proper things so it's nice to work with it. Removing things will make the experience less pleasant - it has proper comments I don't feel like filtering with the preprocessor - I like the comments on my IDE! I followed what these includes include, and there's only so much micro optimization to do and it's just not worth it. I ran cppclean, but ags code is terrible, I tried other ideas by hand too, but it was still basically the same size.

BTW a clean build of ags including fetching and building all dependencies on my pc is 20 seconds on CMake. If the reason for not including in the repo is some arbitrary size restriction, I strongly suggest making a repository for Windows dependencies because it's the only platform where getting dependencies is complicated.

rofl0r commented 3 years ago

I don't understand why other things in the repository gets a free pass to inclusion in the repository - like Freetype.

freetype was already a dependency, we just added the exact ancient version that's required to not break old games using the lucasarts fonts.

it's another thing to add a new library for every task, especially when the motivation is "hey this library is cool i like to use it somewhere". it's similar to "hey i'd like to use this cool new C++20 feature so let's throw compatibility over board"

rofl0r commented 3 years ago

BTW a clean build of ags including fetching and building all dependencies on my pc is 20 seconds on CMake.

your PC is super fast. compiling AGS takes more than 5 mins on mine. i even wrote this script:

script ```sh #!/bin/sh -- ## cachecc (c) 2021 rofl0r ## ## wrapper for gcc/g++, which only recompiles .o file when input dependencies ## have changed. this is useful when working on C++ projects that have huge ## compile times, and switching between branches with git e.g. simply for ## looking at files, will cause git to modify the timestamp of any file that's ## been touched by any commit, forcing make to rebuild it later when you switch ## to a branch you actually work on. ## ## also helpful: when CACHECC_VERBOSE=1 is set in the environment, one can ## actually see why a file is being scheduled for rebuild by make - often it's ## a tiny innocent change to a header that causes a forced rebuild of dozens ## of files. ## ## the wrapper stores command line and hashes for all input files in a file ## with a .cachedat extension, so if you want a forced rebuild of a project ## (e.g. when some system headers have changed) you can simply execute ## find -name '*.cachedat' -delete and you have a clean state. ## ## usage: put cachecxx into your PATH and symlink it to cachecc (for C). toolname="$(basename "$0")" if test "$toolname" = "cachecxx" ; then CALL_COMPILER=g++ EXTS="cpp cc C" else CALL_COMPILER=gcc EXTS="c" fi verbose=false test -n "$CACHECC_VERBOSE" && verbose=true getmd5() { md5sum | cut -d ' ' -f 1 ; } getmd5f() { md5sum "$1" | cut -d ' ' -f 1 ; } # some helper functions taken from musl's configure fnmatch () { eval "case \"\$2\" in $1) return 0 ;; *) return 1 ;; esac" ; } quote () { tr '\n' ' ' </dev/null 2>&1 && { echo "$1" ; return 0 ; } $1 EOF printf %s\\n "$1" | sed -e "s/'/'\\\\''/g" -e "1s/^/'/" -e "\$s/\$/'/" -e "s#^'\([-[:alnum:]_,./:]*\)=\(.*\)\$#\1='\2#" } gettmp(){ i=0 set -C while : ; do i=$(($i+1)) tmpf="./cachetmp$$-$PPID-$i.d" 2>|/dev/null > "$tmpf" && break test "$i" -gt 50 && fail "$0: cannot create temporary file $tmpf" done set +C trap 'rm -f "$tmpf"' EXIT INT QUIT TERM HUP } deps() { # turn output of gcc -E -MM into one line per dependency, remove the target # and trailing backslashes before newlines. awk 'BEGIN {skipf=1;} function out(a,j){for(j=1;j<=length(a);++j)if(substr(a,j,1)=="\\"){++j;printf("%s", substr(a,j,1));}else printf("%s", substr(a,j,1));printf("\n");} {if(skipf == 1){ for(i=1; substr($0,i,1) != ":"; ++i); $0=substr($0,i+1); skipf=0;} start=2; for(i=start; i<=length($0); ++i) {if(substr($0,i,1)=="\\")++i; else if(substr($0,i,1)==" ") {out(substr($0,start,i-start)); start=i+1;} } if(i>start&&substr($0,start,i-start)!="\\") out(substr($0,start,i-start));}' <$tmpf } gencache() { # $@ manipulation technique provided by earnestly gettmp c=$# while [ "$c" -ne 0 ]; do case $1 in -c) ;; -o) shift ;; *) set -- "$@" "$1" esac shift c=$((c - 1)) done $CALL_COMPILER "$@" -E -MM -MF $tmpf || return 1 printf "%s\n" "$opts_hash" > "$outfile.cachedat" c=0 s_IFS="$IFS" IFS=' ' for x in $(deps) ; do printf "%s:%s\n" "$(getmd5f "$x")" "$x" >> "$outfile.cachedat" done IFS=s_IFS rm -f "$tmpf" } recompile() { gencache "$@" exec $CALL_COMPILER "$@" } infile= outfile= minus_c_seen=false next_is_out=false for arg ; do if test x${arg}x = x-cx ; then minus_c_seen=true elif test x${arg}x = x-ox ; then next_is_out=true else if $next_is_out ; then outfile="$arg" next_is_out=false else for ext in $EXTS ; do if fnmatch '*.'$ext "$arg" ; then infile=$arg fi test -n "$infile" && break done fi fi $minus_c_seen && test -n "$infile" && test -n "$outfile" && break done if ! $minus_c_seen || test -z "$infile" ; then $verbose && printf "%s: no -c in command line, running compiler directly\n" "$toolname" exec $CALL_COMPILER "$@" fi if test -z "$outfile" ; then # compiler called without -o foo.o - derive default .o filename from inputfile outfile="${infile%%${infile##*.}}"o fi cmdline= for i ; do cmdline="$cmdline $(quote "$i")" ; done opts_hash=$(printf "%s\n" "$cmdline" | getmd5) if test -r "$outfile.cachedat" && test -r "$outfile" ; then exec 3<"$outfile.cachedat" read cached_opts <&3 if test $cached_opts != $opts_hash ; then $verbose && printf "%s: command line for %s has changed, recompile required\n" "$toolname" "$infile" recompile "$@" fi while read depline <&3 ; do hash=$(printf "%s\n" "$depline" | cut -d ':' -f 1) fn=$(printf "%s\n" "$depline" | sed 's/^'$hash'://') if test $(getmd5f "$fn") != $hash ; then $verbose && printf "%s: %s has changed contents, recompile required\n" "$toolname" "$fn" recompile "$@" fi done exec 3<&- $verbose && printf "%s: %s and dependencies unchanged.\n" "$toolname" "$infile" exec touch "$outfile" else $verbose && printf "%s: output file or cache missing, need compile\n" "$toolname" recompile "$@" fi ```

so if i need to check out another branch just to look at git commits i dont have the recompile everything all over again because git modifies the timestamps.

ivan-mogilko commented 3 years ago

Problem is it has proper things so it's nice to work with it. Removing things will make the experience less pleasant - it has proper comments I don't feel like filtering with the preprocessor - I like the comments on my IDE!

Erm, I did not suggest to remove anything from the headers, I meant simply - include the headers that we need. ...unless I misunderstand what you mean, maybe i got confused. if it's impossible to do without editing headers themselves, then nevermind that.

The only reason I asked about this at all was that apparently we are only going to use only few functions out of this library at the moment, so it felt kind of strange to add whole library for that. I've got initial impression that it's possible to cherry pick some headers from glm, but if it's not trivial, then ofcourse there's no need to waste time on that.

@rofl0r I edited your comment and hid the script under spoiler, because it's pretty long and is not relevant to this discussion.

ericoporto commented 3 years ago

@ivan-mogilko I did had the impression that picking dependencies was going to be easy, but once I started to actually try to do it wasn't as simple.

This is a "Windows doesn't have a standard way of getting dependencies" problem. Because it's a header library it's pretty non issue in other OSes (it's a build but not a runtime dependency), and they also have package managers.

I scanned MS repos to see what they do in the cpp repos that they do use standard VS .sln files, and I couldn't see a pattern to follow. The alternative I have is adding a line in the Windows instructions, adding a prop file, and preplacing the dependency somewhere in the Windows Docker image, with appropriate environment variables.

ivan-mogilko commented 3 years ago

Ctrl+Alt+X doesn't abort the game.

It should be Alt + X by default, but I think it's fixed, please try again with latest branch.

Also just fixed: event polling was missing during video playback (were not able to skip and even close window).

ivan-mogilko commented 3 years ago

Mouse Middle Click

Fixed, there was a typo: 7293b69e3e0c75594118c8104a55d9b32e5db2d1

ivan-mogilko commented 3 years ago

I don't know if others have this issue, but errors place the pop-up window behind the game window and if the game is Fullscreen I can't close it or load task manager, having to restart my computer.

This works for me now if I abort game with alt+X, but there was definitely a problem with Direct3D on Windows some time ago in the main branch. In any case, if this is still an issue, please specify on which system and with which graphic renderer do you experience this problem.

ericoporto commented 3 years ago

It was on Windows at the time, with Direct3D. I haven't checked recently.

Edit: about alt+x, just tested, and now I can at least hit alt+tab a ton of times until eventually the thing closes, but the alert is still placed behind the game (when running in full-screen). It does works if the game is Windowed.

If it's fullscreen but using OpenGL then the behavior is same as windowed with directx, which is the expected behavior. Game closes and a Abort pressed window appear which I can then click ok and proceed. Software renderer works too.

Indeed it appears to only be a problem of Fullscreen and DirectX on Windows.

Middle Click is working too now.

Noticed Ctrl+A in SDL2 doesn't bug the audio system, in the old allegro4 acwin.exe, hitting Ctrl+A would make the music loop glitchy.

ivan-mogilko commented 3 years ago

Marked Android tasks complete (as far as I understand that).

Pushed support for resizing windows on desktop systems (need to test more of course).

rofl0r commented 3 years ago

btw, SDL2 offers 2 different fullscreen modes - one that switches the actual desktop resolution and another one that scales up to desktop size. as i understand it you opted for the latter - though it might be advantageous for slow machines to offer the other method as an option. maybe a flag in acsetup.cfg that decides which fullscreen mode to use ?

ivan-mogilko commented 3 years ago

btw, SDL2 offers 2 different fullscreen modes - one that switches the actual desktop resolution and another one that scales up to desktop size. as i understand it you opted for the latter - though it might be advantageous for slow machines to offer the other method as an option. maybe a flag in acsetup.cfg that decides which fullscreen mode to use ?

SDL modes are used only for the SDL-based software renderer now, but true, I think this should be added in todo. PS. In fact, possibly same thing could be supported in our own Direct3D renderer.

jnahmias commented 3 years ago

Hi @ericoporto, Do you need help with updating the debian packaging for ags? I started looking into SDL_sound and it seems that support for SDL2 will be in an upcoming release, see https://alioth-lists.debian.net/pipermail/pkg-sdl-maintainers/2021-April/003260.html. That will allow pulling that into a proper Debian package so it doesn't need to be statically linked in. Are there any other blockers? --Joe

ya-isakov commented 3 years ago

I'm sorry, but are there plans to support system SDL2?