summarylogtreecommitdiffstats
path: root/riven-remake.sh
blob: 54cb0f0d5aa3ce5afc51b472c4757cf886c06434 (plain)
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
#!/bin/sh

# This script is licensed under the GNU General Public License version 3 (or any later version, to your decision).
# The license text should be installed together with this software; otherwise it can be optained at https://www.gnu.org/licenses/gpl-3.0.en.html.

_rivendir='/usr/lib/riven-remake'
_rivenexecutable="${_rivendir}/Riven/Binaries/Win64/Riven-Win64-Shipping.exe"

_check_esync() {
  if [ `ulimit -Hn` -ge 524288 ]; then
    printf '%s\n' "System is Esync compatible."
    return 0
  else
    printf '%s\n' "System is NOT Esync compatible ('ulimit -Hn' is < 524288)."
    return 1
  fi
}

## TODO: Implement a proper test for FSYNC.
_check_fsync() {
  if true; then
    printf '%s\n' "System is blindly assumed to be Fsync compatible."
    return 0
  else
    printf '%s\n' "System is NOT Fsync compatible."
    return 1
  fi
}

if _check_esync; then
  export WINEESYNC=1
else
  export WINEESYNC=0
fi

if _check_fsync; then
  export WINEFSYNC=1
else
  export WINEFSYNC=0
fi

export WINE_DISABLE_FAST_SYNC=0


printf '%s\n' \
  "Launching Riven remake (2024) with wine ..." \
  "" \
  "You can consult this script, '$0', for information on how it is launched." \
  "" \
  "Enjoy Riven!" \
  ""

wine "${_rivenexecutable}" "$@"