Skip to content

Instantly share code, notes, and snippets.

@Kevin-Mok
Created October 22, 2019 00:18
Show Gist options
  • Save Kevin-Mok/b85fa97b8f75412d01ea8784311ebece to your computer and use it in GitHub Desktop.
Save Kevin-Mok/b85fa97b8f75412d01ea8784311ebece to your computer and use it in GitHub Desktop.
Bash script to fix assets for Project Uranium.
#!/bin/bash
# Bash script to fix assets for Project Uranium as per Step 5 in:
# https://github.com/acedogblast/Project-Uranium-Godot/wiki/Setup-and-Building-Instructions
# Prerequisites:
# - Steps 1-4
# - ffmpeg is in your PATH or installed
# - run from project folder where Audio, Fonts and Graphics
# directories are located
# 1-4
rm ./Graphics/Transitions/RotatingPieces.png
rm ./Graphics/Pictures/dialup.png
# 5-11
mkdir ffmpeg
cd ffmpeg || exit
cp ../Audio/SE/computer*.WAV .
ffmpeg -i "computerclose.WAV" -c:a pcm_s16le "computerclosePCM.wav"
ffmpeg -i "computeropen.WAV" -c:a pcm_s16le "computeropenPCM.wav"
cp computer*PCM.wav ../Audio/SE
rm ../Audio/SE/computer{open,close}.WAV
# 12-15
cp ../Audio/SE/PU-Grasswalk.ogg .
ffmpeg -i "PU-Grasswalk.ogg" -c:a copy "PU-GrasswalkFixed.ogg"
cp PU-GrasswalkFixed.ogg ../Audio/SE
rm ../Audio/SE/PU-Grasswalk.ogg
# 16-19
cp ../Graphics/Tilesets/Outside\(new\).png .
ffmpeg -i "Outside(new).png" -vf "crop=256:10528:0:0,pad=256:10728:0:0:0x000000@0x00" "OutsideTop.png"
ffmpeg -i "Outside(new).png" -vf "crop=256:10728:0:10528" "OutsideBottom.png"
ffmpeg -i "OutsideTop.png" -i "OutsideBottom.png" -filter_complex hstack,crop=512:10569:0:0 "OutsideFixed.png"
cp OutsideFixed.png ../Graphics/Tilesets
rm ../Graphics/Tilesets/Outside\(new\).png
cd ..
rm -r ffmpeg
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment