Various fixes (#548)

* adding running time micros

* support for system micro seconds

* restore display mode after plotting sprites

* bump pxt
This commit is contained in:
Peli de Halleux
2017-10-11 11:31:07 -07:00
committed by GitHub
parent 8d9c90884b
commit cdbc34550a
10 changed files with 49 additions and 10 deletions

View File

@ -73,16 +73,11 @@ namespace game {
_backgroundAnimation = true;
control.inBackground(() => {
led.stopAnimation();
const dm = led.displayMode();
if (dm != DisplayMode.BackAndWhite)
led.setDisplayMode(DisplayMode.BackAndWhite);
basic.showAnimation(`0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 1 1 1 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 1 1 1 0 0 0 1 0 0 0 0 0
0 0 0 0 0 0 0 1 0 0 0 1 1 1 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 1 1 1 0 0 0 1 0 0 0 0 0 0 0 0 0 0
0 0 1 0 0 0 1 1 1 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 1 1 1 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 1 0 0 0 1 1 1 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 1 1 1 0 0 0 1 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 1 1 1 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 1 1 1 0 0 0 1 0 0 0 0 0`, 20);
if (dm != DisplayMode.BackAndWhite)
led.setDisplayMode(dm);
_backgroundAnimation = false;
});
}
@ -125,7 +120,6 @@ namespace game {
unplugEvents();
led.stopAnimation();
led.setBrightness(255);
led.setDisplayMode(DisplayMode.BackAndWhite);
while (true) {
for (let i = 0; i < 8; i++) {
basic.clearScreen();
@ -777,6 +771,9 @@ namespace game {
_sprites[i]._plot(now);
}
_img.plotImage(0);
// restore previous display mode
if (dm != DisplayMode.Greyscale)
led.setDisplayMode(dm);
}
/**