eevee / lexys-labyrinth

Chip's Challenge 2 emulator that runs in a browser
https://c.eev.ee/lexys-labyrinth/
Other
76 stars 13 forks source link

Improve support for High DPI displays #2

Closed magical closed 4 years ago

magical commented 4 years ago

On high DPI displays, a logical pixel does not necessarily equal a device pixel. Images and such are scaled up to the logical pixel size; unfortunately this introduces ugly aliasing. Web pages can take advantage of high DPI screens by intentionally scaling stuff down to be displayed at a higher resolution. By carefully canceling out the automatic scaling of the game canvas we get nice crisp pixels even on high DPI screens.

Before: (125% scaling)

Note the aliasing artifacts in the outlines of the hearts and key cards. before DPI scaling

After: after DPI scaling