mirror of
https://github.com/collinsmith/riiablo.git
synced 2025-07-08 23:07:46 +07:00
Optimization to pixmap wrapper to upload pixels faster
This commit is contained in:
@ -1,6 +1,7 @@
|
|||||||
package com.riiablo.graphics;
|
package com.riiablo.graphics;
|
||||||
|
|
||||||
import com.badlogic.gdx.graphics.Pixmap;
|
import com.badlogic.gdx.graphics.Pixmap;
|
||||||
|
import com.badlogic.gdx.utils.BufferUtils;
|
||||||
|
|
||||||
public class PaletteIndexedPixmap extends Pixmap {
|
public class PaletteIndexedPixmap extends Pixmap {
|
||||||
public PaletteIndexedPixmap(int width, int height) {
|
public PaletteIndexedPixmap(int width, int height) {
|
||||||
@ -11,6 +12,6 @@ public class PaletteIndexedPixmap extends Pixmap {
|
|||||||
|
|
||||||
public PaletteIndexedPixmap(int width, int height, byte[] data) {
|
public PaletteIndexedPixmap(int width, int height, byte[] data) {
|
||||||
this(width, height);
|
this(width, height);
|
||||||
getPixels().put(data).rewind();
|
BufferUtils.copy(data, 0, getPixels(), data.length);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user