Files
questshock/run-image.sh
T
ml 9d0a0d5798
build / build (push) Successful in 2m52s
Add engine-debug-tools and fix critter animation rendering bugs
- engine-debug-tools/: a debug dump hotkey + dump2png to inspect
  decoded critter frames independent of the renderer (see root
  README.md's "Debugging" section).
- engine-patches/04,05: fix critter sprite scale and an OpenGL
  texture cache collision, found using that tooling.
- mdlp: fix encodeFrames RLE-diffing upscaled frames against a
  previous-frame reference the real RSD8 decoder never implements
  (verified against Night Dive's original Mac source down to the
  68K assembly) - was rendering as scattered static in-game.
- Upscale pipeline: better color quantization (dithering, pure-ramp
  exclusion) and per-resource model selection.
2026-10-18 06:59:47 +02:00

66 lines
2.3 KiB
Bash
Executable File

#!/usr/bin/env bash
# Runs the build-image against the repo to compile engine/ (the vendored
# Shockolate snapshot), entirely offline - every dependency it needs
# (SDL2, SDL2_mixer, fluidsynth-lite, a MIDI soundfont) was already built
# into the image by ./build-image.sh.
#
# Output lands in engine/.build-output/ - run `make dist` afterwards to
# assemble it (together with the game assets from res/assets/ss_ee/) into
# dist/.
#
# Usage: ./run-image.sh [command...]
# With no arguments, runs the engine build. Pass a command (e.g. `bash`)
# to get a shell in the build environment instead, useful for debugging
# a failed build.
set -euo pipefail
cd "$(dirname "${BASH_SOURCE[0]}")"
ROOT="$(pwd)"
fail() { echo "PREFLIGHT FAIL: $*" >&2; exit 1; }
command -v docker >/dev/null 2>&1 \
|| fail "docker not found in PATH"
IMAGE="${REGISTRY_IMAGE:-questshock/builder}"
if [ -f "$ROOT/registry.env" ]; then
# shellcheck disable=SC1091
source "$ROOT/registry.env"
IMAGE="${REGISTRY_IMAGE:-$IMAGE}"
fi
IMAGE_TAG="$(<"$ROOT/build-image/VERSION")"
[ -n "$IMAGE_TAG" ] || fail "build-image/VERSION is empty"
IMAGE="$IMAGE:$IMAGE_TAG"
docker image inspect "$IMAGE" >/dev/null 2>&1 \
|| fail "$IMAGE not found locally - run ./build-image.sh first"
TTY_FLAGS="-i"
[ -t 1 ] && TTY_FLAGS="-it"
# HOST_REPO_ROOT: lets scripts running in the container (e.g.
# build-image/prepare-android-project.sh --host-paths) write paths that
# resolve on the HOST filesystem instead of this container's own
# /workspace - needed so a gradlew/Android Studio running natively on the
# host afterwards can find them. ENGINE_DEBUG_TOOLS: forwarded so the
# Makefile's dist_debug target can tell build-engine.sh to also apply
# engine-debug-tools/engine-patches/ (see root README.md's "Debugging"
# section) - empty/unset for every normal build.
# shellcheck disable=SC2086
docker run --rm $TTY_FLAGS \
-v "$ROOT:/workspace" \
-e HOST_UID="$(id -u)" \
-e HOST_GID="$(id -g)" \
-e HOST_REPO_ROOT="$ROOT" \
-e ENGINE_DEBUG_TOOLS="${ENGINE_DEBUG_TOOLS:-}" \
"$IMAGE" \
"$@"
if [ "$#" -eq 0 ]; then
echo
echo "This only compiled the engine (engine/.build-output/) - it does not"
echo "create dist/ by itself. Run 'make dist' next to assemble a runnable"
echo "copy (or 'make package' for a redistributable tarball)."
fi