Optimization to pixmap wrapper to upload pixels faster

This commit is contained in:
Collin Smith
2019-03-24 01:06:33 -07:00
parent 076adfe9b4
commit 96eff08efd

View File

@ -1,6 +1,7 @@
package com.riiablo.graphics;
import com.badlogic.gdx.graphics.Pixmap;
import com.badlogic.gdx.utils.BufferUtils;
public class PaletteIndexedPixmap extends Pixmap {
public PaletteIndexedPixmap(int width, int height) {
@ -11,6 +12,6 @@ public class PaletteIndexedPixmap extends Pixmap {
public PaletteIndexedPixmap(int width, int height, byte[] data) {
this(width, height);
getPixels().put(data).rewind();
BufferUtils.copy(data, 0, getPixels(), data.length);
}
}