Package com.badlogic.gdx.assets.loaders

Examples of com.badlogic.gdx.assets.loaders.AssetLoader


  /** Adds the given asset to the loading queue of the AssetManager.
   * @param fileName the file name (interpretation depends on {@link AssetLoader})
   * @param type the type of the asset.
   * @param parameter parameters for the AssetLoader. */
  public synchronized <T> void load (String fileName, Class<T> type, AssetLoaderParameters<T> parameter) {
    AssetLoader loader = loaders.get(type);
    if (loader == null) throw new GdxRuntimeException("No loader for type '" + type.getSimpleName() + "'");

    if (loadQueue.size == 0) {
      loaded = 0;
      toLoad = 0;
View Full Code Here


  }

  /** Adds a {@link AssetLoadingTask} to the task stack for the given asset.
   * @param assetDesc */
  private void addTask (AssetDescriptor assetDesc) {
    AssetLoader loader = loaders.get(assetDesc.type);
    if (loader == null) throw new GdxRuntimeException("No loader for type '" + assetDesc.type.getSimpleName() + "'");
    tasks.push(new AssetLoadingTask(this, assetDesc, loader, threadPool));
  }
View Full Code Here

   * @return The loader capable of loading the type and filename, or null if none exists */
  public <T> AssetLoader getLoader (final Class<T> type, final String fileName) {
    final ObjectMap<String, AssetLoader> loaders = this.loaders.get(type);
    if (loaders == null || loaders.size < 1) return null;
    if (fileName == null) return loaders.get("");
    AssetLoader result = null;
    int l = -1;
    for (ObjectMap.Entry<String, AssetLoader> entry : loaders.entries()) {
      if (entry.key.length() > l && fileName.endsWith(entry.key)) {
        result = entry.value;
        l = entry.key.length();
View Full Code Here

  /** Adds the given asset to the loading queue of the AssetManager.
   * @param fileName the file name (interpretation depends on {@link AssetLoader})
   * @param type the type of the asset.
   * @param parameter parameters for the AssetLoader. */
  public synchronized <T> void load (String fileName, Class<T> type, AssetLoaderParameters<T> parameter) {
    AssetLoader loader = getLoader(type, fileName);
    if (loader == null) throw new GdxRuntimeException("No loader for type: " + ClassReflection.getSimpleName(type));

    // reset stats
    if (loadQueue.size == 0) {
      loaded = 0;
View Full Code Here

  }

  /** Adds a {@link AssetLoadingTask} to the task stack for the given asset.
   * @param assetDesc */
  private void addTask (AssetDescriptor assetDesc) {
    AssetLoader loader = getLoader(assetDesc.type, assetDesc.fileName);
    if (loader == null) throw new GdxRuntimeException("No loader for type: " + ClassReflection.getSimpleName(assetDesc.type));
    tasks.push(new AssetLoadingTask(this, assetDesc, loader, executor));
  }
View Full Code Here

  /** Adds the given asset to the loading queue of the AssetManager.
   * @param fileName the file name (interpretation depends on {@link AssetLoader})
   * @param type the type of the asset.
   * @param parameter parameters for the AssetLoader. */
  public synchronized <T> void load (String fileName, Class<T> type, AssetLoaderParameters<T> parameter) {
    AssetLoader loader = loaders.get(type);
    if (loader == null) throw new GdxRuntimeException("No loader for type: " + type.getSimpleName());

    if (loadQueue.size == 0) {
      loaded = 0;
      toLoad = 0;
View Full Code Here

  }

  /** Adds a {@link AssetLoadingTask} to the task stack for the given asset.
   * @param assetDesc */
  private void addTask (AssetDescriptor assetDesc) {
    AssetLoader loader = loaders.get(assetDesc.type);
    if (loader == null) throw new GdxRuntimeException("No loader for type: " + assetDesc.type.getSimpleName());
    tasks.push(new AssetLoadingTask(this, assetDesc, loader, threadPool));
  }
View Full Code Here

TOP

Related Classes of com.badlogic.gdx.assets.loaders.AssetLoader

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.