-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCOMPILE.sh
More file actions
executable file
·67 lines (49 loc) · 1.66 KB
/
COMPILE.sh
File metadata and controls
executable file
·67 lines (49 loc) · 1.66 KB
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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
#!/bin/bash
set -e
echo 'Compiler for Pak.Basic'
echo '------------------------------------------------------'
compile() {
echo '------------------------------------------------------'
echo -e "Compiling $2...\n"
local index=1
local size=($3)
local size=${#size[@]}
for dat in $3; do
# get directory where the dat file is located
local dir=$(dirname "$dat")
./makeobj pak$1 ./compiled/ "./$dat" &> /dev/null
if [[ $? != 0 ]]; then
echo "Error: Makeobj returned an error for $dat. Aborting..."
rm "$csv.in"
exit $?
fi
local index=$(( $index + 1 ))
done
}
echo -n 'Checking for makeobj... '
if [ ! -f 'makeobj' ]; then
echo 'ERROR: makeobj not found in root folder.'
exit 1
fi
echo -e 'OK\n'
# Create folder for *.paks or delete all old paks if folder already exists
if [ ! -d 'compiled' ]; then
mkdir compiled
fi
compile '192' 'Buildings' 'buildings/*.dat'
compile '192' 'Industry' 'industry/*.dat'
compile '192' 'Infrastructure' 'infrastructure/*.dat'
compile '192' 'Landscape' 'landscape/ground/*.dat'
compile '192' 'Landscape' 'landscape/ground_objects/*.dat'
compile '192' 'Landscape' 'landscape/tree/*.dat'
compile '48' 'Landscape' 'landscape/pedestrians/*.dat'
echo -e 'Moving Trunk (configs, sound, text)\n\n'
cp -r trunk/* compiled
compile '32' 'User Interface' 'UI/32/*.dat'
compile '64' 'User Interface' 'UI/64/*.dat'
compile '128' 'User Interface' 'UI/128/*.dat'
compile '192' 'User Interface' 'UI/192/*.dat'
compile '192' 'Vehicles' 'vehicles/*.dat'
echo '========================================================'
echo 'Pakset Complete!'
echo '========================================================'