-
Notifications
You must be signed in to change notification settings - Fork 10
/
execute.sh
executable file
·135 lines (132 loc) · 4.72 KB
/
execute.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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
#!/usr/bin/env bash
set -e # exit on error
set -x # echo executed lines
SOURCE_XNB_FOLDER=Terraria.v1.4.0.2-read-only/Content/Images
EXTRACTED_FOLDER=temp1
DOWNSCALED_FOLDER=temp2
NO_SEPARATORS_FOLDER=temp3
MAGNIFIED_FOLDER=temp4
REFILLED_FOLDER=temp5
RELEASE_FOLDER=temp6-release
TEXTURE_PACK_FOLDER=temp6-texture-pack
TARGET_XNB_FOLDER=Terraria.v1.4.0.2/Content/Images
function extractPngsFromTerraria() {
echo "calling TExtract $1 => $2"
java -jar "tools/TExtract 1.6.0.jar" --outputDirectory $2.temp $1
mv $2.temp/Images $2
rm -rf $2.temp
}
function downscalePngs() {
echo "downscaling images $1 => $2"
mkdir -p $2
mkdir -p $2/UI
wine tools/downscale_pngs.exe "$1" "$2"
wine tools/downscale_pngs.exe "$1/UI" "$2/UI"
}
function removeSeparators() {
echo "removing separators $1 => $2"
mkdir -p $2
mkdir -p $2/UI
python tools/remove_separators.py "$1" "$2"
python tools/remove_separators.py "$1/UI" "$2/UI"
}
function magnifyPngs() {
echo "magnifying images $1 => $2"
mkdir -p $2
mkdir -p $2/UI
mkdir -p $2/Items
rsync -ax --delete-after $1/ $2/Others/
rsync -ax --delete-after $1/UI/ $2/UI/
mv $2/Others/Item_* $2/Items/
rm -rf $2/Others/UI/
if [ "$3" = "blend" ]; then
wine tools/image_filter.exe "XBR" -wrap $2/Items $2
wine tools/image_filter.exe "XBRz" $2/Others $2
wine tools/image_filter.exe "XBRz" $1/UI $2/UI
else
wine tools/image_filter.exe "XBR-NoBlend" -wrap $2/Items $2
wine tools/image_filter.exe "XBR-NoBlend" $2/Others $2
wine tools/image_filter.exe "XBR-NoBlend" $1/UI $2/UI
fi
}
function refillMissingPixels() {
echo "refilling missing pixels in Walls and Tiles $2 => $3"
mkdir -p $3
mkdir -p $3/UI
wine tools/refill_missing_pixels.exe $1 $2 $3
wine tools/refill_missing_pixels.exe $1/UI $2/UI $3/UI
}
function pngsToXnbs() {
echo "converting to XNB's $1 => $2"
mkdir -p $2
mkdir -p $2/UI
wine tools/png_to_xnb.exe $1 $2
wine tools/png_to_xnb.exe $1/UI $2/UI
}
function createRelease() {
version=$1
out_file=Images-$version.zip
echo "Creating zip file Images-$version.zip with all XNB's"
mkdir -p $3/Images
rm -f $out_file
rsync -ax --delete-after $2/ $3/
rm -rf $3/Images/Accessories
rm -rf $3/Images/Armor
rm -rf $3/Images/Backgrounds
rm -rf $3/Images/Misc
rm -rf $3/Images/SplashScreens
rm -rf $3/Images/TownNPCs
rm -rf $3/Images/UI/Bestiary
rm -rf $3/Images/UI/CharCreation
rm -rf $3/Images/UI/Creative
rm -rf $3/Images/UI/Minimap
rm -rf $3/Images/UI/PlayerResourceSets
rm -rf $3/Images/UI/WorldCreation
rm -rf $3/Images/UI/WorldGen
rm -rf $3/Images/UI/Button*
echo "Enhanced version of the textures of Terraria 1.4.0.2" > $3/README.txt
echo "" >> $3/README.txt
echo "Crated by Andras Suller, `date +%F`, $version." >> $3/README.txt
echo "For more information visit: http://forums.terraria.org/index.php?threads/enhanced-version-of-the-textures-of-terraria-1-3-0-8.39115/" >> $3/README.txt
cd $3
zip -r ../$out_file README.txt Images pack.json
cd ..
}
function createTexturePack() {
version=$1
out_file=TexturePack-$version.zip
echo "Creating zip file TexturePack-$version.zip with all PNG's"
mkdir -p $3/Content/Images
rm -f $out_file
rsync -ax --delete-after $2/ $3/Content/Images/
rm -rf $3/Content/Images/Backgrounds
rm -rf $3/Content/Images/Misc
rm -rf $3/Content/Images/UI/WorldGen
rm -rf $3/Content/Images/UI/Button*
echo '{
"Name": "HD Textures",
"Author": "Andras Suller",
"Description": "HD Textures",
"Version": {
"major": 0,
"minor": 10
}
}' > $3/pack.json
echo "Enhanced version of the textures of Terraria 1.4.0.2" > $3/README.txt
echo "" >> $3/README.txt
echo "Crated by Andras Suller, `date +%F`, $version." >> $3/README.txt
echo "For more information visit: http://forums.terraria.org/index.php?threads/enhanced-version-of-the-textures-of-terraria-1-3-0-8.39115/" >> $3/README.txt
cd $3
zip -r ../$out_file README.txt Content pack.json
cd ..
}
#SOURCE_XNB_FOLDER="/home/andras/Downloads/Terraria_Soft_Pack_1-10-2016"
# extractPngsFromTerraria $SOURCE_XNB_FOLDER $EXTRACTED_FOLDER
# downscalePngs $EXTRACTED_FOLDER $DOWNSCALED_FOLDER
# removeSeparators $DOWNSCALED_FOLDER $NO_SEPARATORS_FOLDER
# magnifyPngs $NO_SEPARATORS_FOLDER $MAGNIFIED_FOLDER "blend"
# refillMissingPixels $EXTRACTED_FOLDER $MAGNIFIED_FOLDER $REFILLED_FOLDER
# pngsToXnbs $REFILLED_FOLDER $TARGET_XNB_FOLDER
# createRelease v0.10-1.4.0.2 $TARGET_XNB_FOLDER $RELEASE_FOLDER
createTexturePack v0.10-1.4.0.2 $REFILLED_FOLDER $TEXTURE_PACK_FOLDER
# createRelease v0.8-noblend-1.3.4.2 $TARGET_XNB_FOLDER $RELEASE_FOLDER