Expanded PaletteIndexedPixmap constructors to include arrays with specified lengths

This commit is contained in:
Collin Smith 2023-09-09 00:16:37 -07:00
parent ab379c7910
commit fa3b2b72ea

View File

@ -13,7 +13,11 @@ public class PaletteIndexedPixmap extends Pixmap {
}
public PaletteIndexedPixmap(int width, int height, byte[] data) {
this(width, height, data, data.length);
}
public PaletteIndexedPixmap(int width, int height, byte[] data, int length) {
this(width, height);
BufferUtils.copy(data, 0, getPixels(), data.length);
BufferUtils.copy(data, 0, getPixels(), length);
}
}