From: Mattia Basaglia Date: Thu, 5 Feb 2015 17:47:21 +0000 (+0100) Subject: Minigame texture sources X-Git-Tag: xonotic-v0.8.2~15^2~10 X-Git-Url: http://git.xonotic.org/?p=xonotic%2Fmediasource.git;a=commitdiff_plain;h=96c8baa82dfa97c54cc7a4b84269017c9e90ee15 Minigame texture sources The files gfx/minigames/*/piece*.xcf are by Snow_56767 --- diff --git a/gfx/minigames/build.sh b/gfx/minigames/build.sh new file mode 100755 index 0000000..49e0e4a --- /dev/null +++ b/gfx/minigames/build.sh @@ -0,0 +1,120 @@ +#!/bin/bash + +CONVERT=convert +SED="sed -r" +MKDIR="mkdir -p" + +OUT_DIR=/tmp/minigames +JPEG_QUALITY=75 +TEXTURE_SIZE=2048 +FORMAT=png + +# Converts images into $FORMAT +# Synopsis: convert_image input.png output +# Genreates output.jpg and output_alpha.jpg +function convert_image() +{ + local covert_flags="-layers flatten" + if [ "$FORMAT" = "jpg" ] + then + covert_flags="$covert_flags -quality $JPEG_QUALITY" + fi + convert -background none "$1" $covert_flags "$2.$FORMAT" + if [ "$FORMAT" = "jpg" ] + then + convert -background none "$1" $covert_flags -alpha Extract "$2_alpha.jpg" + fi +} + +# Ensure that the output jpg are of the appropriate size +# Synopsis: scale_image output +# Where "output" is the same as $2 in convert_image +function scale_image() +{ + let max_w=$TEXTURE_SIZE + + if echo -n "$1" | grep -q ".*/piece.*" + then + let max_w/=4 + fi + + if [ "$max_w" -gt 0 ] + then + let img_w=$(identify -format %w "$1.$FORMAT") + if [ "$img_w" -gt "$max_w" ] + then + local scale=$(echo "scale=10; $max_w/$img_w*100" | bc) + convert "$1.$FORMAT" -resize "$scale%" "$1.$FORMAT" + if [ "$FORMAT" = "jpg" ] + then + convert "$1_alpha.jpg" -resize "$scale%" "$1_alpha.jpg" + fi + fi + fi +} + +# Create the files for packaging +function generate() +{ + for src_file in $(git ls-files) + do + local out_dir="$OUT_DIR/gfx/hud/default/" + local out_file="$out_dir/$src_file" + $MKDIR "$out_dir/$(dirname "$src_file")" + + local file_extension="$(echo "$src_file" | sed -r "s/^(.*)\.([^.]+)$/\2/")" + local base_file="$(echo "$out_file" | sed -r "s/^(.*)\.([^.]+)$/\1/")" + + if echo -n "$file_extension" | grep -Eq "^(png|svg|tga|xcf)$" && + [ "$file_extension" != "$FORMAT" ] + then + out_file="$base_file.$FORMAT" + echo "$base_file" + if [ "$src_file" -nt "$out_file" ] + then + echo -e "Compressing \x1b[1m$src_file\x1b[0m" + convert_image "$src_file" "$base_file" + scale_image "$base_file" + continue + fi + elif [ "$src_file" -nt "$out_file" ] + then + echo -e "Copying \x1b[1m$src_file\x1b[0m" + cp -T "$src_file" "$out_file" + continue + fi + + echo -e "Skipping \x1b[1m$src_file\x1b[0m" + + done +} + +SYSTEM_NAME=$(uname) +if [ "$SYSTEM_NAME" = Darwin -o "$SYSTEM_NAME" = FreeBSD ] +then + SED="sed -E" +fi + + +$MKDIR "$OUT_DIR" + + +while [ "$1" ] +do + case $1 in + help|-h|--help) + echo TODO + exit + ;; + clean) + echo -e "Removing old files" + [ -n "$OUT_DIR" -a -e "$OUT_DIR" ] && rm -rf "$OUT_DIR" + ;; + *) + echo 1>&2 "Unknown option: $1" + ;; + esac + shift +done + +generate diff --git a/gfx/minigames/nmm/board.svg b/gfx/minigames/nmm/board.svg new file mode 100644 index 0000000..46b0170 --- /dev/null +++ b/gfx/minigames/nmm/board.svg @@ -0,0 +1,1379 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/gfx/minigames/nmm/icon.svg b/gfx/minigames/nmm/icon.svg new file mode 100644 index 0000000..e1fe59e --- /dev/null +++ b/gfx/minigames/nmm/icon.svg @@ -0,0 +1,250 @@ + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/gfx/minigames/nmm/icon_notif.svg b/gfx/minigames/nmm/icon_notif.svg new file mode 100644 index 0000000..ea4a9ce --- /dev/null +++ b/gfx/minigames/nmm/icon_notif.svg @@ -0,0 +1,221 @@ + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/gfx/minigames/nmm/piece1.xcf b/gfx/minigames/nmm/piece1.xcf new file mode 100644 index 0000000..f56a7f4 Binary files /dev/null and b/gfx/minigames/nmm/piece1.xcf differ diff --git a/gfx/minigames/nmm/piece2.xcf b/gfx/minigames/nmm/piece2.xcf new file mode 100644 index 0000000..848eaa8 Binary files /dev/null and b/gfx/minigames/nmm/piece2.xcf differ diff --git a/gfx/minigames/nmm/tile_active.svg b/gfx/minigames/nmm/tile_active.svg new file mode 100644 index 0000000..f24f976 --- /dev/null +++ b/gfx/minigames/nmm/tile_active.svg @@ -0,0 +1,107 @@ + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + diff --git a/gfx/minigames/nmm/tile_available.svg b/gfx/minigames/nmm/tile_available.svg new file mode 100644 index 0000000..8208667 --- /dev/null +++ b/gfx/minigames/nmm/tile_available.svg @@ -0,0 +1,122 @@ + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + diff --git a/gfx/minigames/nmm/tile_selected.svg b/gfx/minigames/nmm/tile_selected.svg new file mode 100644 index 0000000..af0bc62 --- /dev/null +++ b/gfx/minigames/nmm/tile_selected.svg @@ -0,0 +1,122 @@ + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + diff --git a/gfx/minigames/ttt/board.svg b/gfx/minigames/ttt/board.svg new file mode 100644 index 0000000..3ddb560 --- /dev/null +++ b/gfx/minigames/ttt/board.svg @@ -0,0 +1,844 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/gfx/minigames/ttt/icon.svg b/gfx/minigames/ttt/icon.svg new file mode 100644 index 0000000..b049e95 --- /dev/null +++ b/gfx/minigames/ttt/icon.svg @@ -0,0 +1,136 @@ + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + diff --git a/gfx/minigames/ttt/icon_notif.svg b/gfx/minigames/ttt/icon_notif.svg new file mode 100644 index 0000000..68552e2 --- /dev/null +++ b/gfx/minigames/ttt/icon_notif.svg @@ -0,0 +1,132 @@ + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + diff --git a/gfx/minigames/ttt/piece1.xcf b/gfx/minigames/ttt/piece1.xcf new file mode 100644 index 0000000..83ec8aa Binary files /dev/null and b/gfx/minigames/ttt/piece1.xcf differ diff --git a/gfx/minigames/ttt/piece2.xcf b/gfx/minigames/ttt/piece2.xcf new file mode 100644 index 0000000..45a6c87 Binary files /dev/null and b/gfx/minigames/ttt/piece2.xcf differ diff --git a/gfx/minigames/ttt/winglow.svg b/gfx/minigames/ttt/winglow.svg new file mode 100644 index 0000000..936890a --- /dev/null +++ b/gfx/minigames/ttt/winglow.svg @@ -0,0 +1,106 @@ + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + +