gabrielflorit / script-8.github.io

A JavaScript-based (React + Redux) fantasy computer for making, sharing, and playing tiny retro-looking games.
https://script-8.github.io/
MIT License
646 stars 35 forks source link

Switch Map to use Frame Buffer Api #302

Closed Kethku closed 5 years ago

Kethku commented 5 years ago

This PR swaps the map container to use the frame buffer API for graphics rendering instead of the slower context api. This speeds things up significantly.

In doing so I noticed that there was a bunch of shared code for setting up the pixel data. So I extracted that into a pixelData file which handles constructing of the typed buffers and rendering of the buffers to a given canvas context.