Add a bunch of graphics, log failures

This commit is contained in:
Jeremy Penner 2023-12-22 21:01:54 -05:00
parent 7888b92c41
commit fd2f21c9b4
218 changed files with 254 additions and 8 deletions

1
.gitignore vendored
View file

@ -1 +0,0 @@
*.bin

View file

@ -7,5 +7,6 @@
</head>
<body>
<div id="cels"></div>
<div id="errors"></div>
</body>
</html>

View file

@ -336,7 +336,9 @@ const showStates = (prop) => {
const container = document.getElementById("cels")
for (const celmask of prop.celmasks) {
const state = compositeCels(celsFromMask(prop, celmask))
container.appendChild(imageFromCanvas(state.canvas))
const img = imageFromCanvas(state.canvas)
img.alt = prop.filename
container.appendChild(img)
}
}
@ -348,13 +350,43 @@ const showCels = (prop) => {
}
}
}
const decodeBinary = async (filename) => {
try {
const prop = decodeProp(await readBinary(`props/${filename}`))
prop.filename = filename
return prop
} catch (e) {
return { filename: filename, error: e }
}
}
const fetchImages = async () => {
const response = await fetch("props/index.json")
const filenames = await response.json()
return await Promise.all(filenames.map(decodeBinary))
}
const showError = (e, filename) => {
const container = document.getElementById("errors")
const errNode = document.createElement("p")
console.error(e)
errNode.innerHTML = `${filename}<br/>${e.toString()}`
container.appendChild(errNode)
}
const doTheThing = async () => {
const prop = decodeProp(await readBinary("picture2.bin"))
console.log(prop)
showStates(prop)
showStates(decodeProp(await readBinary("picture1.bin")))
showStates(decodeProp(await readBinary("picture3.bin")))
showStates(decodeProp(await readBinary("afro0.bin")))
for (const prop of await fetchImages()) {
if (prop.error) {
showError(prop.error, prop.filename)
} else {
try {
showStates(prop)
} catch (e) {
showError(e, prop.filename)
}
}
}
}
doTheThing()

BIN
props/Tentacle.bin Normal file

Binary file not shown.

BIN
props/amulet.bin Normal file

Binary file not shown.

BIN
props/ans.bin Normal file

Binary file not shown.

BIN
props/atm.bin Normal file

Binary file not shown.

BIN
props/bag.bin Normal file

Binary file not shown.

BIN
props/ball1.bin Normal file

Binary file not shown.

BIN
props/banner.bin Normal file

Binary file not shown.

BIN
props/barred.bin Normal file

Binary file not shown.

BIN
props/bboard.bin Normal file

Binary file not shown.

BIN
props/bbox0.bin Normal file

Binary file not shown.

BIN
props/bbush.bin Normal file

Binary file not shown.

BIN
props/beds.bin Normal file

Binary file not shown.

BIN
props/booke.bin Normal file

Binary file not shown.

BIN
props/bookf.bin Normal file

Binary file not shown.

BIN
props/bottle.bin Normal file

Binary file not shown.

BIN
props/box1.bin Normal file

Binary file not shown.

BIN
props/brang.bin Normal file

Binary file not shown.

BIN
props/bridgef.bin Normal file

Binary file not shown.

BIN
props/bridges.bin Normal file

Binary file not shown.

BIN
props/bush1.bin Normal file

Binary file not shown.

BIN
props/bush2.bin Normal file

Binary file not shown.

BIN
props/bush3.bin Normal file

Binary file not shown.

BIN
props/bush4.bin Normal file

Binary file not shown.

BIN
props/bwall3.bin Normal file

Binary file not shown.

BIN
props/bwall4.bin Normal file

Binary file not shown.

BIN
props/bwall5.bin Normal file

Binary file not shown.

BIN
props/bwall6.bin Normal file

Binary file not shown.

BIN
props/bwall7.bin Normal file

Binary file not shown.

BIN
props/bwall8.bin Normal file

Binary file not shown.

BIN
props/bwall9.bin Normal file

Binary file not shown.

0
props/c.bin Normal file
View file

BIN
props/cafechair.bin Normal file

Binary file not shown.

0
props/cage2.bin Normal file
View file

BIN
props/camera0.bin Normal file

Binary file not shown.

BIN
props/car4.bin Normal file

Binary file not shown.

0
props/carb.bin Normal file
View file

0
props/carf.bin Normal file
View file

BIN
props/cassette.bin Normal file

Binary file not shown.

BIN
props/cat.bin Normal file

Binary file not shown.

BIN
props/cave0.bin Normal file

Binary file not shown.

BIN
props/cball0.bin Normal file

Binary file not shown.

0
props/cbolt.bin Normal file
View file

BIN
props/ccard.bin Normal file

Binary file not shown.

BIN
props/chairfb.bin Normal file

Binary file not shown.

BIN
props/chairs.bin Normal file

Binary file not shown.

BIN
props/chango.bin Normal file

Binary file not shown.

BIN
props/chess0.bin Normal file

Binary file not shown.

BIN
props/chestf.bin Normal file

Binary file not shown.

BIN
props/chests.bin Normal file

Binary file not shown.

BIN
props/cinder.bin Normal file

Binary file not shown.

BIN
props/club2.bin Normal file

Binary file not shown.

BIN
props/coke1.bin Normal file

Binary file not shown.

BIN
props/compass.bin Normal file

Binary file not shown.

BIN
props/copier.bin Normal file

Binary file not shown.

BIN
props/couchfb.bin Normal file

Binary file not shown.

BIN
props/couchs.bin Normal file

Binary file not shown.

BIN
props/counter0.bin Normal file

Binary file not shown.

BIN
props/crack0.bin Normal file

Binary file not shown.

BIN
props/cups0.bin Normal file

Binary file not shown.

BIN
props/dcase.bin Normal file

Binary file not shown.

BIN
props/dials.bin Normal file

Binary file not shown.

BIN
props/die.bin Normal file

Binary file not shown.

BIN
props/die2.bin Normal file

Binary file not shown.

BIN
props/doll.bin Normal file

Binary file not shown.

BIN
props/door1.bin Normal file

Binary file not shown.

BIN
props/door2.bin Normal file

Binary file not shown.

BIN
props/dungdoor.bin Normal file

Binary file not shown.

0
props/empty.bin Normal file
View file

BIN
props/escaper.bin Normal file

Binary file not shown.

0
props/explo1.bin Normal file
View file

0
props/explo2.bin Normal file
View file

0
props/explo3.bin Normal file
View file

BIN
props/eye0.bin Normal file

Binary file not shown.

BIN
props/fence1.bin Normal file

Binary file not shown.

BIN
props/fgun1.bin Normal file

Binary file not shown.

BIN
props/filecabinet.bin Normal file

Binary file not shown.

BIN
props/flag.bin Normal file

Binary file not shown.

BIN
props/flamp.bin Normal file

Binary file not shown.

BIN
props/flat.bin Normal file

Binary file not shown.

BIN
props/flite.bin Normal file

Binary file not shown.

BIN
props/floor0.bin Normal file

Binary file not shown.

BIN
props/floor1.bin Normal file

Binary file not shown.

BIN
props/fortun.bin Normal file

Binary file not shown.

BIN
props/fount2.bin Normal file

Binary file not shown.

BIN
props/fris.bin Normal file

Binary file not shown.

BIN
props/ftank2.bin Normal file

Binary file not shown.

BIN
props/gcan.bin Normal file

Binary file not shown.

BIN
props/gdoor.bin Normal file

Binary file not shown.

BIN
props/gem.bin Normal file

Binary file not shown.

BIN
props/glassdoor.bin Normal file

Binary file not shown.

BIN
props/glue0.bin Normal file

Binary file not shown.

BIN
props/grass0.bin Normal file

Binary file not shown.

BIN
props/gren.bin Normal file

Binary file not shown.

BIN
props/gun1.bin Normal file

Binary file not shown.

BIN
props/gun2.bin Normal file

Binary file not shown.

BIN
props/gun3.bin Normal file

Binary file not shown.

Some files were not shown because too many files have changed in this diff Show more