Skip to content

Commit

Permalink
Update World of Goo.sh
Browse files Browse the repository at this point in the history
Fix wog
  • Loading branch information
Cebion authored Dec 14, 2024
1 parent 7b9e731 commit 5909cc0
Showing 1 changed file with 15 additions and 16 deletions.
31 changes: 15 additions & 16 deletions ports/worldofgoo/World of Goo.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,15 @@ else
fi

source $controlfolder/control.txt
source $controlfolder/device_info.txt

[ -f "${controlfolder}/mod_${CFW_NAME}.txt" ] && source "${controlfolder}/mod_${CFW_NAME}.txt"

get_controls

GAMEDIR=/$directory/ports/worldofgoo
CONFDIR="$GAMEDIR/conf/"

CUR_TTY=/dev/tty0
$ESUDO chmod 666 $CUR_TTY

exec > >(tee "$GAMEDIR/log.txt") 2>&1
> "$GAMEDIR/log.txt" && exec > >(tee "$GAMEDIR/log.txt") 2>&1

cd $GAMEDIR

Expand All @@ -34,8 +32,6 @@ mkdir -p "$GAMEDIR/conf"
export XDG_CONFIG_HOME="$CONFDIR"
export XDG_DATA_HOME="$CONFDIR"

export DEVICE_ARCH="${DEVICE_ARCH:-aarch64}"

if [ -f "${controlfolder}/libgl_${CFW_NAME}.txt" ]; then
source "${controlfolder}/libgl_${CFW_NAME}.txt"
else
Expand All @@ -53,17 +49,21 @@ if [ -d ~/.WorldOfGoo ] && [ ! -h ~/.WorldOfGoo ]; then
fi

# Setup savedir
$ESUDO rm -rf ~/.WorldOfGoo
ln -sfv "$GAMEDIR/savedata" ~/.WorldOfGoo
bind_directories ~/.WorldOfGoo "$GAMEDIR/savedata"

if [ "$LIBGL_FB" != "" ]; then
export SDL_VIDEO_GL_DRIVER="$GAMEDIR/gl4es.aarch64/libGL.so.1"
export SDL_VIDEO_EGL_DRIVER="$GAMEDIR/gl4es.aarch64/libEGL.so.1"
fi

export SDL_GAMECONTROLLERCONFIG="$sdl_controllerconfig"

export TEXTINPUTINTERACTIVE="Y"

#export BOX64_LOG=1
#export BOX64_DLSYM_ERROR=1
#export BOX64_SHOWSEGV=1
#export BOX64_SHOWBT=1

# Extract and organize game files if the installer exists
WOG_FILE=$(ls *.sh 2> /dev/null | head -n 1)

Expand All @@ -75,27 +75,26 @@ if [ -f "$WOG_FILE" ]; then
elif [ -d "data/noarch/game" ]; then
$ESUDO mv -f data/noarch/game "$GAMEDIR/gamedata/"
else
echo "Game directory not found after extraction." > "$CUR_TTY"
pm_message "Game directory not found after extraction."
sleep 5
exit 1
fi
# Directly search and move WorldOfGoo.bin.x86_64
if $ESUDO mv -f $(find . -name "WorldOfGoo.bin.x86_64" -print -quit) "$GAMEDIR/gamedata/WorldOfGoo.bin" 2>/dev/null; then
$ESUDO chmod +x "$GAMEDIR/gamedata/WorldOfGoo.bin"
else
echo "WorldOfGoo.bin.x86_64 not found after extraction." > "$CUR_TTY"
pm_message "WorldOfGoo.bin.x86_64 not found after extraction."
sleep 5
exit 1
fi

rm -rf data/ meta/ scripts/
rm -f "$WOG_FILE"
echo "Setup complete. Have fun playing!" > "$CUR_TTY"
pm_message "Setup complete. Have fun playing!"
fi

$GPTOKEYB "WorldOfGoo.bin" -c "./worldofgoo.gptk" &
pm_platform_helper "$$GAMEDIR/box64/box64"
$GAMEDIR/box64/box64 gamedata/WorldOfGoo.bin

$ESUDO kill -9 $(pidof gptokeyb)
$ESUDO systemctl restart oga_events &
printf "\033c" > /dev/tty0
pm_finish

0 comments on commit 5909cc0

Please sign in to comment.