use scaling option from in-game settings for window size
This commit is contained in:
parent
5dca342b20
commit
e37ab1ac65
27
run.sh
27
run.sh
|
@ -1,24 +1,33 @@
|
|||
#!/bin/sh
|
||||
set -e
|
||||
dir=$(dirname $(readlink -f $0))
|
||||
#!/bin/bash
|
||||
set -euo pipefail
|
||||
|
||||
dir=`dirname "$(readlink -f $0)"`
|
||||
|
||||
if [ ! -x /lib/ld-linux-armhf.so.3 ] ; then
|
||||
echo "/lib/ld-linux-armhf.so.3 not found, installing..."
|
||||
sudo cp -v $dir/lib/ld-linux-armhf.so.3 /lib/
|
||||
sudo cp -v "$dir/lib/ld-linux-armhf.so.3" /lib/
|
||||
fi
|
||||
|
||||
export MOZ_PLUGIN_PATH=$dir/lib/plugins/
|
||||
export XDG_CONFIG_HOME=$dir/etc/
|
||||
export MOZ_PLUGIN_PATH="$dir/lib/plugins/"
|
||||
export XDG_CONFIG_HOME="$dir/etc/"
|
||||
if pactl stat &> /dev/null ; then
|
||||
export ALSA_CONFIG_PATH=$dir/etc/asound.conf
|
||||
export ALSA_CONFIG_PATH="$dir/etc/asound.conf"
|
||||
fi
|
||||
cd $dir
|
||||
|
||||
scale=${1:-3}
|
||||
game_swf="$dir/Anodyne_STANDALONE_1_506.swf"
|
||||
game_savefile="$dir/etc/freshwrapper-data/Shockwave Flash/WritableRoot/#SharedObjects/ANODYNE1/#localWithNet/$game_swf/ANODYNE_SAVE_123.sol"
|
||||
|
||||
if [[ ${1:-NaN} =~ ^[1-9][0-9]*$ ]] ; then
|
||||
scale="$1"
|
||||
else
|
||||
scale=$( (grep -Poa '(?<=scale_factor.).' "$game_savefile" | od -An -N1 -td1) || echo 3)
|
||||
fi
|
||||
|
||||
width=$((scale * 160))
|
||||
height=$((scale * 180))
|
||||
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=$dir/Anodyne_STANDALONE_1_506.swf width=$width height=$height pepperflash_path=$dir/lib/plugins/libpepflashplayer.so
|
||||
exec env LD_LIBRARY_PATH=$dir/lib $dir/bin/npplayer src="$game_swf" width="$width" height="$height" pepperflash_path="$dir/lib/plugins/libpepflashplayer.so"
|
||||
|
|
Loading…
Reference in New Issue