fullscreen option

This commit is contained in:
lif 2020-03-27 00:02:24 -07:00
parent 74422a7228
commit a80e7a5897
1 changed files with 7 additions and 3 deletions

10
run.sh
View File

@ -20,14 +20,18 @@ game_savefile="$dir/etc/freshwrapper-data/Shockwave Flash/WritableRoot/#SharedOb
if [[ "${1:-NaN}" =~ ^[1-9][0-9]*$ ]] ; then
scale="$1"
elif [[ "${1:-NaN}" =~ ^-*[fF] ]] ; then
display_height=$(xdpyinfo | grep -E '^ *dimensions:' | grep -Po '(?<=[0-9]x)[0-9]+(?= pixels)')
scale=`echo "scale=10; $display_height/180" | bc`
fs_param="--fullscreen"
else
scale=$( (grep -Poa '(?<=scale_factor.).' "$game_savefile" | od -An -N1 -td1) || echo 3)
fi
width=$((scale * 160))
height=$((scale * 180))
width=`echo "($scale * 160)/1" | bc`
height=`echo "($scale * 180)/1" | bc`
device_scale=`echo "scale=10; sqrt($scale/3)" | bc`
sed -i "s/^device_scale = .*/device_scale = $device_scale/" "$dir/etc/freshwrapper.conf"
exec env LD_LIBRARY_PATH="$dir/lib" "$dir/bin/npplayer" src="$game_swf" width="$width" height="$height" pepperflash_path="$dir/lib/plugins/libpepflashplayer.so"
exec env LD_LIBRARY_PATH="$dir/lib" "$dir/bin/npplayer" ${fs_param:-} src="$game_swf" width="$width" height="$height" pepperflash_path="$dir/lib/plugins/libpepflashplayer.so"