ensure game library runs in greyscale

This commit is contained in:
Peli de Halleux 2017-08-02 15:00:25 -07:00
parent 9647345a13
commit 5e7cba3882

View File

@ -757,15 +757,16 @@ namespace game {
if (game.isGameOver() || game.isPaused() || !_img) { if (game.isGameOver() || game.isPaused() || !_img) {
return; return;
} }
// ensure greyscale mode
if (led.displayMode() != DisplayMode.Greyscale)
led.setDisplayMode(DisplayMode.Greyscale);
// render sprites
let now = input.runningTime(); let now = input.runningTime();
_img.clear(); _img.clear();
for (let i = 0; i < _sprites.length; i++) { for (let i = 0; i < _sprites.length; i++) {
_sprites[i]._plot(now); _sprites[i]._plot(now);
} }
const mode = led.displayMode() == DisplayMode.Greyscale ? DisplayMode.Greyscale : DisplayMode.BackAndWhite;
led.setDisplayMode(DisplayMode.Greyscale);
_img.plotImage(0); _img.plotImage(0);
led.setDisplayMode(mode);
} }
/** /**