slightly optimize warped / turbo execution

pull/3/merge
Jens Mönig 2015-02-28 05:49:07 -08:00
rodzic ee88f7ad39
commit 58d8fd7ccd
2 zmienionych plików z 10 dodań i 6 usunięć

Wyświetl plik

@ -2455,3 +2455,4 @@ ______
150228 150228
------ ------
* Blocks, Store, GUI: Cache inputs, accelerates evaluating recursive reporters and warped / turbo recursive commands by up to 40% * Blocks, Store, GUI: Cache inputs, accelerates evaluating recursive reporters and warped / turbo recursive commands by up to 40%
* Objects: slightly optimize warped / turbo execution

Wyświetl plik

@ -125,7 +125,7 @@ PrototypeHatBlockMorph*/
// Global stuff //////////////////////////////////////////////////////// // Global stuff ////////////////////////////////////////////////////////
modules.objects = '2015-February-23'; modules.objects = '2015-February-28';
var SpriteMorph; var SpriteMorph;
var StageMorph; var StageMorph;
@ -1433,15 +1433,13 @@ SpriteMorph.prototype.setName = function (string) {
SpriteMorph.prototype.drawNew = function () { SpriteMorph.prototype.drawNew = function () {
var myself = this, var myself = this,
currentCenter = this.center(), currentCenter,
facing, // actual costume heading based on my rotation style facing, // actual costume heading based on my rotation style
isFlipped, isFlipped,
isLoadingCostume = this.costume && isLoadingCostume,
typeof this.costume.loaded === 'function',
cst, cst,
pic, // (flipped copy of) actual costume based on my rotation style pic, // (flipped copy of) actual costume based on my rotation style
stageScale = this.parent instanceof StageMorph ? stageScale,
this.parent.scale : 1,
newX, newX,
corners = [], corners = [],
origin, origin,
@ -1455,6 +1453,11 @@ SpriteMorph.prototype.drawNew = function () {
this.wantsRedraw = true; this.wantsRedraw = true;
return; 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; facing = this.rotationStyle ? this.heading : 90;
if (this.rotationStyle === 2) { if (this.rotationStyle === 2) {
facing = 90; facing = 90;