|
|
@ -143,6 +143,7 @@ public class DesktopAssetManager implements AssetManager { |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@SuppressWarnings("unchecked") |
|
|
|
public void registerLoader(String clsName, String ... extensions){ |
|
|
|
public void registerLoader(String clsName, String ... extensions){ |
|
|
|
Class<? extends AssetLoader> clazz = null; |
|
|
|
Class<? extends AssetLoader> clazz = null; |
|
|
|
try{ |
|
|
|
try{ |
|
|
@ -175,6 +176,7 @@ public class DesktopAssetManager implements AssetManager { |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@SuppressWarnings("unchecked") |
|
|
|
public void registerLocator(String rootPath, String clsName){ |
|
|
|
public void registerLocator(String rootPath, String clsName){ |
|
|
|
Class<? extends AssetLocator> clazz = null; |
|
|
|
Class<? extends AssetLocator> clazz = null; |
|
|
|
try{ |
|
|
|
try{ |
|
|
@ -263,6 +265,7 @@ public class DesktopAssetManager implements AssetManager { |
|
|
|
* @throws AssetLoadException If failed to load asset due to exception or |
|
|
|
* @throws AssetLoadException If failed to load asset due to exception or |
|
|
|
* other error. |
|
|
|
* other error. |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
|
|
|
|
@SuppressWarnings("unchecked") |
|
|
|
protected <T> T loadLocatedAsset(AssetKey<T> key, AssetInfo info, AssetProcessor proc, AssetCache cache) { |
|
|
|
protected <T> T loadLocatedAsset(AssetKey<T> key, AssetInfo info, AssetProcessor proc, AssetCache cache) { |
|
|
|
AssetLoader loader = handler.aquireLoader(key); |
|
|
|
AssetLoader loader = handler.aquireLoader(key); |
|
|
|
Object obj; |
|
|
|
Object obj; |
|
|
@ -318,6 +321,7 @@ public class DesktopAssetManager implements AssetManager { |
|
|
|
* {@link CloneableSmartAsset}, if the cache is null, or if the |
|
|
|
* {@link CloneableSmartAsset}, if the cache is null, or if the |
|
|
|
* processor did not clone the asset. |
|
|
|
* processor did not clone the asset. |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
|
|
|
|
@SuppressWarnings("unchecked") |
|
|
|
protected <T> T registerAndCloneSmartAsset(AssetKey<T> key, T obj, AssetProcessor proc, AssetCache cache) { |
|
|
|
protected <T> T registerAndCloneSmartAsset(AssetKey<T> key, T obj, AssetProcessor proc, AssetCache cache) { |
|
|
|
// object obj is the original asset
|
|
|
|
// object obj is the original asset
|
|
|
|
// create an instance for user
|
|
|
|
// create an instance for user
|
|
|
@ -354,6 +358,7 @@ public class DesktopAssetManager implements AssetManager { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
|
|
|
|
|
@SuppressWarnings("unchecked") |
|
|
|
public <T> T loadAsset(AssetKey<T> key){ |
|
|
|
public <T> T loadAsset(AssetKey<T> key){ |
|
|
|
if (key == null) |
|
|
|
if (key == null) |
|
|
|
throw new IllegalArgumentException("key cannot be null"); |
|
|
|
throw new IllegalArgumentException("key cannot be null"); |
|
|
|