v0.8.1: moved fog back to a POT texture (NPOT caused rare errors)

This commit is contained in:
Evan Debenham 2020-06-13 23:49:01 -04:00
parent 1e1fb54f3e
commit 3182d3342c

View File

@ -109,12 +109,13 @@ public class FogOfWar extends Image {
} }
float size = DungeonTilemap.SIZE / PIX_PER_TILE; float size = DungeonTilemap.SIZE / PIX_PER_TILE;
width = pWidth * size; width = width2 * size;
height = pHeight * size; height = height2 * size;
//TODO might be nice to compartmentalize the pixmap access and modification into texture/texturecache //TODO might be nice to compartmentalize the pixmap access and modification into texture/texturecache
Pixmap px = new Pixmap(pWidth, pHeight, Pixmap.Format.RGBA8888); Pixmap px = new Pixmap(width2, height2, Pixmap.Format.RGBA8888);
px.setBlending(Pixmap.Blending.None); px.setBlending(Pixmap.Blending.None);
px.setColor(0x000000FF);
px.fill(); px.fill();
SmartTexture tx = new SmartTexture(px, Texture.LINEAR, Texture.CLAMP, false); SmartTexture tx = new SmartTexture(px, Texture.LINEAR, Texture.CLAMP, false);
TextureCache.add(FogOfWar.class, tx); TextureCache.add(FogOfWar.class, tx);