From 881746789a489fad85aae8317555f73dbe261556 Mon Sep 17 00:00:00 2001 From: Franklin Wei Date: Sat, 29 Apr 2017 18:21:56 -0400 Subject: puzzles: refactor and resync with upstream This brings puzzles up-to-date with upstream revision 2d333750272c3967cfd5cd3677572cddeaad5932, though certain changes made by me, including cursor-only Untangle and some compilation fixes remain. Upstream code has been moved to its separate subdirectory and future syncs can be done by simply copying over the new sources. Change-Id: Ia6506ca5f78c3627165ea6791d38db414ace0804 --- apps/plugins/puzzles/src/icons/screenshot.sh | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100755 apps/plugins/puzzles/src/icons/screenshot.sh (limited to 'apps/plugins/puzzles/src/icons/screenshot.sh') diff --git a/apps/plugins/puzzles/src/icons/screenshot.sh b/apps/plugins/puzzles/src/icons/screenshot.sh new file mode 100755 index 0000000000..0e2a06eea7 --- /dev/null +++ b/apps/plugins/puzzles/src/icons/screenshot.sh @@ -0,0 +1,25 @@ +#!/bin/sh + +# Generate a screenshot from a puzzle save file. Takes the +# following arguments, in order: +# +# - the name of the puzzle binary +# - the name of the save file +# - the name of the output image file +# - (optionally) the proportion of the next move to redo before +# taking the screenshot. +# +# This script requires access to an X server in order to run, but +# seems to work fine under xvfb-run if you haven't got a real one +# available (or if you don't want to use it for some reason). + +binary="$1" +save="$2" +image="$3" +if test "x$4" != "x"; then + redo="--redo $4" +else + redo= +fi + +"$binary" $redo --screenshot "$image" --load "$save" -- cgit v1.2.3