Skip to content

Commit

Permalink
Auto-update from libvoxelstorm: latest resource to string compiler fr…
Browse files Browse the repository at this point in the history
…om armchair webgpu demo 2 (bf80855)
  • Loading branch information
slowriot committed Nov 23, 2024
1 parent 9e9b67d commit 92397c2
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions compile_resource_to_raw_string.sh
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,13 @@ resourcename=$(basename "$infile" | sed 's/\./_/g')
# truncate the destination file
> "$outfile"

# comments
echo "#pragma once"$'\n' >> "$outfile"
echo "// This file is automatically generated from $infile by $0"$'\n' >> "$outfile"

# optional namespace
if [ ! -z "$namespace" ]; then
echo "namespace $namespace {" >> "$outfile"
echo "namespace $namespace {"$'\n' >> "$outfile"
fi

# header
Expand All @@ -58,10 +62,10 @@ else
fi

# footer
echo -n ")${shorthash}\"};" >> "$outfile"
echo ")${shorthash}\"};" >> "$outfile"

if [ ! -z "$namespace" ]; then
echo "}" >> "$outfile"
echo $'\n'"} // namespace $namespace" >> "$outfile"
fi

echo "Resource compiler: $infile compiled to $outfile: $namespace::$resourcename"

0 comments on commit 92397c2

Please sign in to comment.