]> git.rm.cloudns.org Git - xonotic/xonotic.git/commitdiff
add script to unconvert back into pk3 matthiaskrgr/pk3_compr
authorMatthias Krüger <matthias.krueger@famsik.de>
Thu, 29 Dec 2016 15:46:46 +0000 (16:46 +0100)
committerMatthias Krüger <matthias.krueger@famsik.de>
Thu, 29 Dec 2016 15:46:46 +0000 (16:46 +0100)
uncompress_squashfs.pk3 [new file with mode: 0755]

diff --git a/uncompress_squashfs.pk3 b/uncompress_squashfs.pk3
new file mode 100755 (executable)
index 0000000..d3c33ab
--- /dev/null
@@ -0,0 +1,23 @@
+#!/bin/bash
+inputPK3=$1
+
+echo "Extracting"
+unsquashfs -d extractDir ${inputPK3}
+cd extractDir
+
+#$FLIF needs to point towards the flif binary 
+
+echo "Converting"
+for file in `find . | grep "\.flif"`; do # in theory we could make this parallel
+       $FLIF -e ${file} "${file%.flif}.png" # flif -> png
+       convert "${file%.flif}.png" "${file%.flif}.tga" # png -> tga
+       rm $file # rm flif
+       rm ${file%.flif}.png # rm png
+done
+
+echo "Compressing"
+cd ..
+echo `pwd`
+zip -9 -r ${inputPK3%.sqfs}.pk3 extractDir/*
+
+rm -r extractDir # clean up