mirror of
https://github.com/RetroPie/RetroPie-Setup.git
synced 2024-05-20 05:10:53 -04:00
Compare commits
9 commits
c53a5a9189
...
7dc8a5be97
Author | SHA1 | Date | |
---|---|---|---|
7dc8a5be97 | |||
6d458aafac | |||
a9bdf98195 | |||
af78eed1ba | |||
54d809ff96 | |||
fcde0f91e3 | |||
c1fe1ca55f | |||
8c4e14fb64 | |||
93f5e195f8 |
63
scriptmodules/ports/openlara.sh
Normal file
63
scriptmodules/ports/openlara.sh
Normal file
|
@ -0,0 +1,63 @@
|
|||
#!/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="openlara"
|
||||
rp_module_desc="OpenLara - Source port of Tomb Raider 1-5 (only 1 works)."
|
||||
rp_module_licence="BSD 2-Clause https://github.com/XProger/OpenLara?tab=BSD-2-Clause-1-ov-file#readme"
|
||||
rp_module_help="OpenLara requires the data from a full or demo version of Tomb Raider 1-5. For example, copy the full DATA and FMV folders from the PC CD-ROM. This script installs the PC demo."
|
||||
rp_module_section="exp"
|
||||
rp_module_flags=""
|
||||
|
||||
function depends_openlara() {
|
||||
local depends=(libsdl2-dev libsdl2-net-dev libsdl2-mixer-dev libsdl2-image-dev)
|
||||
|
||||
if compareVersions "$__os_debian_ver" lt 10; then
|
||||
depends+=(libgles2-mesa-dev)
|
||||
fi
|
||||
|
||||
getDepends "${depends[@]}"
|
||||
}
|
||||
|
||||
function sources_openlara() {
|
||||
gitPullOrClone "$md_build" https://github.com/XProger/OpenLara.git
|
||||
}
|
||||
|
||||
function build_openlara() {
|
||||
cd "$md_build/src/platform/sdl2"
|
||||
#./build.sh
|
||||
g++ -std=c++11 `sdl2-config --cflags` -O3 -fno-exceptions -fno-rtti -ffunction-sections -fdata-sections -Wl,--gc-sections -DNDEBUG -D__SDL2__ -D_SDL2_OPENGL main.cpp ../../libs/stb_vorbis/stb_vorbis.c ../../libs/minimp3/minimp3.cpp ../../libs/tinf/tinflate.c -I../../ -o OpenLara `sdl2-config --libs` -lGL -lm -lrt -lpthread -lasound -ludev
|
||||
md_ret_require="$md_build/src/platform/sdl2"
|
||||
}
|
||||
|
||||
function install_openlara() {
|
||||
md_ret_files=(
|
||||
'src/platform/sdl2/OpenLara'
|
||||
)
|
||||
}
|
||||
|
||||
function game_data_openlara() {
|
||||
mkdir "$home/.openlara"
|
||||
chown -R $user:$user "$romdir/ports/tombraider"
|
||||
chown -R $user:$user "$md_conf_root/openlara"
|
||||
}
|
||||
|
||||
function configure_openlara() {
|
||||
addPort "openlara" "openlara" "Tomb Raider" "pushd $romdir/ports/tombraider; MESA_GL_VERSION_OVERRIDE=3.1 $md_inst/OpenLara; popd"
|
||||
|
||||
mkRomDir "ports/tombraider"
|
||||
|
||||
moveConfigDir "$home/.openlara" "$md_conf_root/openlara"
|
||||
|
||||
[[ "$md_mode" == "install" ]] && game_data_openlara
|
||||
}
|
||||
function remove_openlara() {
|
||||
rm /home/pi/.openlara
|
||||
}
|
|
@ -173,7 +173,10 @@ function build_emulationstation() {
|
|||
compareVersions $gles_ver lt 2.0 && params+=(-DUSE_GLES1=On)
|
||||
else
|
||||
params+=(-DGL=On)
|
||||
# mesa specific check of OpenGL version
|
||||
local gl_ver=$(sudo -u $user glxinfo -B | grep -oP 'Max compat profile version:\s\K.*')
|
||||
# generic fallback check of OpenGL version
|
||||
[[ -z "$gl_ver" ]] && gl_ver=$(sudo -u $user glxinfo -B | grep -oP "OpenGL version string: \K[^ ]+")
|
||||
compareVersions $gl_ver gt 2.0 && params+=(-DUSE_GL21=On)
|
||||
fi
|
||||
elif isPlatform "gles"; then
|
||||
|
|
Loading…
Reference in a new issue