diff --git a/.includes/bottle.sh b/.includes/bottle.sh index f7c3fb7..9995580 100644 --- a/.includes/bottle.sh +++ b/.includes/bottle.sh @@ -22,6 +22,35 @@ get_bottle() { fi } +apply_swamp_quartz_override() { + local exePath="$1" + local wineVersion="$2" + local exeName="${exePath##*\\}" + local wineMajor + local wineMinor + local quartzOverride + + exeName="${exeName##*/}" + if [[ "${exeName,,}" != "swamp.exe" ]]; then + return + fi + + if [[ ! "$wineVersion" =~ wine-([0-9]+)\.([0-9]+) ]]; then + echo 'Could not determine the Wine version.' >&2 + return + fi + + wineMajor="${BASH_REMATCH[1]}" + wineMinor="${BASH_REMATCH[2]}" + if (( wineMajor > 11 || (wineMajor == 11 && wineMinor >= 17) )); then + quartzOverride="b" + else + quartzOverride="n,b" + fi + + export WINEDLLOVERRIDES="${WINEDLLOVERRIDES:+${WINEDLLOVERRIDES};}quartz=${quartzOverride}" +} + # Set wine environment for installation (called from install_wine_bottle) set_wine_env() { local architecture="$1" diff --git a/audiogame-manager.sh b/audiogame-manager.sh index d8a70ba..ed83411 100755 --- a/audiogame-manager.sh +++ b/audiogame-manager.sh @@ -820,8 +820,10 @@ game_launcher() { exit 0 fi get_bottle "${game[0]}" - echo -n "launching " - wine --version + local wineVersion + wineVersion="$(wine --version)" + printf 'launching %s\n' "$wineVersion" + apply_swamp_quartz_override "${game[1]}" "$wineVersion" # kill any previous existing wineservers for this prefix in case they didn't shut down properly. wineserver -k # launch the game