private void handleSyncLoader() { SynchronousAssetLoader localSynchronousAssetLoader = (SynchronousAssetLoader)this.loader; if (!this.dependenciesLoaded) { this.dependenciesLoaded = true; this.dependencies = localSynchronousAssetLoader.getDependencies(this.assetDesc.fileName, this.assetDesc.params); if (this.dependencies == null) this.asset = localSynchronousAssetLoader.load(this.manager, this.assetDesc.fileName, this.assetDesc.params); while (true) { return; Iterator localIterator = this.dependencies.iterator(); while (localIterator.hasNext()) { AssetDescriptor localAssetDescriptor = (AssetDescriptor)localIterator.next(); this.manager.injectDependency(this.assetDesc.fileName, localAssetDescriptor); } } } this.asset = localSynchronousAssetLoader.load(this.manager, this.assetDesc.fileName, this.assetDesc.params); }
/** Updates the loading of the asset. In case the asset is loaded with an {@link AsynchronousAssetLoader}, the loaders * {@link AsynchronousAssetLoader#loadAsync(AssetManager, String, FileHandle, AssetLoaderParameters)} method is first called on * a worker thread. Once this method returns, the rest of the asset is loaded on the rendering thread via * {@link AsynchronousAssetLoader#loadSync(AssetManager, String, FileHandle, AssetLoaderParameters)}. * @return true in case the asset was fully loaded, false otherwise * @throws GdxRuntimeException */ public boolean update () { ticks++; if (loader instanceof SynchronousAssetLoader) { handleSyncLoader(); } else { handleAsyncLoader(); } return asset != null; }
private void handleSyncLoader () { SynchronousAssetLoader syncLoader = (SynchronousAssetLoader)loader; if (!dependenciesLoaded) { dependenciesLoaded = true; dependencies = syncLoader.getDependencies(assetDesc.fileName, resolve(loader, assetDesc), assetDesc.params); if (dependencies == null) { asset = syncLoader.load(manager, assetDesc.fileName, resolve(loader, assetDesc), assetDesc.params); return; } manager.injectDependencies(assetDesc.fileName, dependencies); } else { asset = syncLoader.load(manager, assetDesc.fileName, resolve(loader, assetDesc), assetDesc.params); } }
public boolean update() { this.ticks = (1 + this.ticks); if ((this.loader instanceof SynchronousAssetLoader)) handleSyncLoader(); while (this.asset != null) { return true; handleAsyncLoader(); } return false; }