Skip to content
This repository has been archived by the owner on Nov 3, 2020. It is now read-only.

Optimize canvas lit tiles renderer #97

Open
darkf opened this issue Feb 18, 2017 · 0 comments
Open

Optimize canvas lit tiles renderer #97

darkf opened this issue Feb 18, 2017 · 0 comments

Comments

@darkf
Copy link
Owner

darkf commented Feb 18, 2017

Currently it writes pixels byte by byte when we could be doing it by 32-bit pixels at a time. In unrelated artificial tests this gives me a ~585% speed up (from an "unplayable" 11 FPS to a playable 60 FPS) just filling a canvas.

Note that this makes it endian-dependent. Honestly I don't forsee a lot of big endian devices using this, but we could always detect endianness and use a branch (ideally by swapping out which makePixel(r, g, b) -> uint32 function we use.)

We should probably implement the native color map lookup table generation and pre-compute the 32-bit values instead of RGB. (#17)

# for free to subscribe to this conversation on GitHub. Already have an account? #.
Projects
None yet
Development

No branches or pull requests

1 participant