--- /dev/null
+.crosshair { fill:#ffffff; filter:url(common.filters#shadow) }
--- /dev/null
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<svg xmlns="http://www.w3.org/2000/svg" version="1.1" width="64" height="64">
+ <defs>
+ <filter id="shadow" x="-1" y="-1" width="3" height="3">
+ <feMorphology operator="dilate" radius="1" in="SourceAlpha"/>
+ <feColorMatrix values="1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 0.7 0"/>
+ <feGaussianBlur stdDeviation="1" result="shadow"/>
+ <feMerge>
+ <feMergeNode in="shadow"/>
+ <feMergeNode in="SourceGraphic"/>
+ </feMerge>
+ </filter>
+ </defs>
+</svg>
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<?xml-stylesheet href="common.css" type="text/css"?>
+<svg xmlns="http://www.w3.org/2000/svg" version="1.1" width="64" height="64">
+ <g class="crosshair">
+ <path d="M 32,32 18,46 19.5,47.5 32,35 44.5,47.5 46,46 z"/>
+ </g>
+</svg>
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<?xml-stylesheet href="common.css" type="text/css"?>
+<svg xmlns="http://www.w3.org/2000/svg" version="1.1" width="64" height="64">
+ <g class="crosshair">
+ <path d="m 31,14 0,17 -17,0 0,2 17,0 0,17 2,0 0,-17 17,0 0,-2 -17,0 0,-17 z"/>
+ </g>
+</svg>
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<?xml-stylesheet href="common.css" type="text/css"?>
+<svg xmlns="http://www.w3.org/2000/svg" version="1.1" width="64" height="64">
+ <g class="crosshair">
+ <rect x="31" y="8" width="2" height="16"/>
+ <rect x="31" y="7" width="2" height="17" transform="matrix(-0.5,0.866,-0.866,-0.5,75.7,20.3)"/>
+ <rect x="31" y="7" width="2" height="17" transform="matrix(-0.5,-0.866,0.866,-0.5,20.3,75.7)"/>
+ </g>
+</svg>
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<?xml-stylesheet href="common.css" type="text/css"?>
+<svg xmlns="http://www.w3.org/2000/svg" version="1.1" width="64" height="64">
+ <g class="crosshair">
+ <rect x="31" y="31" width="2" height="2"/>
+ <rect x="31" y="8" width="2" height="16"/>
+ <rect x="31" y="7" width="2" height="17" transform="matrix(-0.5,0.866,-0.866,-0.5,75.7,20.3)"/>
+ <rect x="31" y="7" width="2" height="17" transform="matrix(-0.5,-0.866,0.866,-0.5,20.3,75.7)"/>
+ </g>
+</svg>
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<?xml-stylesheet href="common.css" type="text/css"?>
+<svg xmlns="http://www.w3.org/2000/svg" version="1.1" width="64" height="64">
+ <g class="crosshair">
+ <rect x="40" y="31" width="16" height="2"/>
+ <rect x="31" y="40" width="2" height="16"/>
+ <rect x="8" y="31" width="16" height="2"/>
+ </g>
+</svg>
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<?xml-stylesheet href="common.css" type="text/css"?>
+<svg xmlns="http://www.w3.org/2000/svg" version="1.1" width="64" height="64">
+ <g class="crosshair">
+ <rect x="31" y="31" width="2" height="2"/>
+ <rect x="40" y="31" width="16" height="2"/>
+ <rect x="31" y="40" width="2" height="16"/>
+ <rect x="8" y="31" width="16" height="2"/>
+ </g>
+</svg>
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<?xml-stylesheet href="common.css" type="text/css"?>
+<svg xmlns="http://www.w3.org/2000/svg" version="1.1" width="64" height="64">
+ <g class="crosshair">
+ <rect x="31" y="8" width="2" height="16"/>
+ <rect x="40" y="31" width="16" height="2"/>
+ <rect x="31" y="40" width="2" height="16"/>
+ <rect x="8" y="31" width="16" height="2"/>
+ </g>
+</svg>
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<?xml-stylesheet href="common.css" type="text/css"?>
+<svg xmlns="http://www.w3.org/2000/svg" version="1.1" width="64" height="64">
+ <g class="crosshair">
+ <rect x="31" y="31" width="2" height="2"/>
+ <rect x="31" y="8" width="2" height="16"/>
+ <rect x="40" y="31" width="16" height="2"/>
+ <rect x="31" y="40" width="2" height="16"/>
+ <rect x="8" y="31" width="16" height="2"/>
+ </g>
+</svg>
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<?xml-stylesheet href="common.css" type="text/css"?>
+<svg xmlns="http://www.w3.org/2000/svg" version="1.1" width="64" height="64">
+ <g class="crosshair">
+ <path d="m 27,25.5 -12,-12 -1.5,1.5 12,12 z"/>
+ <path d="m 37,25.5 12,-12 1.5,1.5 -12,12 z"/>
+ <path d="m 37,38.5 12,12 1.5,-1.5 -12,-12 z"/>
+ <path d="M 27,38.5 15,50.5 13.5,49 25.5,37 z"/>
+ </g>
+</svg>
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<?xml-stylesheet href="common.css" type="text/css"?>
+<svg xmlns="http://www.w3.org/2000/svg" version="1.1" width="64" height="64">
+ <g class="crosshair">
+ <rect x="31" y="31" width="2" height="2"/>
+ <path d="m 27,25.5 -12,-12 -1.5,1.5 12,12 z"/>
+ <path d="m 37,25.5 12,-12 1.5,1.5 -12,12 z"/>
+ <path d="m 37,38.5 12,12 1.5,-1.5 -12,-12 z"/>
+ <path d="M 27,38.5 15,50.5 13.5,49 25.5,37 z"/>
+ </g>
+</svg>
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<?xml-stylesheet href="common.css" type="text/css"?>
+<svg xmlns="http://www.w3.org/2000/svg" version="1.1" width="64" height="64">
+ <defs>
+ <clipPath id="clip">
+ <rect x="0" y="0" width="26" height="26"/>
+ <rect y="0" x="38" width="26" height="26"/>
+ <rect x="38" y="38" width="26" height="26"/>
+ <rect y="38" x="0" width="26" height="26"/>
+ </clipPath>
+ </defs>
+ <g class="crosshair">
+ <path clip-path="url(#clip)" d="m 54,32 a 22,22 0 1 0 -44,0 22,22 0 1 0 44,0 z m 2,0 a 24,24 0 0 1 -48,0 24,24 0 1 1 48,0 z"/>
+ </g>
+</svg>
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<?xml-stylesheet href="common.css" type="text/css"?>
+<svg xmlns="http://www.w3.org/2000/svg" version="1.1" width="64" height="64">
+ <defs>
+ <clipPath id="clip">
+ <rect x="0" y="0" width="26" height="26"/>
+ <rect y="0" x="38" width="26" height="26"/>
+ <rect x="38" y="38" width="26" height="26"/>
+ <rect y="38" x="0" width="26" height="26"/>
+ </clipPath>
+ </defs>
+ <g class="crosshair">
+ <path clip-path="url(#clip)" d="m 54,32 a 22,22 0 1 0 -44,0 22,22 0 1 0 44,0 z m 2,0 a 24,24 0 0 1 -48,0 24,24 0 1 1 48,0 z"/>
+ <rect x="31" y="8" width="2" height="16"/>
+ <rect x="40" y="31" width="16" height="2"/>
+ <rect x="31" y="40" width="2" height="16"/>
+ <rect x="8" y="31" width="16" height="2"/>
+ </g>
+</svg>
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<?xml-stylesheet href="common.css" type="text/css"?>
+<svg xmlns="http://www.w3.org/2000/svg" version="1.1" width="64" height="64">
+ <g class="crosshair">
+ <path d="m 54,32 a 22,22 0 1 0 -44,0 22,22 0 1 0 44,0 z m 2,0 a 24,24 0 0 1 -48,0 24,24 0 1 1 48,0 z"/>
+ </g>
+</svg>
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<?xml-stylesheet href="common.css" type="text/css"?>
+<svg xmlns="http://www.w3.org/2000/svg" version="1.1" width="64" height="64">
+ <g class="crosshair">
+ <rect x="31" y="31" width="2" height="2"/>
+ <path d="m 54,32 a 22,22 0 1 0 -44,0 22,22 0 1 0 44,0 z m 2,0 a 24,24 0 0 1 -48,0 24,24 0 1 1 48,0 z"/>
+ </g>
+</svg>
--- /dev/null
+#!/bin/sh -e
+# TASK
+# Render crosshairs from gfx/crosshair*.svg to DATADIR/gfx/crosshair*.tga,
+# if they are newer than their target tga file.
+#
+# NOTES
+# To compensate for filter rendering errors and to reduce rbg noise,
+# the svg files are rendered at a large size and then scaled down.
+#
+# DEPENDENCIES
+# librsvg
+# imagemagick
+#
+# USAGE
+# ./render-svg.sh DATADIR
+#
+# USAGE EXAMPLE
+# ./render-crosshairs.sh ~/.xonotic/data
+
+
+# Check for argument
+if [ -z "$1" ]; then
+ echo "Usage: $0 DATADIR"
+ exit 1
+fi
+
+
+data="$1"; shift
+maxScale=8
+maxPixels=100000000
+
+
+for svg in gfx/*.svg; do
+ ext="${svg##*.}"
+ dir="$data/${svg%/*}"
+ tga="$data/${svg%.*}.tga"
+
+ if [ "$ext" = "svg" ] && [ -f "$svg" ] && [ "$svg" -nt "$tga" ]; then
+ echo "Rendering $tga"
+
+ w=$(identify -format "%w" "$svg")
+ h=$(identify -format "%h" "$svg")
+ scale=$(echo "s=sqrt($maxPixels/$w/$h);if(s>$maxScale)s=$maxScale;s" | bc)
+
+ mkdir -p "$dir"
+ rsvg-convert -z "$scale" "$svg" | convert - -scale "$w" "$tga"
+ fi
+done