Inlined the depth sort

This commit is contained in:
Richard Davey 2017-12-15 04:07:32 +00:00
parent 61769526d4
commit 8632fe5410

View file

@ -27,6 +27,8 @@ var Systems = new Class({
this.config = config; this.config = config;
this.settings = Settings.create(config); this.settings = Settings.create(config);
this.renderList = [];
this.sortChildrenFlag = false; this.sortChildrenFlag = false;
// Set by the GlobalSceneManager // Set by the GlobalSceneManager
@ -151,7 +153,13 @@ var Systems = new Class({
return; return;
} }
this.depthSort(); // inlined to avoid branching
if (this.sortChildrenFlag)
{
StableSort.inplace(this.displayList.list, this.sortZ);
this.sortChildrenFlag = false;
}
this.cameras.render(renderer, this.displayList, interpolation); this.cameras.render(renderer, this.displayList, interpolation);
}, },