mirror of
https://github.com/photonstorm/phaser
synced 2024-11-15 09:27:37 +00:00
Loader: enabled parallel-by-default
- Minor cleanup to parallel: enabled by default, limit of 4 (hard-limit max 12)
This commit is contained in:
parent
8d61441844
commit
86dc43874c
1 changed files with 7 additions and 5 deletions
|
@ -144,16 +144,17 @@ Phaser.Loader = function (game) {
|
|||
* If true then parallel downloading will be enabled.
|
||||
* @property {integer} enableParallel
|
||||
*/
|
||||
this.enableParallel = false;
|
||||
this.enableParallel = true;
|
||||
|
||||
/**
|
||||
* The number of concurrent assets to try and fetch at once.
|
||||
* Most browsers limit 6 requests per domain.
|
||||
*
|
||||
* Many current browsers limit 6 requests per domain; this is slightly conservative.
|
||||
*
|
||||
* @property {integer} maxParallelDownloads
|
||||
* @protected
|
||||
*/
|
||||
this.maxParallelDownloads = 6;
|
||||
this.maxParallelDownloads = 4;
|
||||
|
||||
/**
|
||||
* A counter: if more than zero, files will be automatically added as a synchronization point.
|
||||
|
@ -1175,8 +1176,9 @@ Phaser.Loader.prototype = {
|
|||
// When true further non-pack file downloads are suppressed
|
||||
var syncblock = false;
|
||||
|
||||
var inflightLimit = Phaser.Math.clamp(
|
||||
this.maxParallelDownloads, 1, this.enableParallel ? 12 : 1);
|
||||
var inflightLimit = this.enableParallel
|
||||
? Phaser.Math.clamp(this.maxParallelDownloads, 1, 12)
|
||||
: 1;
|
||||
|
||||
for (var i = this._processingHead; i < this._fileList.length; i++)
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue