Add PW_MANGOHAD in PortProton_vars.

This commit is contained in:
castro-fidel
2021-04-09 00:57:30 +03:00
parent f904ddacf7
commit 70a4b8da4d
5 changed files with 69 additions and 44 deletions

View File

@ -26,7 +26,7 @@ print_info () {
}
print_var () {
PS1_old="${PS1}" && PS1="\e[47;11;30m[\u@\h \W]$"
for vp in $@ ; do echo "${vp} = ${!vp}" ; done
for vp in $@ ; do echo "${vp}=${!vp}" ; done
PS1="${PS1_old}"
}
try_copy_file () {
@ -140,12 +140,12 @@ fi
export pw_libs_ver="_v7"
export pw_gecko_mono_ver="_v2"
export WINEARCH=
export PW_VULKAN_DLL="${PORT_WINE_PATH}"/data/vulkan
export WINEDIR="${PORT_WINE_PATH}"/data/dist
export WINELIB="${HOME}/.PortWINE/libs${pw_libs_ver}"
export WINE_MONO_GECKO="${HOME}/.PortWINE/mono_gecko${pw_gecko_mono_ver}"
export WINEPREFIX="${PORT_WINE_PATH}/data/pfx/"
export PW_COMPAT_DATA_PATH="${PORT_WINE_PATH}/data/"
export PW_COMPAT_MEDIA_PATH="${PORT_WINE_TMP_PATH}/"
export PW_RUNTIME="$WINELIB/run.sh"
export PW_GUI_ICON_PATH="${PORT_WINE_PATH}/data/img/gui"
@ -218,8 +218,7 @@ if [ ! -z "${PORTWINE_DB}" ]; then
echo "Use default db file."
fi
fi
########################################################################
START_PORTWINE ()
START_PORTWINE ()
{
if [ "${PW_USE_TERMINAL}" = "1" ]; then
if [ -x "`which konsole 2>/dev/null`" ]; then
@ -260,6 +259,7 @@ fi
try_copy_file "${WINEDIR}"/lib64/wine/fakedlls/dxgi.dll "${WINEPREFIX}/drive_c/windows/system32/"
var_winedlloverride_update "dxgi=b"
export PW_FORCE_LARGE_ADDRESS_AWARE=0
[ "${PW_MANGOHUD}" == "1" ] && export MANGOHUD_DLSYM=1
echo "Use OpenGL"
elif [ "${var_pw_vulkan}" = "dxvk" ]; then
if [ -d "${WINEDIR}_dxvk" ]; then
@ -270,6 +270,7 @@ fi
try_copy_file "${PW_VULKAN_DLL}/dxvk/x64/${wine_dxvk_dll}.dll" "${WINEPREFIX}/drive_c/windows/system32/"
[ "$?" == 0 ] && var_winedlloverride_update "${wine_dxvk_dll}=n"
done
[ "${PW_MANGOHUD}" == "1" ] && export MANGOHUD=1
echo "Use DXVK (DX9-DX11 to Vulkan)"
else
if [ -d "${WINEDIR}_vkd3d" ]; then
@ -289,6 +290,7 @@ fi
try_copy_file "${WINEDIR}/lib64/wine/fakedlls/dxgi.dll" "${WINEPREFIX}/drive_c/windows/system32/"
var_winedlloverride_update "dxgi=b"
fi
[ "${PW_MANGOHUD}" == "1" ] && export MANGOHUD=1
export PW_WINDOWS_VER="10"
echo "Use VKD3D (DX12 to vulkan)"
fi
@ -487,16 +489,14 @@ UPDATE_WINETRICKS () {
chmod u+x "${PORT_WINE_TMP_PATH}/winetricks"
else
W_TRX_INT_VER="$(cat "${PORT_WINE_TMP_PATH}/winetricks" | grep -i 'WINETRICKS_VERSION=' | sed 's/WINETRICKS_VERSION=//')"
print_info "Version winetricks in port: ${W_TRX_EXT_VER}"
if [ $W_TRX_INT_VER != $W_TRX_EXT_VER ] ; then
rm -f "${PORT_WINE_TMP_PATH}/winetricks"
try_download "${W_TRX_URL}" "${PORT_WINE_TMP_PATH}/winetricks"
[ "$?" == 0 ] && print_info "Winetricks version in port has been updated"
print_info "Version winetricks in port: ${W_TRX_INT_VER}"
if [ "$W_TRX_INT_VER" != "$W_TRX_EXT_VER" ] ; then
try_download "${W_TRX_URL}" "${PORT_WINE_TMP_PATH}/winetricks_new"
[ "$DOWNLOAD_ERROR" != "1" ] && mv -f "${PORT_WINE_TMP_PATH}/winetricks_new" "${PORT_WINE_TMP_PATH}/winetricks"
[ "$DOWNLOAD_ERROR" != "1" ] && W_TRX_INT_VER="$(cat "${PORT_WINE_TMP_PATH}/winetricks" | grep -i 'WINETRICKS_VERSION=' | sed 's/WINETRICKS_VERSION=//')" && print_info "Winetricks version in port has been updated (${W_TRX_INT_VER})"
chmod u+x "${PORT_WINE_TMP_PATH}/winetricks"
fi
fi #modded by Cefeiko
sed -i '/w_try winetricks_early_wine cmd/d' "${PORT_WINE_TMP_PATH}/winetricks"
try_remove_dir "${HOME}/.cache/winetricks/"
}
RUN_WINETRICKS_FROM_DB () {
@ -635,7 +635,7 @@ PW_SCRIPTS_UPDATE () {
if [ "$?" == "0" ] ; then
try_remove_file "${PORT_WINE_TMP_PATH}/scripts.tar.xz"
echo "${scripts_current_ver}" > "${PORT_WINE_TMP_PATH}/scripts_ver"
`zenity --info --title "Info..." --text " Updating scripts and database of games\n and programs completed successfully.\n\n Restart ${portname}." --no-wrap ` > /dev/null 2>&1
`zenity --info --title "Info..." --text "${loc_scripts_update}" --no-wrap ` > /dev/null 2>&1
exit 0
fi
fi
@ -649,24 +649,25 @@ PW_RUN () {
else
cd "${WINEPREFIX}/drive_c"
fi
export RUN_MANGOHUD=""
[ "${PW_MANGOHUD}" == "1" ] && export RUN_MANGOHUD=mangohud
print_var "PATH_TO_GAME" "WINEDLLOVERRIDES" "PATH"
if [ ! -z "${PW_GAMEMODERUN}" ] && [ "${PW_GAMEMODERUN}" != 0 ] ; then
if [ ! -z ${optirun_on} ]; then
echo "Full command line: ${optirun_on} $PW_TERM "${PW_RUNTIME}" gamemoderun "${WINELOADER}" "$@" ${LAUNCH_PARAMETERS[*]}"
${optirun_on} $PW_TERM "${PW_RUNTIME}" gamemoderun "${WINELOADER}" "$@" ${LAUNCH_PARAMETERS[*]}
echo "Full command line: ${optirun_on} $PW_TERM "${PW_RUNTIME}" gamemoderun ${RUN_MANGOHUD} "${WINELOADER}" "$@" ${LAUNCH_PARAMETERS[*]}"
${optirun_on} $PW_TERM "${PW_RUNTIME}" gamemoderun ${RUN_MANGOHUD} "${WINELOADER}" "$@" ${LAUNCH_PARAMETERS[*]}
else
echo "Full command line: $PW_TERM "${PW_RUNTIME}" gamemoderun "${WINELOADER}" "$@" ${LAUNCH_PARAMETERS[*]}"
$PW_TERM "${PW_RUNTIME}" gamemoderun "${WINELOADER}" "$@" ${LAUNCH_PARAMETERS[*]}
echo "Full command line: $PW_TERM "${PW_RUNTIME}" gamemoderun ${RUN_MANGOHUD} "${WINELOADER}" "$@" ${LAUNCH_PARAMETERS[*]}"
$PW_TERM "${PW_RUNTIME}" gamemoderun ${RUN_MANGOHUD} "${WINELOADER}" "$@" ${LAUNCH_PARAMETERS[*]}
fi
else
if [ ! -z ${optirun_on} ]; then
echo "Full command line: ${optirun_on} $PW_TERM "${PW_RUNTIME}" "${WINELOADER}" "$@" ${LAUNCH_PARAMETERS[*]}"
${optirun_on} $PW_TERM "${PW_RUNTIME}" "${WINELOADER}" "$@" ${LAUNCH_PARAMETERS[*]}
echo "Full command line: ${optirun_on} $PW_TERM "${PW_RUNTIME}" ${RUN_MANGOHUD} "${WINELOADER}" "$@" ${LAUNCH_PARAMETERS[*]}"
${optirun_on} $PW_TERM "${PW_RUNTIME}" ${RUN_MANGOHUD} "${WINELOADER}" "$@" ${LAUNCH_PARAMETERS[*]}
else
echo "Full command line: $PW_TERM "${PW_RUNTIME}" "${WINELOADER}" "$@" ${LAUNCH_PARAMETERS[*]}"
$PW_TERM "${PW_RUNTIME}" "${WINELOADER}" "$@" ${LAUNCH_PARAMETERS[*]}
echo "Full command line: $PW_TERM "${PW_RUNTIME}" ${RUN_MANGOHUD} "${WINELOADER}" "$@" ${LAUNCH_PARAMETERS[*]}"
$PW_TERM "${PW_RUNTIME}" ${RUN_MANGOHUD} "${WINELOADER}" "$@" ${LAUNCH_PARAMETERS[*]}
fi
fi
}