Skip to content

Commit

Permalink
Changed filtering for palette render textures to Nearest
Browse files Browse the repository at this point in the history
This is the default, protecting against LibGDX API changes
  • Loading branch information
collinsmith committed Jan 25, 2021
1 parent 9fbb1fc commit 651e2c9
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions core/src/main/java/com/riiablo/codec/Palette.java
@@ -1,16 +1,15 @@
package com.riiablo.codec;

import java.io.InputStream;
import org.apache.commons.io.IOUtils;

import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.files.FileHandle;
import com.badlogic.gdx.graphics.Pixmap;
import com.badlogic.gdx.graphics.Texture;
import com.badlogic.gdx.utils.GdxRuntimeException;
import com.badlogic.gdx.utils.StreamUtils;

import org.apache.commons.io.IOUtils;

import java.io.InputStream;

public class Palette {
private static final String TAG = "Palette";
private static final boolean DEBUG = false;
Expand Down Expand Up @@ -63,7 +62,7 @@ public Texture render() {
Pixmap palettePixmap = new Pixmap(COLORS, 1, Pixmap.Format.RGBA8888);
palettePixmap.getPixels().asIntBuffer().put(colors);
Texture texture = new Texture(palettePixmap);
//texture.setFilter(Texture.TextureFilter.Linear, Texture.TextureFilter.Linear);
texture.setFilter(Texture.TextureFilter.Nearest, Texture.TextureFilter.Nearest);
texture.setWrap(Texture.TextureWrap.ClampToEdge, Texture.TextureWrap.ClampToEdge);
palettePixmap.dispose();
return texture;
Expand Down

0 comments on commit 651e2c9

Please sign in to comment.