(loader, key, urls, xhrSettings)
| 514 | var renderer = this.systems.renderer; |
| 515 | |
| 516 | var AddEntry = function (loader, key, urls, xhrSettings) |
| 517 | { |
| 518 | var entry = { |
| 519 | format: null, |
| 520 | type: null, |
| 521 | textureURL: undefined, |
| 522 | atlasURL: undefined, |
| 523 | multiAtlasURL: undefined, |
| 524 | multiPath: undefined, |
| 525 | multiBaseURL: undefined |
| 526 | }; |
| 527 | |
| 528 | if (IsPlainObject(key)) |
| 529 | { |
| 530 | var config = key; |
| 531 | |
| 532 | key = GetFastValue(config, 'key'); |
| 533 | urls = GetFastValue(config, 'url'), |
| 534 | xhrSettings = GetFastValue(config, 'xhrSettings'); |
| 535 | } |
| 536 | |
| 537 | var matched = false; |
| 538 | |
| 539 | for (var textureBaseFormat in urls) |
| 540 | { |
| 541 | if (renderer.supportsCompressedTexture(textureBaseFormat)) |
| 542 | { |
| 543 | var urlEntry = urls[textureBaseFormat]; |
| 544 | |
| 545 | if (typeof urlEntry === 'string') |
| 546 | { |
| 547 | entry.textureURL = urlEntry; |
| 548 | } |
| 549 | else |
| 550 | { |
| 551 | entry = Merge(urlEntry, entry); |
| 552 | } |
| 553 | |
| 554 | entry.format = textureBaseFormat.toUpperCase(); |
| 555 | |
| 556 | matched = true; |
| 557 | |
| 558 | break; |
| 559 | } |
| 560 | } |
| 561 | |
| 562 | if (!matched) |
| 563 | { |
| 564 | console.warn('No supported compressed texture format or IMG fallback', key); |
| 565 | } |
| 566 | else if (entry.format === 'IMG') |
| 567 | { |
| 568 | var file; |
| 569 | var multifile; |
| 570 | |
| 571 | if (entry.multiAtlasURL) |
| 572 | { |
| 573 | multifile = new MultiAtlasFile(loader, key, entry.multiAtlasURL, entry.multiPath, entry.multiBaseURL, xhrSettings); |
no test coverage detected
searching dependent graphs…