view scripts/tileset-composer.sh @ 619:4ffa9d159588

Some coordinate operators, to reduce foo_x, foo_y everywhere.
author Jeremy Thurgood <firxen@gmail.com>
date Fri, 06 May 2011 16:37:43 +0200
parents 9a0f0ea687da
children
line wrap: on
line source

#!/bin/bash

xcffile=$1
shift

function make_tiles(){
    local background=$1
    mkdir -p $background
    for piece in "floor" "wall" "wall-end-"{"t","b",""}{"l","r"} "floor-"{"start","end"}"-"{"l","r"} "arch-"{"l","r"}
    do
        xcf2png $xcffile "$piece" "$background" --mode Screen > $background/"$piece.png"
    done
}

if [ $# -gt 0 ]
then
    for background in $*
    do
        make_tiles $background
    done
else
    for background in "fan_gold" "fan_green" "red" "blue" "flower_dark" "flower_light"
    do
        make_tiles $background
    done
fi