mirror of
https://github.com/collinsmith/riiablo.git
synced 2025-02-10 19:08:14 +07:00
Moved Disposable interface to DC (since all DC implementations also implemented Disposable)
DC.Frame now provides a method to access Frame.width outside of package MPQViewer will now attempt to detect whether or not a DC contains pages and set correct tab automatically
This commit is contained in:
parent
78ec8518d7
commit
07fb7819e3
@ -2,11 +2,12 @@ package gdx.diablo.codec;
|
||||
|
||||
import com.badlogic.gdx.graphics.Pixmap;
|
||||
import com.badlogic.gdx.graphics.g2d.TextureRegion;
|
||||
import com.badlogic.gdx.utils.Disposable;
|
||||
|
||||
import gdx.diablo.codec.util.BBox;
|
||||
import gdx.diablo.graphics.PaletteIndexedBatch;
|
||||
|
||||
public abstract class DC {
|
||||
public abstract class DC implements Disposable {
|
||||
public abstract int getNumDirections();
|
||||
public abstract Direction getDirection(int d);
|
||||
|
||||
@ -170,5 +171,12 @@ public abstract class DC {
|
||||
|
||||
BBox box;
|
||||
byte colormap[];
|
||||
|
||||
/**
|
||||
* read-only workaround for mpq viewer
|
||||
*/
|
||||
public int getWidth() {
|
||||
return width;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -6,7 +6,6 @@ import com.badlogic.gdx.graphics.Pixmap;
|
||||
import com.badlogic.gdx.graphics.Texture;
|
||||
import com.badlogic.gdx.graphics.g2d.TextureRegion;
|
||||
import com.badlogic.gdx.graphics.glutils.PixmapTextureData;
|
||||
import com.badlogic.gdx.utils.Disposable;
|
||||
import com.badlogic.gdx.utils.GdxRuntimeException;
|
||||
import com.badlogic.gdx.utils.StreamUtils;
|
||||
|
||||
@ -23,7 +22,7 @@ import gdx.diablo.codec.util.BBox;
|
||||
import gdx.diablo.graphics.PaletteIndexedPixmap;
|
||||
import gdx.diablo.util.BufferUtils;
|
||||
|
||||
public class DC6 extends DC implements Disposable {
|
||||
public class DC6 extends DC {
|
||||
private static final String TAG = "DC6";
|
||||
private static final boolean DEBUG = true;
|
||||
private static final boolean DEBUG_DIRECTIONS = DEBUG && false;
|
||||
@ -32,7 +31,7 @@ public class DC6 extends DC implements Disposable {
|
||||
|
||||
public static final String EXT = "dc6";
|
||||
|
||||
private static final int PAGE_SIZE = 256;
|
||||
public static final int PAGE_SIZE = 256;
|
||||
|
||||
Header header;
|
||||
Direction directions[];
|
||||
|
@ -6,7 +6,6 @@ import com.badlogic.gdx.graphics.Pixmap;
|
||||
import com.badlogic.gdx.graphics.Texture;
|
||||
import com.badlogic.gdx.graphics.g2d.TextureRegion;
|
||||
import com.badlogic.gdx.graphics.glutils.PixmapTextureData;
|
||||
import com.badlogic.gdx.utils.Disposable;
|
||||
import com.badlogic.gdx.utils.GdxRuntimeException;
|
||||
import com.badlogic.gdx.utils.StreamUtils;
|
||||
|
||||
@ -25,7 +24,7 @@ import gdx.diablo.codec.util.BitStream;
|
||||
import gdx.diablo.graphics.PaletteIndexedPixmap;
|
||||
import gdx.diablo.util.BufferUtils;
|
||||
|
||||
public class DCC extends DC implements Disposable {
|
||||
public class DCC extends DC {
|
||||
private static final String TAG = "DCC";
|
||||
private static final boolean DEBUG = !true;
|
||||
private static final boolean DEBUG_DIRECTIONS = DEBUG && true;
|
||||
|
@ -1078,7 +1078,7 @@ public class MPQViewer {
|
||||
DC pages;
|
||||
|
||||
{
|
||||
imageControls.switchTo("Animation");
|
||||
imageControls.switchTo(dc.getFrame(0, 0).getWidth() >= DC6.PAGE_SIZE ? "Pages" : "Animation");
|
||||
isAnimationTab = imageControls.getTab().equals("Animation");
|
||||
|
||||
slDirection.setValue(0);
|
||||
|
Loading…
Reference in New Issue
Block a user