From: Severin Meyer Date: Sat, 26 Mar 2016 01:31:47 +0000 (+0100) Subject: Update sources of medal icons for xonstat X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=2ed6eb817dc002ca98b8a3d1543d36593d55097d;p=xonotic%2Fmediasource.git Update sources of medal icons for xonstat --- diff --git a/gfx/medals/duel1.svg b/gfx/medals/duel1.svg deleted file mode 100644 index d7c892c..0000000 --- a/gfx/medals/duel1.svg +++ /dev/null @@ -1,63 +0,0 @@ - - - - - MMM - YY - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/gfx/medals/duel2.svg b/gfx/medals/duel2.svg deleted file mode 100644 index e2ddd12..0000000 --- a/gfx/medals/duel2.svg +++ /dev/null @@ -1,61 +0,0 @@ - - - - - MMM - YY - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/gfx/medals/duel3.svg b/gfx/medals/duel3.svg deleted file mode 100644 index 219f0f9..0000000 --- a/gfx/medals/duel3.svg +++ /dev/null @@ -1,59 +0,0 @@ - - - - - MMM - YY - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/gfx/medals/medal1.svg b/gfx/medals/medal1.svg new file mode 100644 index 0000000..d015c09 --- /dev/null +++ b/gfx/medals/medal1.svg @@ -0,0 +1,97 @@ + + + + + + + + + + + + MMM + YY + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/gfx/medals/medal2.svg b/gfx/medals/medal2.svg new file mode 100644 index 0000000..1fedb02 --- /dev/null +++ b/gfx/medals/medal2.svg @@ -0,0 +1,95 @@ + + + + + + + + + + + + MMM + YY + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/gfx/medals/medal3.svg b/gfx/medals/medal3.svg new file mode 100644 index 0000000..9eac15c --- /dev/null +++ b/gfx/medals/medal3.svg @@ -0,0 +1,93 @@ + + + + + + + + + + + + MMM + YY + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/gfx/medals/render.sh b/gfx/medals/render.sh index 75cd7f9..f5a9c3d 100755 --- a/gfx/medals/render.sh +++ b/gfx/medals/render.sh @@ -1,7 +1,7 @@ #!/bin/sh -e # TASK -# Insert date, render all svg files -# and compress the resulting png files. +# Insert date, make the selected gametype symbol visible, +# then render and optimize png files of the three medals. # # DEPENDENCIES # convert @@ -10,20 +10,33 @@ # advpng (Compresses with zopfli algorithm) # # USAGE -# ./render.sh MONTH(MMM) YEAR(YY) +# $0 SIZE(2^n, optimal=64) +# GAMETYPE(ca|ctf|cts|dm|dom|duel|ft|insta|ka|kh|lms|nb|ons|tdm|xonotic) \ +# MONTH(JAN|FEB|MAR|APR|MAY|JUN|JUL|AUG|SEP|OCT|NOV|DEC) \ +# YEAR(YY) -month="$1" -year="$2" +size="$1" +type="$2" +month="$3" +year="$4" mkdir -p "png" -for svg in *.svg; do - png="png/${svg%.*}.png" +for num in "1" "2" "3"; do + svg="medal$num.svg" + png="png/$size-$type-$year-${month,,}-$num.png" - sed -e "s|MMM|$month|" -e "s|YY|$year|" "$svg" | convert -background none - "$png" + # Render + sed -e "s|width=\"64\" height=\"64|width=\"$size\" height=\"$size|" \ + -e "s|id=\"$type\" opacity=\"0|id=\"$type\" opacity=\"1|" \ + -e "s|MMM|$month|" \ + -e "s|YY|$year|" "$svg" |\ + convert -background none - "$png" + + # Optimize pngquant --nofs --speed 1 --quality 70-75 --skip-if-larger --force --output "$png" "$png" optipng -o 5 -strip all "$png" advpng --recompress --shrink-insane -i 1000 "$png"