This commit is contained in:
2026-03-27 02:26:44 +01:00
parent 4559404279
commit 829d8dde51
2 changed files with 117 additions and 57 deletions

View File

@@ -1,5 +1,5 @@
FROM i386/alpine:latest AS glide-fetcher
ARG CACHE_BUST=29
ARG CACHE_BUST=38
RUN apk add --no-cache git ca-certificates
COPY .docker-cache/glide.ref /tmp/glide.ref
WORKDIR /src
@@ -85,7 +85,7 @@ RUN find . -type f \( -name 'fxgasm.h' -o -name 'fxinline.h' -o -name 'fxgasm' \
RUN mv swlibs glide2x/
WORKDIR /usr/src/glide/glide2x/
RUN make -f makefile.linux FX_GLIDE_HW=cvg clean
RUN make -f makefile.linux FX_GLIDE_HW=cvg USE_X86=1 USE_MMX=1
RUN make -f makefile.linux FX_GLIDE_HW=cvg USE_X86=1 USE_MMX=0
RUN mv swlibs ../glide3x/
## glide3x
WORKDIR /usr/src/glide/glide3x/

View File

@@ -1,5 +1,94 @@
#!/bin/bash
ini_set_key() {
local file="$1"
local section="$2"
local key="$3"
local value="$4"
local tmp
tmp="${file}.tmp.$$"
awk -v section="$section" -v key="$key" -v value="$value" '
BEGIN {
in_section = 0
section_found = 0
key_done = 0
}
function flush_missing_key() {
if (in_section && !key_done) {
print key "=" value
key_done = 1
}
}
/^\[[^]]+\]$/ {
if (in_section) {
flush_missing_key()
in_section = 0
}
if ($0 == "[" section "]") {
in_section = 1
section_found = 1
}
print
next
}
{
if (in_section && $0 ~ ("^" key "=")) {
if (!key_done) {
print key "=" value
key_done = 1
}
next
}
print
}
END {
if (in_section) {
flush_missing_key()
}
if (!section_found) {
print "[" section "]"
print key "=" value
}
}' "$file" > "$tmp" && mv "$tmp" "$file"
}
ini_del_key() {
local file="$1"
local section="$2"
local key="$3"
local tmp
tmp="${file}.tmp.$$"
awk -v section="$section" -v key="$key" '
BEGIN {
in_section = 0
}
/^\[[^]]+\]$/ {
in_section = ($0 == "[" section "]")
print
next
}
{
if (in_section && $0 ~ ("^" key "=")) {
next
}
print
}' "$file" > "$tmp" && mv "$tmp" "$file"
}
GAME_BINARY="ut-bin"
SYSTEM_DIR="System"
@@ -91,16 +180,14 @@ if [ ! -f "${USER_UT_INI}" ]; then
echo "Failed to install renderer profile: ${RENDERER}"
exit 1
}
sed -i \
-e 's/^AudioDevice=ALAudio.ALAudioSubsystem$/AudioDevice=Audio.GenericAudioSubsystem/' \
-e 's/^CacheSizeMegs=4$/CacheSizeMegs=32/' \
-e 's/^FullscreenViewportX=640$/FullscreenViewportX=800/' \
-e 's/^FullscreenViewportY=480$/FullscreenViewportY=600/' \
-e 's/^UseSpatial=False$/UseSpatial=True/' \
-e 's/^UseReverb=False$/UseReverb=True/' \
-e 's/^OutputRate=22050Hz$/OutputRate=44100Hz/' \
-e 's/^ConfiguredInternetSpeed=20000$/ConfiguredInternetSpeed=25000/' \
"${USER_UT_INI}"
ini_set_key "${USER_UT_INI}" "Engine.Engine" "AudioDevice" "Audio.GenericAudioSubsystem"
ini_set_key "${USER_UT_INI}" "Core.System" "CacheSizeMegs" "32"
ini_set_key "${USER_UT_INI}" "WinDrv.WindowsClient" "FullscreenViewportX" "800"
ini_set_key "${USER_UT_INI}" "WinDrv.WindowsClient" "FullscreenViewportY" "600"
ini_set_key "${USER_UT_INI}" "Audio.GenericAudioSubsystem" "UseSpatial" "True"
ini_set_key "${USER_UT_INI}" "Audio.GenericAudioSubsystem" "UseReverb" "True"
ini_set_key "${USER_UT_INI}" "Audio.GenericAudioSubsystem" "OutputRate" "44100Hz"
ini_set_key "${USER_UT_INI}" "IpDrv.TcpNetDriver" "ConfiguredInternetSpeed" "25000"
if ! grep -q '^\[UBrowser\.UBrowserFavoritesFact\]$' "${USER_UT_INI}"; then
printf '%s\n' \
@@ -168,56 +255,29 @@ if [ ! -f "${USER_USER_INI}" ]; then
cp -f "${SYSTEM_DEFAULT_USER}" "${USER_USER_INI}"
set_random_ut_name "${USER_USER_INI}"
sed -i \
-e '/^Left=/d' \
-e '/^Up=/d' \
-e '/^Right=/d' \
-e '/^Down=/d' \
-e '/^Z=/d' \
-e '/^Q=/d' \
-e '/^S=/d' \
-e '/^D=/d' \
"${USER_USER_INI}"
ini_del_key "${USER_USER_INI}" "Engine.Input" "Left"
ini_del_key "${USER_USER_INI}" "Engine.Input" "Up"
ini_del_key "${USER_USER_INI}" "Engine.Input" "Right"
ini_del_key "${USER_USER_INI}" "Engine.Input" "Down"
ini_del_key "${USER_USER_INI}" "Engine.Input" "Z"
ini_del_key "${USER_USER_INI}" "Engine.Input" "Q"
ini_del_key "${USER_USER_INI}" "Engine.Input" "S"
ini_del_key "${USER_USER_INI}" "Engine.Input" "D"
printf '%s\n' \
'Z=MoveForward' \
'Q=StrafeLeft' \
'S=MoveBackward' \
'D=StrafeRight' \
>> "${USER_USER_INI}"
ini_set_key "${USER_USER_INI}" "Engine.Input" "Z" "MoveForward"
ini_set_key "${USER_USER_INI}" "Engine.Input" "Q" "StrafeLeft"
ini_set_key "${USER_USER_INI}" "Engine.Input" "S" "MoveBackward"
ini_set_key "${USER_USER_INI}" "Engine.Input" "D" "StrafeRight"
fi
trap "setxkbmap" EXIT
# games run better with US keyboard layout
OLD_XKB_LAYOUT=""
OLD_XKB_VARIANT=""
OLD_XKB_OPTIONS=""
restore_xkb() {
[ -n "$OLD_XKB_LAYOUT" ] && setxkbmap "$OLD_XKB_LAYOUT" >/dev/null 2>&1 || true
}
if [ -z "$NOUSLAYOUT" ] && command -v setxkbmap >/dev/null 2>&1; then
OLD_XKB_LAYOUT="$(setxkbmap -query 2>/dev/null | awk '$1=="layout:" {print $2}')"
OLD_XKB_VARIANT="$(setxkbmap -query 2>/dev/null | awk '$1=="variant:" {print $2}')"
OLD_XKB_OPTIONS="$(setxkbmap -query 2>/dev/null | awk '$1=="options:" {$1=""; sub(/^ /,""); print}')"
restore_xkb() {
if [ -n "$OLD_XKB_LAYOUT" ]; then
if [ -n "$OLD_XKB_VARIANT" ]; then
setxkbmap -layout "$OLD_XKB_LAYOUT" -variant "$OLD_XKB_VARIANT" >/dev/null 2>&1 || true
else
setxkbmap -layout "$OLD_XKB_LAYOUT" >/dev/null 2>&1 || true
fi
if [ -n "$OLD_XKB_OPTIONS" ]; then
setxkbmap -option "$OLD_XKB_OPTIONS" >/dev/null 2>&1 || true
else
setxkbmap -option >/dev/null 2>&1 || true
fi
fi
}
trap restore_xkb EXIT
setxkbmap -symbols 'us(pc101)'
fi
OLD_XKB_LAYOUT="$(setxkbmap -query 2>/dev/null | awk '$1=="layout:" {print $2}')"
trap restore_xkb EXIT
setxkbmap us >/dev/null 2>&1 || true
LD_LIBRARY_PATH="${GAME_SYSTEM_DIR}:${LD_LIBRARY_PATH}"
export LD_LIBRARY_PATH