[python/turtle] Remove waitForVBlank before drawings

The drawing was really slowed down by the waiting, and no tearing effect
has been noticed without waitForVBlank
This commit is contained in:
Léa Saviot
2018-12-10 17:36:52 +01:00
parent d545c4532a
commit 23e3038c00

View File

@@ -60,9 +60,6 @@ void Turtle::circle(mp_int_t radius, mp_float_t angle) {
int i = 1;
while(i <= length) {
mp_float_t progress = i / length;
if (m_speed > 0 && m_speed < k_maxSpeed) {
Ion::Display::waitForVBlank();
}
// Move the turtle forward
if (forward(1)) {
// Keyboard interruption. Return now to let MicroPython process it.
@@ -85,10 +82,6 @@ bool Turtle::goTo(mp_float_t x, mp_float_t y) {
// Tweening function
for (int i = 0; i < length; i++) {
mp_float_t progress = i / length;
if (m_speed > 0 && m_speed < k_maxSpeed) {
Ion::Display::waitForVBlank();
}
erase();
if (dot(x * progress + oldx * (1 - progress), y * progress + oldy * (1 - progress))
|| draw(false))
@@ -99,7 +92,6 @@ bool Turtle::goTo(mp_float_t x, mp_float_t y) {
}
}
Ion::Display::waitForVBlank();
erase();
dot(x, y);
draw(true);
@@ -112,10 +104,7 @@ mp_float_t Turtle::heading() const {
void Turtle::setHeading(mp_float_t angle) {
micropython_port_vm_hook_loop();
setHeadingPrivate(angle);
Ion::Display::waitForVBlank();
erase();
draw(true);
}