Skip to content

Commit 7a1c4e3

Browse files
committed
Add ecwolf port
ECWolf is an advanced source port for Wolfenstein 3D, Spear of Destiny, and Super 3D Noah's Ark based off of the Wolf4SDL code base. ECWolf pulls a substantial amount of code from ZDoom and aims to provide a wide array of mod editing capabilities without the need to modify the source code. Add gitPullOrClone "$md_build" Removed downloadAndExtract and replaced with gitPullOrClone "$md_build" "https://bitbucket.org/ecwolf/ecwolf".
1 parent ac06bc6 commit 7a1c4e3

File tree

1 file changed

+102
-0
lines changed

1 file changed

+102
-0
lines changed

scriptmodules/ports/ecwolf.sh

Lines changed: 102 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,102 @@
1+
#!/usr/bin/env bash
2+
3+
# This file is part of The RetroPie Project
4+
#
5+
# The RetroPie Project is the legal property of its developers, whose names are
6+
# too numerous to list here. Please refer to the COPYRIGHT.md file distributed with this source.
7+
#
8+
# See the LICENSE.md file at the top-level directory of this distribution and
9+
# at https://raw.githubusercontent.com/RetroPie/RetroPie-Setup/master/LICENSE.md
10+
#
11+
12+
rp_module_id="ecwolf"
13+
rp_module_desc="ECWolf - ECWolf is an advanced source port for Wolfenstein 3D, Spear of Destiny, and Super 3D Noah's Ark based off of the Wolf4SDL code base. It also supports mods from .pk3 files."
14+
rp_module_licence="GPL2 https://bitbucket.org/ecwolf/ecwolf/raw/5065aaefe055bff5a8bb8396f7f2ca5f2e2cab27/docs/license-gpl.txt"
15+
rp_module_help="For registered versions, replace the shareware files by adding your full Wolf3d, Spear3D 1.4 version game files to $romdir/ports/wolf3d/."
16+
rp_module_section="exp"
17+
rp_module_flags=""
18+
19+
function depends_ecwolf() {
20+
getDepends libsdl2-dev libsdl2-mixer-dev libsdl2-net-dev zlib1g-dev libsdl1.2-dev libsdl-mixer1.2-dev libsdl-net1.2-dev
21+
}
22+
23+
function sources_ecwolf() {
24+
gitPullOrClone "$md_build" "https://bitbucket.org/ecwolf/ecwolf"
25+
}
26+
27+
function build_ecwolf() {
28+
cd "$md_build"
29+
wget -N -q https://raw.githubusercontent.com/tpo1990/ECWolf-RPI/master/ecwolf_keyboardpatch.diff
30+
applyPatch ecwolf_keyboardpatch.diff
31+
cmake . -DCMAKE_BUILD_TYPE=Release -DGPL=ON
32+
make
33+
md_ret_require="$md_build"
34+
}
35+
36+
function install_ecwolf() {
37+
md_ret_files=(
38+
'ecwolf'
39+
'ecwolf.pk3'
40+
)
41+
}
42+
43+
function game_data_ecwolf() {
44+
if [[ -z $(ls "$romdir/ports/wolf3d") ]]; then
45+
cd "$__tmpdir"
46+
downloadAndExtract "http://maniacsvault.net/ecwolf/files/shareware/wolf3d14.zip" "$romdir/ports/wolf3d/shareware"
47+
downloadAndExtract "http://maniacsvault.net/ecwolf/files/shareware/soddemo.zip" "$romdir/ports/wolf3d/shareware"
48+
fi
49+
}
50+
51+
function _add_games_ecwolf(){
52+
local ecw_bin="$1"
53+
local ext path game
54+
55+
declare -A games=(
56+
['wl1']="Wolfenstein 3D (demo)"
57+
['wl6']="Wolfenstein 3D"
58+
['sod']="Wolfenstein 3D - Spear of Destiny"
59+
['sd1']="Wolfenstein 3D - Spear of Destiny"
60+
['sdm']="Wolfenstein 3D - Spear of Destiny (demo)"
61+
['n3d']="Wolfenstein 3D - Super Noah’s Ark 3D"
62+
['sd2']="Wolfenstein 3D - SoD MP2 - Return to Danger"
63+
['sd3']="Wolfenstein 3D - SoD MP3 - Ultimate Challenge"
64+
)
65+
66+
pushd "$romdir/ports/wolf3d"
67+
for game in "${!games[@]}"; do
68+
ecw=$(find . -iname "*.$game" -print -quit)
69+
[[ -n "$ecw" ]] || continue
70+
ext="${ecw##*.}"
71+
path="${ecw%/*}"; path="${path#*/}"
72+
73+
addPort "$md_id" "ecwolf" "${games[$game]}" "pushd $romdir/ports/wolf3d; bash %ROM%; popd" "$romdir/ports/wolf3d/${games[$game]}.ecwolf"
74+
_add_ecwolf_files_ecwolf "$romdir/ports/wolf3d/${games[$game]}.ecwolf" "$path" "$ext" "$ecw_bin"
75+
done
76+
popd
77+
}
78+
79+
function _add_ecwolf_files_ecwolf() {
80+
cat >"$1" <<_EOF_
81+
cd "$2"
82+
"$4" --data $3
83+
wait \$!
84+
_EOF_
85+
}
86+
87+
function add_games_ecwolf() {
88+
_add_games_ecwolf "$md_inst/ecwolf"
89+
}
90+
91+
function configure_ecwolf() {
92+
mkRomDir "ports/wolf3d"
93+
94+
moveConfigDir "$home/.local/share/ecwolf" "$md_conf_root/ecwolf"
95+
moveConfigDir "$home/.config/ecwolf" "$md_conf_root/ecwolf"
96+
97+
# Check if some wolfenstein files are present and upload shareware files
98+
[[ "$md_mode" == "install" ]] && game_data_ecwolf
99+
[[ "$md_mode" == "install" ]] && add_games_ecwolf
100+
101+
chown -R $user:$user "$romdir/ports/wolf3d"
102+
}

0 commit comments

Comments
 (0)