mirror of
https://github.com/GTNewHorizons/CodeChickenCore.git
synced 2026-11-18 19:39:09 +00:00
Add mipmaps to animated TextureFX
This commit is contained in:
1 parent
f50b326d92
commit
71f3c55d9d
1 file changed
+13
-2
@@ -24,6 +24,7 @@ public class TextureSpecial extends TextureAtlasSprite implements IIconSelfRegis
|
||||
|
||||
//textureFX fields
|
||||
private TextureFX textureFX;
|
||||
private int mipmapLevels;
|
||||
|
||||
private int blankSize = -1;
|
||||
private ArrayList<TextureDataHolder> baseTextures;
|
||||
@@ -64,11 +65,21 @@ public class TextureSpecial extends TextureAtlasSprite implements IIconSelfRegis
|
||||
public void updateAnimation() {
|
||||
if (textureFX != null) {
|
||||
textureFX.update();
|
||||
if (textureFX.changed())
|
||||
TextureUtil.uploadTextureMipmap(new int[][]{textureFX.imageData}, width, height, originX, originY, false, false);
|
||||
if (textureFX.changed()) {
|
||||
int[][] mipmaps = new int[mipmapLevels + 1][];
|
||||
mipmaps[0] = textureFX.imageData;
|
||||
mipmaps = TextureUtil.generateMipmapData(mipmapLevels, width, mipmaps);
|
||||
TextureUtil.uploadTextureMipmap(mipmaps, width, height, originX, originY, false, false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void generateMipmaps(int p_147963_1_) {
|
||||
super.generateMipmaps(p_147963_1_);
|
||||
mipmapLevels = p_147963_1_;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasCustomLoader(IResourceManager manager, ResourceLocation location) {
|
||||
return true;
|
||||
|
||||
Reference in new issue
Block a user