#!/usr/bin/env bash
# dmmotor: rebuilds the pictures of the web site (site/images) and assets/thumbnail.png from the game itself.
# Run from anywhere; needs Docker (bin/jumphp) and python3 with Pillow.
set -euo pipefail
ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/../../../.." && pwd)"
cd "$ROOT"
bin/jumphp test dmmotor                                   # the game tests save their last frame
bin/jumphp shot dmmotor 60 var/screenshots/site/title.png  # the title screen
JUMPHP_SCENE='App\Scene\PlayScene' JUMPHP_SCENE_PARAMS='{"demo":true,"episode":1,"map":2}' \
  bin/jumphp shot dmmotor 40 var/screenshots/site/e1m2.png
python3 games/dmmotor/tools/site/make-images.py
