-
Notifications
You must be signed in to change notification settings - Fork 0
/
convert.sh
executable file
·49 lines (40 loc) · 1.4 KB
/
convert.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
#!/bin/bash -e
MAPTOOL=./cmake-build-debug/maptool/maptool
mkdir -p resources/maps/{json,map,wad}/{beta012,pc,sles00593,slps01055,slus00530}
# Unwad everything first
for i in resources/maps/wad/slus00530/*.[Ww][Aa][Dd]; do
${MAPTOOL} unwad $i resources/maps/wad/slus00530/$(echo "$i" | perl -pe 's/.+MAP(\d+)\.[wW][aA][dD]$/MP0\1_/g');
if [ $? -ne 0 ]; then
echo "> $i failed"
fi
done
for i in resources/maps/map/beta012/*.[Mm][Aa][Pp]; do
${MAPTOOL} decompile "$i" resources/maps/json/beta012/"$(basename "$i" .MAP).json";
if [ $? -ne 0 ]; then
echo "> $i failed"
fi
done
for i in resources/maps/map/sles00593/*.[Mm][Aa][Pp]; do
${MAPTOOL} decompile "$i" resources/maps/json/sles00593/"$(basename "$i" .MAP).json";
if [ $? -ne 0 ]; then
echo "> $i failed"
fi
done
for i in resources/maps/map/slps01055/*.[Mm][Aa][Pp]; do
${MAPTOOL} decompile "$i" resources/maps/json/slps01055/"$(basename "$i" .MAP).json";
if [ $? -ne 0 ]; then
echo "> $i failed"
fi
done
for i in resources/maps/map/slus00530/*.[Mm][Aa][Pp]; do
${MAPTOOL} decompile "$i" resources/maps/json/slus00530/"$(basename "$i" .MAP).json";
if [ $? -ne 0 ]; then
echo "> $i failed"
fi
done
for i in resources/maps/map/pc/*.[Mm][Aa][Pp]; do
${MAPTOOL} decompile "$i" resources/maps/json/pc/"$(basename "$i" .MAP).json";
if [ $? -ne 0 ]; then
echo "> $i failed"
fi
done