Skip to content

Commit

Permalink
add my helper scripts to git
Browse files Browse the repository at this point in the history
  • Loading branch information
inodentry committed Feb 13, 2024
1 parent 5d0c331 commit ded1521
Show file tree
Hide file tree
Showing 10 changed files with 71 additions and 55 deletions.
2 changes: 2 additions & 0 deletions .cargo/config-cross.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[build]
target-dir = "target-cross"
1 change: 1 addition & 0 deletions .cargo/config.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

52 changes: 0 additions & 52 deletions assets-convert.sh

This file was deleted.

32 changes: 32 additions & 0 deletions assets-src/process-gfx2d.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
#!/bin/bash

# Generate gfx2d game asset files from source SVGs

mkdir -p assets-tmp

s=128
s_min=16

level=0
while [ $s -ge $s_min ]
do
s2=$(($s * 2))
s4=$(($s * 4))
s6=$(($s * 6))
s8=$(($s * 8))
s10=$(($s * 10))

inkscape -w $s8 -h $s8 roads6.svg -o assets-tmp/roads6-mip$level.png
inkscape -w $s4 -h $s4 roads4.svg -o assets-tmp/roads4-mip$level.png
inkscape -w $s10 -h $s10 sprites.svg -o assets-tmp/sprites-mip$level.png

level=$(($level + 1))
s=$(($s / 2))
done

KTXOPTS="--mipmap --levels $level --zcmp 19 --threads 1 --t2"
toktx $KTXOPTS ../assets/tilemap/sprites.ktx2 assets-tmp/sprites-mip*.png
toktx $KTXOPTS ../assets/tilemap/roads6.ktx2 assets-tmp/roads6-mip*.png
toktx $KTXOPTS ../assets/tilemap/roads4.ktx2 assets-tmp/roads4-mip*.png

rm -rf assets-tmp
16 changes: 13 additions & 3 deletions build-release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
RELDIR="release"

EXE_MAIN="minewars"
EXE_EXTRA="mw_host mw_auth mw_hostrpc mw_cert mw_datatool"
EXE_EXTRA="mw_hostsrv mw_authsrv mw_hostrpc mw_certgen mw_datatool"

MYOS="$(uname)"

export CARGO_TARGET_DIR="./target-mwrel"
export CARGO_TARGET_DIR="./target-release"

macos() {
APPNAME="MineWars"
Expand Down Expand Up @@ -114,9 +114,19 @@ linux-arm64() {
}

case "${1}" in
macos)
mac)
macos
;;
win)
win64
win32
;;
lin)
linux-x64
linux-x86
linux-arm64
linux-arm
;;
win32)
win32
;;
Expand Down
7 changes: 7 additions & 0 deletions cross-proprietary.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/bin/sh
cargo build \
--config ./.cargo/config-cross.toml \
--target x86_64-pc-windows-gnu \
--features dev,proprietary &&
cp ./target-cross/x86_64-pc-windows-gnu/debug/minewars.exe . &&
exec ./minewars.exe "$@"
7 changes: 7 additions & 0 deletions cross.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/bin/sh
cargo build \
--config ./.cargo/config-cross.toml \
--target x86_64-pc-windows-gnu \
--features dev &&
cp ./target-cross/x86_64-pc-windows-gnu/debug/minewars.exe . &&
exec ./minewars.exe "$@"
3 changes: 3 additions & 0 deletions win-proprietary-tracy.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/sh

cargo --config /c/Users/iyes/.cargo/config.toml r --features dev,proprietary,bevy/trace_tracy
3 changes: 3 additions & 0 deletions win-proprietary.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/sh

cargo --config /c/Users/iyes/.cargo/config.toml r --features dev,proprietary
3 changes: 3 additions & 0 deletions win.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/sh

cargo --config /c/Users/iyes/.cargo/config.toml r --features dev

0 comments on commit ded1521

Please sign in to comment.