Skip to content

Commit d4599f2

Browse files
author
obiot
committed
ticket #8 : optimized memory usage when using animation (thanks Jason for the code review!)
1 parent 0ab3772 commit d4599f2

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

src/entity/sprite.js

+2-6
Original file line numberDiff line numberDiff line change
@@ -532,13 +532,9 @@
532532
}
533533
}
534534

535-
// compute and add the offset of each frame
535+
// set each frame configuration (offset, size, etc..)
536536
for ( var i = 0 , len = frame.length ; i < len; i++) {
537-
this.anim[name].frame[i] = {
538-
offset: this.textureAtlas[frame[i]].offset,
539-
width: this.textureAtlas[frame[i]].width,
540-
height: this.textureAtlas[frame[i]].height
541-
}
537+
this.anim[name].frame[i] = this.textureAtlas[frame[i]];
542538
}
543539
this.anim[name].length = this.anim[name].frame.length;
544540
},

0 commit comments

Comments
 (0)