set -e
cd ..
-git clean -xdf
+make clean || true
sh autogen.sh
./configure --prefix="`pwd`/tests" CXXFLAGS="-O3"
make
make install
cd tests
-mkdir -p html
+rm -rf html
+rm *.dds
+mkdir html
exec 3>html/index.html
html_start()
{
# downloads a texture from Xonotic
if ! [ -f "$2" ]; then
- wget -qO- "http://git.xonotic.org/?p=xonotic/xonotic-maps.pk3dir.git;a=blob;f=$1" | convert - -geometry 512x512 "$2"
+ wget -O- "http://git.xonotic.org/?p=xonotic/xonotic-maps.pk3dir.git;a=blob_plain;f=$1" | convert "${1##*.}":- -geometry 512x512 "$2"
fi
}
# floor_tread01: GPLv2+
-xon textures/exx/floor/floor_tread01.tga floor-tread01.tga
+xon textures/exx/floor/floor_tread01.tga floor_tread01.tga
# floor_tread01_norm: GPLv2+
-xon textures/exx/floor/floor_tread01_norm.tga floor-tread01_norm.tga
+xon textures/exx/floor/floor_tread01_norm.tga floor_tread01_norm_dxt3.tga
+xon textures/exx/floor/floor_tread01_norm.tga floor_tread01_norm_dxt5.tga
# base_concrete1a: GPLv2+
xon textures/trak4x/base/base_concrete1a.tga base_concrete1a.tga
# disabled: GPLv2+
xon env/distant_sunset/distant_sunset_rt.jpg sunset.tga
# amelia: no license
if ! [ -f "amelia.tga" ]; then
- wget -qO- "http://www.godoon.com/gallery/media/slayers/amelia-wil-tesla-saillune/49212997-d81e-11df-8228-a8bfc396a36f.jpg" | convert JPG:- amelia.tga
+ wget -O- "http://www.godoon.com/gallery/media/slayers/amelia-wil-tesla-saillune/49212997-d81e-11df-8228-a8bfc396a36f.jpg" | convert JPG:- amelia.tga
fi
-
-for i in dxtfail floor_tread01 floor_tread01_norm fract001 base_concrete1a disabled floor_tile3a lift02 sunset amelia noise noise_solid supernova; do
+for i in dxtfail floor_tread01 floor_tread01_norm_dxt5 floor_tread01_norm_dxt3 fract001 base_concrete1a disabled floor_tile3a lift02 sunset amelia noise noise_solid supernova; do
html_rowstart "$i"
html "$i".tga
case "$i" in
- *_norm)
+ *_norm*)
+ goodmetric=NORMALMAP
+ ;;
+ *)
+ goodmetric=SRGB_MIXED
+ ;;
+ esac
+ case "$i" in
+ *_dxt5)
fourcc=DXT5
nvopts="-bc3 -alpha"
;;
+ *_dxt3)
+ fourcc=DXT3
+ nvopts="-bc2 -alpha"
+ ;;
*)
fourcc=DXT1
nvopts="-bc1"
html "$i"-nvcompress.dds
fi
- S2TC_COLORDIST_MODE=SRGB_MIXED S2TC_RANDOM_COLORS=32 S2TC_REFINE_COLORS=CHECK t "$i".tga "$i"-rand32-mrgb-r.dds bin/s2tc -t $fourcc
- S2TC_COLORDIST_MODE=WAVG S2TC_RANDOM_COLORS=32 S2TC_REFINE_COLORS=CHECK t "$i".tga "$i"-rand32-wavg-r.dds bin/s2tc -t $fourcc
- S2TC_COLORDIST_MODE=AVG S2TC_RANDOM_COLORS=32 S2TC_REFINE_COLORS=CHECK t "$i".tga "$i"-rand32-avg-r.dds bin/s2tc -t $fourcc
+ S2TC_COLORDIST_MODE=$goodmetric S2TC_RANDOM_COLORS=32 S2TC_REFINE_COLORS=CHECK t "$i".tga "$i"-rand32-mrgb-r.dds bin/s2tc -t $fourcc
+ S2TC_COLORDIST_MODE=WAVG S2TC_RANDOM_COLORS=32 S2TC_REFINE_COLORS=CHECK t "$i".tga "$i"-rand32-wavg-r.dds bin/s2tc -t $fourcc
+ S2TC_COLORDIST_MODE=AVG S2TC_RANDOM_COLORS=32 S2TC_REFINE_COLORS=CHECK t "$i".tga "$i"-rand32-avg-r.dds bin/s2tc -t $fourcc
if $use_libtxc_dxtn; then
- LD_PRELOAD=/usr/lib/libtxc_dxtn.so t "$i".tga "$i"-libtxc_dxtn.dds bin/s2tc -t $fourcc
+ LD_PRELOAD=/usr/lib/libtxc_dxtn.so t "$i".tga "$i"-libtxc_dxtn.dds bin/s2tc -t $fourcc
unset LD_PRELOAD
fi
- S2TC_COLORDIST_MODE=WAVG S2TC_RANDOM_COLORS=0 S2TC_REFINE_COLORS=ALWAYS t "$i".tga "$i"-norand-wavg-r.dds bin/s2tc -t $fourcc
- S2TC_COLORDIST_MODE=WAVG S2TC_RANDOM_COLORS=-1 S2TC_REFINE_COLORS=ALWAYS t "$i".tga "$i"-faster-wavg-r.dds bin/s2tc -t $fourcc
+ S2TC_COLORDIST_MODE=WAVG S2TC_RANDOM_COLORS=0 S2TC_REFINE_COLORS=ALWAYS t "$i".tga "$i"-norand-wavg-r.dds bin/s2tc -t $fourcc
+ S2TC_COLORDIST_MODE=WAVG S2TC_RANDOM_COLORS=-1 S2TC_REFINE_COLORS=ALWAYS t "$i".tga "$i"-faster-wavg-r.dds bin/s2tc -t $fourcc
html_rowend
done