Skip to content

Commit

Permalink
Create 3D models bundle in build
Browse files Browse the repository at this point in the history
  • Loading branch information
picosonic committed Aug 19, 2021
1 parent 3f9ff2e commit 46477a1
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ then
fi

zipfile="js13k.zip"
models="models.js"
buildpath="tmpbuild"
jscat="${buildpath}/min.js"
indexcat="${buildpath}/index.html"
Expand All @@ -18,9 +19,18 @@ rm -Rf "${buildpath}" >/dev/null 2>&1
rm -Rf "${zipfile}" >/dev/null 2>&1
mkdir "${buildpath}"

# Create a 3D models bundle
echo "var models=[" > "${models}"
for file in "dev/stealth.obj" "dev/cvn-65.obj"
do
php obj2js.php "${file}" "-" "set" >> "${models}"
echo -n "," >> "${models}"
done
echo "];" >> "${models}"

# Concatenate the JS files
touch "${jscat}" >/dev/null 2>&1
for file in "font.js" "writer.js" "main.js"
for file in "font.js" "writer.js" "models.js" "main.js"
do
cat "${file}" >> "${jscat}"
done
Expand Down

0 comments on commit 46477a1

Please sign in to comment.