mirror of
https://github.com/collinsmith/riiablo.git
synced 2024-12-22 21:14:22 +07:00
Added support for viewing palette files
This commit is contained in:
parent
e212201fc6
commit
ec9ff67c80
@ -2007,6 +2007,21 @@ public class MpqViewer extends Tool {
|
||||
batch.begin();
|
||||
}
|
||||
});
|
||||
} else if (extension.equals("DAT")) { // palette
|
||||
// TODO: update to new asset manager?
|
||||
AssetDesc<Palette> asset = AssetDesc.of(filename, Palette.class, MpqParams.of());
|
||||
MpqFileHandle handle = mpqs.resolve(asset);
|
||||
try {
|
||||
Palette pal = Palette.read(handle.buffer());
|
||||
renderer.setDrawable(new TextureRegionDrawable(pal.texture()) {{
|
||||
final float scale = 8;
|
||||
setMinSize(
|
||||
pal.texture().getWidth() * scale,
|
||||
pal.texture().getHeight() * scale);
|
||||
}});
|
||||
} finally {
|
||||
handle.release();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user