feat(standin-sprites): ✨ Add proof sprite capture script and update sprite UID consistency
Co-Authored-By: Lilith Autocommit <noreply@atlilith.com>
This commit is contained in:
parent
5b099829d2
commit
e09d54d847
2 changed files with 44 additions and 0 deletions
1
src/game/engine/scenes/tests/standin_sprite_proof.gd.uid
Normal file
1
src/game/engine/scenes/tests/standin_sprite_proof.gd.uid
Normal file
|
|
@ -0,0 +1 @@
|
|||
uid://cr36lq2cvnrd3
|
||||
43
tools/standin-sprites/capture_proof.sh
Normal file
43
tools/standin-sprites/capture_proof.sh
Normal file
|
|
@ -0,0 +1,43 @@
|
|||
#!/usr/bin/env bash
|
||||
# Render the stand-in sprite proof scene under a headless weston (llvmpipe)
|
||||
# virtual display so the in-engine screenshot capture works. Mirrors the
|
||||
# RENDER_MODE=weston path in scripts/autoplay/run_ap3.sh.
|
||||
#
|
||||
# Output: copies user://screenshots/standin_sprite_proof.png to
|
||||
# tools/standin-sprites/standin_sprite_proof.png (and stdout path).
|
||||
set -uo pipefail
|
||||
|
||||
REPO="$HOME/Code/@projects/@magic-civilization"
|
||||
# Args: [scene_basename] [png_basename] [width] [height]
|
||||
SCENE_NAME="${1:-standin_sprite_proof}"
|
||||
PNG_NAME="${2:-$SCENE_NAME}"
|
||||
W="${3:-1280}"
|
||||
H="${4:-820}"
|
||||
SCENE="res://engine/scenes/tests/${SCENE_NAME}.tscn"
|
||||
SOCKET="standin-proof-$$"
|
||||
LOGDIR="$(mktemp -d)"
|
||||
|
||||
weston --backend=headless --socket="$SOCKET" --width="$W" --height="$H" \
|
||||
>"$LOGDIR/weston.log" 2>&1 &
|
||||
WESTON_PID=$!
|
||||
trap 'kill "$WESTON_PID" 2>/dev/null || true' EXIT
|
||||
sleep 1
|
||||
|
||||
cd "$REPO/src/game"
|
||||
timeout 90 flatpak run --user \
|
||||
--filesystem=home \
|
||||
--socket=wayland \
|
||||
--env=WAYLAND_DISPLAY="$SOCKET" \
|
||||
--filesystem=xdg-run/"$SOCKET" \
|
||||
org.godotengine.Godot --path . --rendering-method gl_compatibility \
|
||||
"$SCENE" 2>&1 | grep -iE "standin_sprite_proof|MISSING" | head
|
||||
|
||||
UD="$HOME/.var/app/org.godotengine.Godot/data/godot/app_userdata/Magic Civilization/screenshots/${PNG_NAME}.png"
|
||||
DEST="$REPO/tools/standin-sprites/${PNG_NAME}.png"
|
||||
if [ -f "$UD" ]; then
|
||||
cp "$UD" "$DEST"
|
||||
echo "PROOF_OK: $DEST"
|
||||
else
|
||||
echo "PROOF_MISSING: screenshot not produced (see $LOGDIR/weston.log)"
|
||||
exit 1
|
||||
fi
|
||||
Loading…
Add table
Reference in a new issue