Javadoc.
import com.badlogic.gdx.assets.loaders.SynchronousAssetLoader;\r
import com.badlogic.gdx.utils.Array;\r
import com.badlogic.gdx.utils.GdxRuntimeException;\r
+import com.badlogic.gdx.utils.Logger;\r
\r
/** Responsible for loading an asset through an {@link AssetLoader} based on an {@link AssetDescriptor}. Implements\r
* {@link Callable} and is used with an {@link ExecutorService threadpool} to load parts of an asset asynchronously if the asset is\r
final AssetDescriptor assetDesc;\r
final AssetLoader loader;\r
final ExecutorService threadPool;\r
+ final long startTime;\r
\r
volatile boolean asyncDone = false;\r
boolean dependenciesLoaded = false;\r
this.assetDesc = assetDesc;\r
this.loader = loader;\r
this.threadPool = threadPool;\r
+ startTime = manager.log.getLevel() == Logger.DEBUG ? System.nanoTime() : 0;\r
}\r
\r
/** Loads parts of the asset asynchronously if the loader is an {@link AsynchronousAssetLoader}. */\r
if (task.assetDesc.params != null && task.assetDesc.params.loadedCallback != null) {\r
task.assetDesc.params.loadedCallback.finishedLoading(this, task.assetDesc.fileName, task.assetDesc.type);\r
}\r
+\r
+ long endTime = System.nanoTime();\r
+ log.debug("Loaded: " + (endTime - task.startTime) / 1000000f + "ms " + task.assetDesc);\r
}\r
\r
return true;\r
/** Determines on which side of the given line the point is. Returns -1 if the point is on the left side of the line, 0 if the
* point is on the line and 1 if the point is on the right side of the line. Left and right are relative to the lines direction
- * which is linePoint1 to linePoint2.
- * @param linePoint1
- * @param linePoint2
- * @param point
- * @return */
+ * which is linePoint1 to linePoint2. */
public static int pointLineSide (Vector2 linePoint1, Vector2 linePoint2, Vector2 point) {
return (int)Math.signum((linePoint2.x - linePoint1.x) * (point.y - linePoint1.y) - (linePoint2.y - linePoint1.y)
* (point.x - linePoint1.x));
return typeStyles.findKey(style, true);\r
}\r
\r
+ /** Sets the style on the actor to disabled or enabled. This is done by appending "-disabled" to the style name when enabled is\r
+ * false, and removing "-disabled" from the style name when enabled is true. A method named "getStyle" is called the actor via\r
+ * reflection and the name of that style is found in the skin. If the actor doesn't have a "getStyle" method or the style was\r
+ * not found in the skin, no exception is thrown and the actor is left unchanged. */\r
public void setEnabled (Actor actor, boolean enabled) {\r
actor.touchable = enabled;\r
// Get current style.\r