mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2025-12-22 18:26:12 +08:00
[libgdx] SkeletonViewAtlas -> SkeletonViewerAtlas.
This commit is contained in:
parent
3e16d21e3d
commit
ee3c6aff3c
@ -73,7 +73,7 @@ public class SkeletonViewer extends ApplicationAdapter {
|
|||||||
SkeletonRendererDebug debugRenderer;
|
SkeletonRendererDebug debugRenderer;
|
||||||
SkeletonViewerUI ui;
|
SkeletonViewerUI ui;
|
||||||
|
|
||||||
SkeletonViewAtlas atlas;
|
SkeletonViewerAtlas atlas;
|
||||||
SkeletonData skeletonData;
|
SkeletonData skeletonData;
|
||||||
Skeleton skeleton;
|
Skeleton skeleton;
|
||||||
AnimationState state;
|
AnimationState state;
|
||||||
@ -123,7 +123,7 @@ public class SkeletonViewer extends ApplicationAdapter {
|
|||||||
reloadTimer = 0;
|
reloadTimer = 0;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
atlas = new SkeletonViewAtlas(this, skeletonFile);
|
atlas = new SkeletonViewerAtlas(this, skeletonFile);
|
||||||
|
|
||||||
// Load skeleton data.
|
// Load skeleton data.
|
||||||
String extension = skeletonFile.extension();
|
String extension = skeletonFile.extension();
|
||||||
|
|||||||
@ -14,12 +14,12 @@ import com.badlogic.gdx.graphics.g2d.TextureAtlas;
|
|||||||
import com.badlogic.gdx.graphics.g2d.TextureAtlas.TextureAtlasData.Page;
|
import com.badlogic.gdx.graphics.g2d.TextureAtlas.TextureAtlasData.Page;
|
||||||
import com.badlogic.gdx.utils.Null;
|
import com.badlogic.gdx.utils.Null;
|
||||||
|
|
||||||
class SkeletonViewAtlas extends TextureAtlas {
|
class SkeletonViewerAtlas extends TextureAtlas {
|
||||||
private final SkeletonViewer viewer;
|
private final SkeletonViewer viewer;
|
||||||
private @Null FileHandle atlasFile;
|
private @Null FileHandle atlasFile;
|
||||||
private final AtlasRegion fake;
|
private final AtlasRegion fake;
|
||||||
|
|
||||||
public SkeletonViewAtlas (final SkeletonViewer viewer, @Null FileHandle skeletonFile) {
|
public SkeletonViewerAtlas (final SkeletonViewer viewer, @Null FileHandle skeletonFile) {
|
||||||
this.viewer = viewer;
|
this.viewer = viewer;
|
||||||
|
|
||||||
atlasFile = findAtlasFile(skeletonFile);
|
atlasFile = findAtlasFile(skeletonFile);
|
||||||
@ -64,6 +64,7 @@ class SkeletonViewAtlas extends TextureAtlas {
|
|||||||
for (String endSuffix : endSuffixes) {
|
for (String endSuffix : endSuffixes) {
|
||||||
for (String dataSuffix : dataSuffixes) {
|
for (String dataSuffix : dataSuffixes) {
|
||||||
String suffix = startSuffix + dataSuffix + endSuffix;
|
String suffix = startSuffix + dataSuffix + endSuffix;
|
||||||
|
System.out.println(suffix);
|
||||||
if (baseName.endsWith(suffix)) {
|
if (baseName.endsWith(suffix)) {
|
||||||
FileHandle file = findAtlasFile(skeletonFile, baseName.substring(0, baseName.length() - suffix.length()));
|
FileHandle file = findAtlasFile(skeletonFile, baseName.substring(0, baseName.length() - suffix.length()));
|
||||||
if (file != null) return file;
|
if (file != null) return file;
|
||||||
@ -79,6 +80,9 @@ class SkeletonViewAtlas extends TextureAtlas {
|
|||||||
for (String endSuffix : endSuffixes) {
|
for (String endSuffix : endSuffixes) {
|
||||||
for (String suffix : atlasSuffixes) {
|
for (String suffix : atlasSuffixes) {
|
||||||
FileHandle file = skeletonFile.sibling(baseName + startSuffix + suffix + endSuffix);
|
FileHandle file = skeletonFile.sibling(baseName + startSuffix + suffix + endSuffix);
|
||||||
|
System.out.println(baseName + startSuffix + suffix + endSuffix);
|
||||||
|
if (file.exists())
|
||||||
|
System.out.println();
|
||||||
if (file.exists()) return file;
|
if (file.exists()) return file;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Loading…
x
Reference in New Issue
Block a user