Allow disabling paletted hunks

This commit is contained in:
cyberpwn
2021-09-23 05:50:38 -04:00
parent 846b4faefa
commit ecc09a710a
6 changed files with 14 additions and 42 deletions

View File

@@ -29,9 +29,9 @@ import java.util.function.Supplier;
public class PaletteOrHunk<T> extends StorageHunk<T> implements Hunk<T> {
private final Hunk<T> hunk;
public PaletteOrHunk(int width, int height, int depth, Supplier<Hunk<T>> factory) {
public PaletteOrHunk(int width, int height, int depth, boolean allow, Supplier<Hunk<T>> factory) {
super(width, height, depth);
hunk = width == 16 && height == 16 && depth == 16 ? new PaletteHunk<>() : factory.get();
hunk = (width == 16 && height == 16 && depth == 16 && allow) ? new PaletteHunk<>() : factory.get();
}
public PalettedContainer<T> palette()