当前位置: 首页>>代码示例>>Java>>正文


Java AsynchronousAssetLoader类代码示例

本文整理汇总了Java中com.badlogic.gdx.assets.loaders.AsynchronousAssetLoader的典型用法代码示例。如果您正苦于以下问题:Java AsynchronousAssetLoader类的具体用法?Java AsynchronousAssetLoader怎么用?Java AsynchronousAssetLoader使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


AsynchronousAssetLoader类属于com.badlogic.gdx.assets.loaders包,在下文中一共展示了AsynchronousAssetLoader类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: call

import com.badlogic.gdx.assets.loaders.AsynchronousAssetLoader; //导入依赖的package包/类
/** 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;
}
 
开发者ID:basherone,项目名称:libgdxcn,代码行数:19,代码来源:AssetLoadingTask.java

示例2: call

import com.badlogic.gdx.assets.loaders.AsynchronousAssetLoader; //导入依赖的package包/类
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);
  }
}
 
开发者ID:isnuryusuf,项目名称:ingress-indonesia-dev,代码行数:25,代码来源:AssetLoadingTask.java

示例3: getLevelLoader

import com.badlogic.gdx.assets.loaders.AsynchronousAssetLoader; //导入依赖的package包/类
@Override
public AsynchronousAssetLoader<TaflLevel, AssetLoaderParameters<TaflLevel>> getLevelLoader() {
    return new TaflLevelDataLoader(new InternalFileHandleResolver());
}
 
开发者ID:apotapov,项目名称:tafl,代码行数:5,代码来源:TaflLevelService.java

示例4: handleAsyncLoader

import com.badlogic.gdx.assets.loaders.AsynchronousAssetLoader; //导入依赖的package包/类
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);
  }
}
 
开发者ID:isnuryusuf,项目名称:ingress-indonesia-dev,代码行数:51,代码来源:AssetLoadingTask.java


注:本文中的com.badlogic.gdx.assets.loaders.AsynchronousAssetLoader类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。