From 7934f4cd0344176db50ed597302e82252ddd4300 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jens=20M=C3=B6nig?= Date: Fri, 18 Dec 2015 18:24:25 +0100 Subject: [PATCH] =?UTF-8?q?Optimization:=20Don=E2=80=99t=20redraw=20unrota?= =?UTF-8?q?teable=20sprites=20on=20TURN?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- history.txt | 4 ++++ objects.js | 14 +++++++++----- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/history.txt b/history.txt index 5c25f7c4..344795d5 100755 --- a/history.txt +++ b/history.txt @@ -2815,3 +2815,7 @@ end - bulk of 151215 151218 ------ * new Arabic translation, yay!! Thanks Tarek Galal!!! + +151219 +------ +* Objects: Optimization: Don’t redraw unrotateable sprites on TURN diff --git a/objects.js b/objects.js index f6b97385..dd5fe86a 100644 --- a/objects.js +++ b/objects.js @@ -125,7 +125,7 @@ PrototypeHatBlockMorph*/ // Global stuff //////////////////////////////////////////////////////// -modules.objects = '2015-December-15'; +modules.objects = '2015-December-19'; var SpriteMorph; var StageMorph; @@ -3533,10 +3533,14 @@ SpriteMorph.prototype.setHeading = function (degrees) { turn = dir - this.heading; // apply to myself - this.changed(); - SpriteMorph.uber.setHeading.call(this, dir); - this.silentGotoXY(x, y, true); // just me - this.positionTalkBubble(); + if (this.rotationStyle) { // optimization, only redraw if rotatable + this.changed(); + SpriteMorph.uber.setHeading.call(this, dir); + this.silentGotoXY(x, y, true); // just me + this.positionTalkBubble(); + } else { + this.heading = parseFloat(degrees) % 360; + } // propagate to my parts this.parts.forEach(function (part) {