v0.9.4: moved last bits of texture creation into TextureCache

This commit is contained in:
Evan Debenham
2021-07-29 13:18:41 -04:00
parent 630fbbb43f
commit d03c80cb97
3 changed files with 38 additions and 21 deletions
@@ -24,6 +24,7 @@ package com.watabou.noosa;
import com.badlogic.gdx.graphics.Pixmap;
import com.watabou.gltextures.SmartTexture;
import com.watabou.gltextures.TextureCache;
import com.watabou.glwrap.Texture;
public class Halo extends Image {
@@ -38,12 +39,13 @@ public class Halo extends Image {
super();
if (!TextureCache.contains( CACHE_KEY )) {
Pixmap pixmap = new Pixmap(2*RADIUS+1, 2*RADIUS+1, Pixmap.Format.RGBA8888);
Pixmap pixmap = TextureCache.create( CACHE_KEY, 2*RADIUS+1, 2*RADIUS+1 ).bitmap;
pixmap.setColor( 0xFFFFFF08 );
for (int i = 0; i < RADIUS; i+=2) {
pixmap.fillCircle(RADIUS, RADIUS, (RADIUS - i));
}
TextureCache.add( CACHE_KEY, new SmartTexture( pixmap ) );
}
texture( CACHE_KEY );