Skip to content

Commit

Permalink
GameScope: Only add internal and show resolution if width and height …
Browse files Browse the repository at this point in the history
…values are valid
  • Loading branch information
sonic2kk committed Aug 29, 2024
1 parent 8464c94 commit 03749b9
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions steamtinkerlaunch
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
PREFIX="/usr"
PROGNAME="SteamTinkerLaunch"
NICEPROGNAME="Steam Tinker Launch"
PROGVERS="v14.0.20240829-2 (gamescope-use-getgamescopearg-for-gsshwres-gsintres)"
PROGVERS="v14.0.20240829-3 (gamescope-use-getgamescopearg-for-gsshwres-gsintres)"
PROGCMD="${0##*/}"
PROGINTERNALPROTNAME="Proton-stl"
SHOSTL="stl"
Expand Down Expand Up @@ -11825,19 +11825,25 @@ function GameScopeGui {

# Build the GameScope arguments string
unset GAMESCOPE_ARGS
GAMESCOPE_ARGS=""

# Internal width/height (-w, -h) broken out from string like '1280x720'
# NOTE: In future if `GSINTW` is blank but `GSINTH` is set, we could calculate a corresponding 16:9 width like GameScope does
GSINTW1="${GSINTRES%x*}"
GSINTW="${GSINTW1%%-*}"
GSINTH1="${GSINTRES#*x}"
GSINTH="${GSINTH1%%-*}"
GAMESCOPE_ARGS="-w ${GSINTW} -h ${GSINTH}"

# Show width/height (-W, -H) broken out from string like '1280x720'
# NOTE: In future if `GSINTW` is blank but `GSINTH` is set, we could calculate a corresponding 16:9 width like GameScope does
GSSHWW1="${GSSHWRES%x*}"
GSSHWW="${GSSHWW1%%-*}"
GSSHWH1="${GSSHWRES#*x}"
GSSHWH="${GSSHWH1%%-*}"
GAMESCOPE_ARGS="${GAMESCOPE_ARGS} -W ${GSSHWW} -H ${GSSHWH}"

### GENERAL OPTIONS ###
if [ -n "$GSINTW" ] && [ -n "$GSINTH" ] ; then GAMESCOPE_ARGS="${GAMESCOPE_ARGS} -w ${GSINTW} -h ${GSINTH}"; fi
if [ -n "$GSSHWW" ] && [ -n "$GSSHWH" ] ; then GAMESCOPE_ARGS="${GAMESCOPE_ARGS} -W ${GSSHWW} -H ${GSSHWH}"; fi
if [ "$GSFLR" -eq "$GSFLR" ] 2>/dev/null ; then GAMESCOPE_ARGS="${GAMESCOPE_ARGS} -r ${GSFLR}"; fi
if [ "$GSFLU" -eq "$GSFLU" ] 2>/dev/null ; then GAMESCOPE_ARGS="${GAMESCOPE_ARGS} -o ${GSFLU}"; fi
if [ "$GSFS" == "TRUE" ] ; then GAMESCOPE_ARGS="${GAMESCOPE_ARGS} -f"; fi
Expand Down

0 comments on commit 03749b9

Please sign in to comment.