Java 类com.badlogic.gdx.assets.loaders.AsynchronousAssetLoader 实例源码

项目:libgdxcn    文件:AssetLoadingTask.java   
/** Loads parts of the asset asynchronously if the loader is an {@link AsynchronousAssetLoader}. */
@Override
public Void call () throws Exception {
    AsynchronousAssetLoader asyncLoader = (AsynchronousAssetLoader)loader;
    if (dependenciesLoaded == false) {
        dependencies = asyncLoader.getDependencies(assetDesc.fileName, resolve(loader, assetDesc), assetDesc.params);
        if (dependencies != null) {
            manager.injectDependencies(assetDesc.fileName, dependencies);
        } else {
            // if we have no dependencies, we load the async part of the task immediately.
            asyncLoader.loadAsync(manager, assetDesc.fileName, resolve(loader, assetDesc), assetDesc.params);
            asyncDone = true;
        }
    } else {
        asyncLoader.loadAsync(manager, assetDesc.fileName, resolve(loader, assetDesc), assetDesc.params);
    }
    return null;
}
项目:ingress-indonesia-dev    文件:AssetLoadingTask.java   
public Void call()
{
  AsynchronousAssetLoader localAsynchronousAssetLoader = (AsynchronousAssetLoader)this.loader;
  if (!this.dependenciesLoaded)
  {
    this.dependencies = localAsynchronousAssetLoader.getDependencies(this.assetDesc.fileName, this.assetDesc.params);
    if (this.dependencies != null)
    {
      Iterator localIterator = this.dependencies.iterator();
      while (localIterator.hasNext())
      {
        AssetDescriptor localAssetDescriptor = (AssetDescriptor)localIterator.next();
        this.manager.injectDependency(this.assetDesc.fileName, localAssetDescriptor);
      }
    }
    localAsynchronousAssetLoader.loadAsync(this.manager, this.assetDesc.fileName, this.assetDesc.params);
    this.asyncDone = true;
  }
  while (true)
  {
    return null;
    localAsynchronousAssetLoader.loadAsync(this.manager, this.assetDesc.fileName, this.assetDesc.params);
  }
}
项目:tafl    文件:TaflLevelService.java   
@Override
public AsynchronousAssetLoader<TaflLevel, AssetLoaderParameters<TaflLevel>> getLevelLoader() {
    return new TaflLevelDataLoader(new InternalFileHandleResolver());
}
项目:ingress-indonesia-dev    文件:AssetLoadingTask.java   
private void handleAsyncLoader()
{
  AsynchronousAssetLoader localAsynchronousAssetLoader = (AsynchronousAssetLoader)this.loader;
  if (!this.dependenciesLoaded)
    if (this.depsFuture == null)
      this.depsFuture = this.threadPool.submit(this);
  do
  {
    while (true)
    {
      return;
      if (this.depsFuture.isDone())
        try
        {
          this.depsFuture.get();
          this.dependenciesLoaded = true;
          if (this.asyncDone)
          {
            this.asset = localAsynchronousAssetLoader.loadSync(this.manager, this.assetDesc.fileName, this.assetDesc.params);
            return;
          }
        }
        catch (Exception localException2)
        {
          throw new GdxRuntimeException("Couldn't load dependencies of asset '" + this.assetDesc.fileName + "'", localException2);
        }
    }
    if ((this.loadFuture == null) && (!this.asyncDone))
    {
      this.loadFuture = this.threadPool.submit(this);
      return;
    }
    if (this.asyncDone)
    {
      this.asset = localAsynchronousAssetLoader.loadSync(this.manager, this.assetDesc.fileName, this.assetDesc.params);
      return;
    }
  }
  while (!this.loadFuture.isDone());
  try
  {
    this.loadFuture.get();
    this.asset = localAsynchronousAssetLoader.loadSync(this.manager, this.assetDesc.fileName, this.assetDesc.params);
    return;
  }
  catch (Exception localException1)
  {
    throw new GdxRuntimeException("Couldn't load asset '" + this.assetDesc.fileName + "'", localException1);
  }
}