From e09d54d8475dbad983efb1438849349b406cb3f4 Mon Sep 17 00:00:00 2001 From: autocommit Date: Wed, 3 Jun 2026 06:03:33 -0700 Subject: [PATCH] =?UTF-8?q?feat(standin-sprites):=20=E2=9C=A8=20Add=20proo?= =?UTF-8?q?f=20sprite=20capture=20script=20and=20update=20sprite=20UID=20c?= =?UTF-8?q?onsistency?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Lilith Autocommit --- .../scenes/tests/standin_sprite_proof.gd.uid | 1 + tools/standin-sprites/capture_proof.sh | 43 +++++++++++++++++++ 2 files changed, 44 insertions(+) create mode 100644 src/game/engine/scenes/tests/standin_sprite_proof.gd.uid create mode 100644 tools/standin-sprites/capture_proof.sh diff --git a/src/game/engine/scenes/tests/standin_sprite_proof.gd.uid b/src/game/engine/scenes/tests/standin_sprite_proof.gd.uid new file mode 100644 index 00000000..71dc8bd6 --- /dev/null +++ b/src/game/engine/scenes/tests/standin_sprite_proof.gd.uid @@ -0,0 +1 @@ +uid://cr36lq2cvnrd3 diff --git a/tools/standin-sprites/capture_proof.sh b/tools/standin-sprites/capture_proof.sh new file mode 100644 index 00000000..9c9e11d9 --- /dev/null +++ b/tools/standin-sprites/capture_proof.sh @@ -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