#"$SELF" each git clean -fxd
rm -rf Xonotic
mkdir -p Xonotic
+ date +%Y%m%d > Xonotic/stamp.txt
git archive --format=tar HEAD -- Docs misc server xonotic-linux-glx.sh xonotic-linux-sdl.sh misc/buildfiles | {
cd Xonotic
mkdir data fteqcc darkplaces-src fteqcc-src
"$SELF" update-maps
;;
release-finish)
- # version numnber and stuff like that
+ # version number and stuff like that
;;
release-qc)
verbose make -C data/xonotic-data.pk3dir FTEQCC="$d0/Xonotic/fteqcc/fteqcc.linux32" FTEQCCFLAGS_WATERMARK=
export do_dds=true
export dds_flags=
export do_ogg=false
- find models textures maps/*/ -type f -print0 | xargs -0 "$d0"/misc/tools/cached-converter.sh
+ export del_src=true
+ find . -type f -print0 | xargs -0 "$d0"/misc/tools/cached-converter.sh
;;
release-buildpk3-transform-low)
dir=$1
# texture: convert to jpeg and dds
# music: reduce bitrate
export do_jpeg=true
- export jpeg_qual_rgb=85
+ export jpeg_qual_rgb=80
export jpeg_qual_a=95
export do_dds=false
export do_ogg=true
export ogg_qual=1
- find models textures maps/*/ sound -type f -print0 | xargs -0 "$d0"/misc/tools/cached-converter.sh
+ export del_src=true
+ find . -type f -print0 | xargs -0 "$d0"/misc/tools/cached-converter.sh
;;
release-buildpk3-transform-lowdds)
dir=$1
export do_ogg=true
export ogg_qual=1
export del_src=true
- find models textures maps/*/ sound -type f -print0 | xargs -0 "$d0"/misc/tools/cached-converter.sh
+ find . -type f -print0 | xargs -0 "$d0"/misc/tools/cached-converter.sh
+ if [ -f "quake.rc" ]; then
+ echo "r_texture_dds_load 1" >> quake.rc
+ fi
;;
release-buildpk3)
src=$1
rm -rf Xonotic/temp
;;
release-buildpk3s)
+ stamp=`cat Xonotic/stamp.txt`
src=$1
shift
+ dst=${src%.pk3dir}
+ case "$dst" in
+ data/xonotic-*)
+ dst="xonotic-$stamp-${dst#data/xonotic-}"
+ ;;
+ *)
+ dst="$dst-$stamp"
+ ;;
+ esac
while [ "$#" -gt 1 ]; do
- "$SELF" release-buildpk3 "$src" "Xonotic/${src%.pk3dir}$2.pk3" "$1"
+ "$SELF" release-buildpk3 "$src" "Xonotic/$dst$2.pk3" "$1"
shift
shift
done
"$SELF" release-buildpk3s data/xonotic-data.pk3dir normal '' raw '-raw' low '-low' lowdds '-lowdds'
"$SELF" release-buildpk3s data/xonotic-maps.pk3dir normal '' raw '-raw' low '-low' lowdds '-lowdds'
"$SELF" release-buildpk3s data/xonotic-music.pk3dir raw '' low '-low'
- "$SELF" release-buildpk3s data/xonotic-nexcompat.pk3dir low '' lowdds '-lowdds'
+ "$SELF" release-buildpk3s data/xonotic-nexcompat.pk3dir low ''
;;
release-pack-needsx11)
case "$DISPLAY" in
;;
esac
;;
+ release-zip)
+ zip -9r Xonotic-common.zip \
+ Xonotic/*.dll \
+ Xonotic/darkplaces-src \
+ Xonotic/Docs \
+ Xonotic/fteqcc-src \
+ Xonotic/misc \
+ Xonotic/fteqcc \
+ Xonotic/server \
+ Xonotic/*.app \
+ Xonotic/xonotic-* \
+ Xonotic/data/font-nimbussansl.pk3
+ cp Xonotic-common.zip Xonotic.zip
+ zip -0r Xonotic.zip \
+ Xonotic/data/xonotic-data.pk3 \
+ Xonotic/data/xonotic-maps.pk3 \
+ Xonotic/data/xonotic-music.pk3 \
+ Xonotic/data/xonotic-nexcompat.pk3
+ cp Xonotic-common.zip Xonotic-low.zip
+ zip -0r Xonotic-low.zip \
+ Xonotic/data/xonotic-data-low.pk3 \
+ Xonotic/data/xonotic-maps-low.pk3 \
+ Xonotic/data/xonotic-music-low.pk3 \
+ Xonotic/data/xonotic-nexcompat.pk3
+ cp Xonotic-common.zip Xonotic-lowdds.zip
+ zip -0r Xonotic-lowdds.zip \
+ Xonotic/data/xonotic-data-lowdds.pk3 \
+ Xonotic/data/xonotic-maps-lowdds.pk3 \
+ Xonotic/data/xonotic-music-low.pk3 \
+ Xonotic/data/xonotic-nexcompat.pk3
+ cp Xonotic-common.zip Xonotic-high.zip
+ zip -0r Xonotic-high.zip \
+ Xonotic/data/xonotic-data-raw.pk3 \
+ Xonotic/data/xonotic-maps-raw.pk3 \
+ Xonotic/data/xonotic-music.pk3 \
+ Xonotic/data/xonotic-nexcompat.pk3
+ rm -f Xonotic-common.zip
+ ;;
release)
"$SELF" release-prepare
"$SELF" release-maps &
"$SELF" release-qc &
wait
"$SELF" release-pack-needsx11
+ "$SELF" release-zip
;;
*)
fi
}
+to_delete=
for F in "$@"; do
echo >&2 "Handling $F..."
conv=false
keep=false
+ will_jpeg=$do_jpeg
+ will_dds=$do_dds
+ case "$F" in
+ textures/*) ;;
+ models/*) ;;
+ maps/*/*) ;;
+ ;;
+ *)
+ # we can't DDS compress the 2D textures, sorry
+ # but JPEG is still fine
+ will_dds=false
+ ;;
+ esac
case "$F" in
*_alpha.jpg)
# handle in *.jpg case
# they always got converted, I assume
- if $do_dds || $do_jpeg; then
+ if $will_dds || $will_jpeg; then
conv=true
fi
- keep=$do_jpeg
+ keep=$will_jpeg
;;
*.jpg)
if [ -f "${F%.jpg}_alpha.jpg" ]; then
- cached "$do_dds" reduce_jpeg2_dds "$F" "${F%.*}_alpha.jpg" "dds/${F%.*}.dds" "" "$dds_flags"
- cached "$do_jpeg" reduce_jpeg2_jpeg2 "$F" "${F%.*}_alpha.jpg" "$F" "${F%.*}_alpha.jpg" "$jpeg_qual_rgb" "$jpeg_qual_a"
+ cached "$will_dds" reduce_jpeg2_dds "$F" "${F%.*}_alpha.jpg" "dds/${F%.*}.dds" "" "$dds_flags"
+ cached "$will_jpeg" reduce_jpeg2_jpeg2 "$F" "${F%.*}_alpha.jpg" "$F" "${F%.*}_alpha.jpg" "$jpeg_qual_rgb" "$jpeg_qual_a"
else
- cached "$do_dds" reduce_rgb_dds "$F" "" "dds/${F%.*}.dds" "" "$dds_flags"
- cached "$do_jpeg" reduce_jpeg_jpeg "$F" "" "$F" "" "$jpeg_qual_rgb"
+ cached "$will_dds" reduce_rgb_dds "$F" "" "dds/${F%.*}.dds" "" "$dds_flags"
+ cached "$will_jpeg" reduce_jpeg_jpeg "$F" "" "$F" "" "$jpeg_qual_rgb"
fi
;;
*.png|*.tga)
cached true has_alpha "$F" "" "$F.hasalpha" ""
conv=false
if [ -s "$F.hasalpha" ]; then
- cached "$do_dds" reduce_rgba_dds "$F" "" "dds/${F%.*}.dds" "" "$dds_flags"
- cached "$do_jpeg" reduce_rgba_jpeg2 "$F" "" "${F%.*}.jpg" "${F%.*}_alpha.jpg" "$jpeg_qual_rgb" "$jpeg_qual_a"
+ cached "$will_dds" reduce_rgba_dds "$F" "" "dds/${F%.*}.dds" "" "$dds_flags"
+ cached "$will_jpeg" reduce_rgba_jpeg2 "$F" "" "${F%.*}.jpg" "${F%.*}_alpha.jpg" "$jpeg_qual_rgb" "$jpeg_qual_a"
rm -f "$F" # TGA becomes useless after JPEGging
else
- cached "$do_dds" reduce_rgb_dds "$F" "" "dds/${F%.*}.dds" "" "$dds_flags"
- cached "$do_jpeg" reduce_rgb_jpeg "$F" "" "${F%.*}.jpg" "" "$jpeg_qual_rgb"
+ cached "$will_dds" reduce_rgb_dds "$F" "" "dds/${F%.*}.dds" "" "$dds_flags"
+ cached "$will_jpeg" reduce_rgb_jpeg "$F" "" "${F%.*}.jpg" "" "$jpeg_qual_rgb"
rm -f "$F" # TGA becomes useless after JPEGging
fi
rm -f "$F.hasalpha"
if $del_src; then
if $conv; then
if ! $keep; then
- rm -f "$F"
+ # FIXME can't have spaces in filenames that way
+ to_delete="$to_delete $F"
fi
fi
fi
done
+for F in $to_delete; do
+ rm -f "$F"
+done