diff options
| author | Jens Mönig <jens@moenig.org> | 2015-02-28 05:49:07 -0800 |
|---|---|---|
| committer | Jens Mönig <jens@moenig.org> | 2015-02-28 05:49:07 -0800 |
| commit | 58d8fd7ccd9843a743917408bf73da69485e7f3d (patch) | |
| tree | 8fd9477c2f6413b0571bdccc005c91ebcdc2f686 | |
| parent | ee88f7ad398fe9867ad1bcf1c2588704fc012151 (diff) | |
| download | snap-58d8fd7ccd9843a743917408bf73da69485e7f3d.tar.gz snap-58d8fd7ccd9843a743917408bf73da69485e7f3d.zip | |
slightly optimize warped / turbo execution
| -rwxr-xr-x | history.txt | 1 | ||||
| -rw-r--r-- | objects.js | 15 |
2 files changed, 10 insertions, 6 deletions
diff --git a/history.txt b/history.txt index 1c33405..21d038c 100755 --- a/history.txt +++ b/history.txt @@ -2455,3 +2455,4 @@ ______ 150228 ------ * Blocks, Store, GUI: Cache inputs, accelerates evaluating recursive reporters and warped / turbo recursive commands by up to 40% +* Objects: slightly optimize warped / turbo execution @@ -125,7 +125,7 @@ PrototypeHatBlockMorph*/ // Global stuff //////////////////////////////////////////////////////// -modules.objects = '2015-February-23'; +modules.objects = '2015-February-28'; var SpriteMorph; var StageMorph; @@ -1433,15 +1433,13 @@ SpriteMorph.prototype.setName = function (string) { SpriteMorph.prototype.drawNew = function () { var myself = this, - currentCenter = this.center(), + currentCenter, facing, // actual costume heading based on my rotation style isFlipped, - isLoadingCostume = this.costume && - typeof this.costume.loaded === 'function', + isLoadingCostume, cst, pic, // (flipped copy of) actual costume based on my rotation style - stageScale = this.parent instanceof StageMorph ? - this.parent.scale : 1, + stageScale, newX, corners = [], origin, @@ -1455,6 +1453,11 @@ SpriteMorph.prototype.drawNew = function () { this.wantsRedraw = true; return; } + currentCenter = this.center(); + isLoadingCostume = this.costume && + typeof this.costume.loaded === 'function'; + stageScale = this.parent instanceof StageMorph ? + this.parent.scale : 1; facing = this.rotationStyle ? this.heading : 90; if (this.rotationStyle === 2) { facing = 90; |
