spacetaxi/tools/stsim/celGate.sh
2026-10-05 18:50:09 -05:00

29 lines
1.1 KiB
Bash
Executable file

#!/usr/bin/env bash
# Cel gate for Space Taxi: every level cel a recorded ride DISPLAYS must be
# in the level's baked manifest (stLevelCelList in stLevelCels.c), or the
# real ports build it mid-ride and draw it interpreted -- the "compiling
# sprites on the fly" hitch. Runs the same rides gate.sh does with the
# stsim census (STSIM_CELS=1) and fails on any MISSING line.
#
# celGate.sh check every hook level
set -u
here=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)
source "$here/gateLib.sh"
fail=0
for p in $pairs; do
l=${p%%:*}; n=${p##*:}
out=$(STSIM_CELS=1 "$here/stsim" "$levels/level$n.dat" "$l" "$ticks" 2>&1 >/dev/null | grep -E '^(CEL|CENSUS)')
missing=$(echo "$out" | grep -c '^CEL MISSING')
census=$(echo "$out" | grep '^CENSUS' | sed 's/^CENSUS //')
if [ "$missing" -ne 0 ]; then
printf ' %s: *** %s cel(s) shown but not baked *** (%s)\n' "$l" "$missing" "$census"
echo "$out" | grep '^CEL MISSING' | sed 's/^/ /'
fail=1
else
printf ' %s: ok (%s)\n' "$l" "$census"
fi
done
[ $fail -eq 0 ] && echo "celGate: PASS" || echo "celGate: FAIL"
exit $fail