-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added JFDuke3D, Duke Nukem 3D source port for smaller Pis #3803
base: master
Are you sure you want to change the base?
Changes from 4 commits
8f49834
0b107d4
a800bed
07041be
b56f781
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,118 @@ | ||
#!/usr/bin/env bash | ||
|
||
# This file is part of The RetroPie Project | ||
# | ||
# The RetroPie Project is the legal property of its developers, whose names are | ||
# too numerous to list here. Please refer to the COPYRIGHT.md file distributed with this source. | ||
# | ||
# See the LICENSE.md file at the top-level directory of this distribution and | ||
# at https://raw.githubusercontent.com/RetroPie/RetroPie-Setup/master/LICENSE.md | ||
# | ||
|
||
rp_module_id="jfduke3d" | ||
rp_module_desc="lightweight Duke3D source port by JonoF" | ||
rp_module_licence="GPL2 https://raw.githubusercontent.com/jonof/jfduke3d/master/GPL.TXT" | ||
rp_module_repo="git https://github.com/jonof/jfduke3d.git master" | ||
rp_module_section="exp" | ||
rp_module_flags="" | ||
|
||
function depends_jfduke3d() { | ||
local depends=( | ||
libsdl2-dev libvorbis-dev libfluidsynth-dev | ||
) | ||
|
||
isPlatform "x86" && depends+=(nasm) | ||
isPlatform "gl" || isPlatform "mesa" && depends+=(libgl1-mesa-dev libglu1-mesa-dev) | ||
isPlatform "x11" && depends+=(libgtk3.0-dev) | ||
getDepends "${depends[@]}" | ||
} | ||
|
||
function sources_jfduke3d() { | ||
gitPullOrClone | ||
} | ||
|
||
function build_jfduke3d() { | ||
local gamedir="duke3d" | ||
local require="duke3d" | ||
local params=(RELEASE=1) | ||
|
||
if [[ ! -z "$1" ]] && [[ ! -z "$2" ]]; then | ||
gamedir=$1 | ||
require=$2 | ||
fi | ||
|
||
params+=(DATADIR=$romdir/ports/$gamedir) | ||
|
||
! isPlatform "x86" && params+=(USE_ASM=0) | ||
! isPlatform "x11" && params+=(WITHOUT_GTK=1) | ||
! isPlatform "gl3" && params+=(USE_POLYMOST=0) | ||
|
||
if isPlatform "gl" || isPlatform "mesa"; then | ||
params+=(USE_OPENGL=USE_GL2) | ||
elif isPlatform "gles"; then | ||
params+=(USE_OPENGL=USE_GLES2) | ||
else | ||
params+=(USE_OPENGL=0) | ||
fi | ||
|
||
make clean veryclean | ||
make "${params[@]}" | ||
|
||
md_ret_require="$md_build/$require" | ||
} | ||
|
||
function install_jfduke3d() { | ||
md_ret_files=( | ||
'build' | ||
'README.md' | ||
'GPL.TXT' | ||
) | ||
|
||
if [[ ! -z "$1" ]]; then | ||
md_ret_files+=("$1") | ||
else | ||
md_ret_files+=('duke3d') | ||
fi | ||
} | ||
|
||
function game_data_jfduke3d() { | ||
local dest="$romdir/ports/duke3d" | ||
if [[ ! -n $(find $dest -maxdepth 1 -iname duke3d.grp) ]]; then | ||
mkUserDir "$dest" | ||
local temp="$(mktemp -d)" | ||
download "$__archive_url/3dduke13.zip" "$temp" | ||
unzip -L -o "$temp/3dduke13.zip" -d "$temp" dn3dsw13.shr | ||
unzip -L -o "$temp/dn3dsw13.shr" -d "$dest" duke3d.grp duke.rts | ||
rm -rf "$temp" | ||
chown -R $user:$user "$dest" | ||
fi | ||
} | ||
|
||
function config_file_jfduke3d() { | ||
local config="$1" | ||
if [[ -f "$config" ]] || isPlatform "x86"; then | ||
return | ||
fi | ||
|
||
# no config file exists, creating one | ||
# with alsa as the sound driver | ||
cat >"$config" << _EOF_ | ||
[Sound Setup] | ||
MusicParams = "audio.driver=alsa" | ||
_EOF_ | ||
chown -R $user:$user "$config" | ||
} | ||
|
||
function configure_jfduke3d() { | ||
mkRomDir "ports/duke3d" | ||
moveConfigDir "$home/.jfduke3d" "$md_conf_root/jfduke3d" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This makes |
||
|
||
# params are just for parity with eduke32, last one is not supported | ||
addPort "$md_id" "duke3d" "Duke Nukem 3D" "$md_inst/duke3d" "-j$romdir/ports/duke3d -addon 0" | ||
|
||
if [[ "$md_mode" != "install" ]]; then | ||
return | ||
fi | ||
game_data_jfduke3d | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think this should just call the eduke32 game data function (if it's the same) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It's "mostly" the same, but it can't be used directly. Look at it, and note how at the beginning has an There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thanks - yeah, changing it to support your modules as well would make sense. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Did the short version: moved the |
||
config_file_jfduke3d "$md_conf_root/jfduke3d/duke3d.cfg" | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
#!/usr/bin/env bash | ||
|
||
# This file is part of The RetroPie Project | ||
# | ||
# The RetroPie Project is the legal property of its developers, whose names are | ||
# too numerous to list here. Please refer to the COPYRIGHT.md file distributed with this source. | ||
# | ||
# See the LICENSE.md file at the top-level directory of this distribution and | ||
# at https://raw.githubusercontent.com/RetroPie/RetroPie-Setup/master/LICENSE.md | ||
# | ||
|
||
rp_module_id="jfsw" | ||
rp_module_desc="Shadow Warrior source port by JonoF" | ||
rp_module_help="Place your registered version game files in $romdir/ports/shadowwarrior" | ||
rp_module_licence="GPL2 https://raw.githubusercontent.com/jonof/jfsw/master/GPL.TXT" | ||
rp_module_repo="git https://github.com/jonof/jfsw.git master" | ||
rp_module_section="exp" | ||
rp_module_flags="" | ||
|
||
function depends_jfsw() { | ||
depends_jfduke3d | ||
} | ||
|
||
function sources_jfsw() { | ||
gitPullOrClone | ||
} | ||
|
||
function build_jfsw() { | ||
build_jfduke3d "shadowwarrior" "sw" | ||
} | ||
|
||
function install_jfsw() { | ||
install_jfduke3d 'sw' | ||
} | ||
|
||
function gamedata_jfsw() { | ||
local dest="$romdir/ports/shadowwarrior" | ||
if [[ ! -n $(find $dest -maxdepth 1 -iname sw.grp) ]]; then | ||
mkUserDir "$dest" | ||
local temp="$(mktemp -d)" | ||
download "ftp://ftp.3drealms.com/share/3dsw12.zip" "$temp" | ||
unzip -L -o "$temp/3dsw12.zip" -d "$temp" swsw12.shr | ||
unzip -L -o "$temp/swsw12.shr" -d "$dest" sw.grp sw.rts | ||
rm -rf "$temp" | ||
fi | ||
chown -R $user:$user "$dest" | ||
} | ||
|
||
function configure_jfsw() { | ||
local gamedir="$romdir/ports/shadowwarrior" | ||
|
||
mkRomDir "ports/shadowwarrior" | ||
moveConfigDir "$home/.jfsw" "$md_conf_root/sw/jfsw" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Here, the opposite. Should this just use There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I though the same, but
The "extra layer" you mention was inspired on how is currently treated for Quake 1 and 2, where the first layer is the name of the game, and inside them is every individual port for that game (compare I don't find that joining all the configs on the different ports under the "first port made" is a good idea, especially if the user wants to back up a config for a certain port; this user might find every single config for every port of that game included. Or if the players want to "reset the config" by cleaning the directory, they will find that they deleted the configs for all of the ports of that game. Of course, there may be a better solution, but I dealed with a legacy problem the best I could. I just don't find mixing directories is a good idea, but if the owners of the project want that, it'll be done. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. So what you're saying is that it should actually be There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeah, exactly, that's what EDuke32 should have used since the beginning. Although I understand no one would have predicted the use of different ports for the same game, it would have been nice if it was considered in some form. In the ideal world, it would have been great if this change could be done without the user having to do anything on their end. Still, this had me thinking again. What if JFDuke3D, instead of using There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thanks. The config locations for some things are not ideal, due to later additions. It might be worth me re-organising the configs for eduke32. I will come back to you. Sorry for the delay. |
||
|
||
addPort "$md_id" "sw" "Shadow Warrior" "$md_inst/sw %ROM%" "" | ||
[[ -n $(find $gamedir -maxdepth 1 -iname dragon.zip) ]] && addPort "$md_id" "sw" "Shadow Warrior Twin Dragon" "$md_inst/sw %ROM%" "-gdragon.zip" | ||
[[ -n $(find $gamedir -maxdepth 1 -iname wt.grp) ]] && addPort "$md_id" "sw" "Shadow Warrior Wanton Destruction" "$md_inst/sw %ROM%" "-gwt.grp" | ||
|
||
if [[ "$md_mode" != "install" ]]; then | ||
return | ||
fi | ||
gamedata_jfsw | ||
config_file_jfduke3d "$md_conf_root/sw/jfsw/sw.cfg" | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There isn't a package libgtk3.0-dev - should it be libgtk-3-dev ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You're right, thanks for the correction.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just in case: I force pushed the fix to this; the script is referencing the correct package now (libgtk-3-dev).