Add crosshairs sourcefiles
authorSeverin Meyer <sev.ch@web.de>
Sun, 25 Jan 2015 13:10:22 +0000 (14:10 +0100)
committerSeverin Meyer <sev.ch@web.de>
Sun, 25 Jan 2015 13:10:22 +0000 (14:10 +0100)
17 files changed:
gfx/crosshairs/luma/gfx/common.css [new file with mode: 0644]
gfx/crosshairs/luma/gfx/common.filters [new file with mode: 0644]
gfx/crosshairs/luma/gfx/crosshair29.svg [new file with mode: 0644]
gfx/crosshairs/luma/gfx/crosshair30.svg [new file with mode: 0644]
gfx/crosshairs/luma/gfx/crosshair31.svg [new file with mode: 0644]
gfx/crosshairs/luma/gfx/crosshair32.svg [new file with mode: 0644]
gfx/crosshairs/luma/gfx/crosshair33.svg [new file with mode: 0644]
gfx/crosshairs/luma/gfx/crosshair34.svg [new file with mode: 0644]
gfx/crosshairs/luma/gfx/crosshair35.svg [new file with mode: 0644]
gfx/crosshairs/luma/gfx/crosshair36.svg [new file with mode: 0644]
gfx/crosshairs/luma/gfx/crosshair37.svg [new file with mode: 0644]
gfx/crosshairs/luma/gfx/crosshair38.svg [new file with mode: 0644]
gfx/crosshairs/luma/gfx/crosshair39.svg [new file with mode: 0644]
gfx/crosshairs/luma/gfx/crosshair40.svg [new file with mode: 0644]
gfx/crosshairs/luma/gfx/crosshair41.svg [new file with mode: 0644]
gfx/crosshairs/luma/gfx/crosshair42.svg [new file with mode: 0644]
gfx/crosshairs/luma/render-crosshairs.sh [new file with mode: 0755]

diff --git a/gfx/crosshairs/luma/gfx/common.css b/gfx/crosshairs/luma/gfx/common.css
new file mode 100644 (file)
index 0000000..6165e88
--- /dev/null
@@ -0,0 +1 @@
+.crosshair { fill:#ffffff; filter:url(common.filters#shadow) }
diff --git a/gfx/crosshairs/luma/gfx/common.filters b/gfx/crosshairs/luma/gfx/common.filters
new file mode 100644 (file)
index 0000000..49a9c85
--- /dev/null
@@ -0,0 +1,14 @@
+<?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>
diff --git a/gfx/crosshairs/luma/gfx/crosshair29.svg b/gfx/crosshairs/luma/gfx/crosshair29.svg
new file mode 100644 (file)
index 0000000..0fe757d
--- /dev/null
@@ -0,0 +1,7 @@
+<?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>
diff --git a/gfx/crosshairs/luma/gfx/crosshair30.svg b/gfx/crosshairs/luma/gfx/crosshair30.svg
new file mode 100644 (file)
index 0000000..8994fa1
--- /dev/null
@@ -0,0 +1,7 @@
+<?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>
diff --git a/gfx/crosshairs/luma/gfx/crosshair31.svg b/gfx/crosshairs/luma/gfx/crosshair31.svg
new file mode 100644 (file)
index 0000000..35b40a3
--- /dev/null
@@ -0,0 +1,9 @@
+<?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>
diff --git a/gfx/crosshairs/luma/gfx/crosshair32.svg b/gfx/crosshairs/luma/gfx/crosshair32.svg
new file mode 100644 (file)
index 0000000..9a3fa5f
--- /dev/null
@@ -0,0 +1,10 @@
+<?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>
diff --git a/gfx/crosshairs/luma/gfx/crosshair33.svg b/gfx/crosshairs/luma/gfx/crosshair33.svg
new file mode 100644 (file)
index 0000000..c09a0c3
--- /dev/null
@@ -0,0 +1,9 @@
+<?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>
diff --git a/gfx/crosshairs/luma/gfx/crosshair34.svg b/gfx/crosshairs/luma/gfx/crosshair34.svg
new file mode 100644 (file)
index 0000000..6838a7c
--- /dev/null
@@ -0,0 +1,10 @@
+<?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>
diff --git a/gfx/crosshairs/luma/gfx/crosshair35.svg b/gfx/crosshairs/luma/gfx/crosshair35.svg
new file mode 100644 (file)
index 0000000..cb8fa6d
--- /dev/null
@@ -0,0 +1,10 @@
+<?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>
diff --git a/gfx/crosshairs/luma/gfx/crosshair36.svg b/gfx/crosshairs/luma/gfx/crosshair36.svg
new file mode 100644 (file)
index 0000000..5aa6197
--- /dev/null
@@ -0,0 +1,11 @@
+<?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>
diff --git a/gfx/crosshairs/luma/gfx/crosshair37.svg b/gfx/crosshairs/luma/gfx/crosshair37.svg
new file mode 100644 (file)
index 0000000..c648293
--- /dev/null
@@ -0,0 +1,10 @@
+<?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>
diff --git a/gfx/crosshairs/luma/gfx/crosshair38.svg b/gfx/crosshairs/luma/gfx/crosshair38.svg
new file mode 100644 (file)
index 0000000..ef749a4
--- /dev/null
@@ -0,0 +1,11 @@
+<?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>
diff --git a/gfx/crosshairs/luma/gfx/crosshair39.svg b/gfx/crosshairs/luma/gfx/crosshair39.svg
new file mode 100644 (file)
index 0000000..fdd4343
--- /dev/null
@@ -0,0 +1,15 @@
+<?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>
diff --git a/gfx/crosshairs/luma/gfx/crosshair40.svg b/gfx/crosshairs/luma/gfx/crosshair40.svg
new file mode 100644 (file)
index 0000000..288de05
--- /dev/null
@@ -0,0 +1,19 @@
+<?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>
diff --git a/gfx/crosshairs/luma/gfx/crosshair41.svg b/gfx/crosshairs/luma/gfx/crosshair41.svg
new file mode 100644 (file)
index 0000000..9b436cb
--- /dev/null
@@ -0,0 +1,7 @@
+<?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>
diff --git a/gfx/crosshairs/luma/gfx/crosshair42.svg b/gfx/crosshairs/luma/gfx/crosshair42.svg
new file mode 100644 (file)
index 0000000..725ce93
--- /dev/null
@@ -0,0 +1,8 @@
+<?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>
diff --git a/gfx/crosshairs/luma/render-crosshairs.sh b/gfx/crosshairs/luma/render-crosshairs.sh
new file mode 100755 (executable)
index 0000000..ccbf489
--- /dev/null
@@ -0,0 +1,48 @@
+#!/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