DynamicTexture .java

net.minecraft.client.renderer.texture.DynamicTexture (class): members: updateDynamicTexture, dynamicTextureData, getTextureData, loadTexture, height.

net.minecraft.client.renderer.textureclass46 linesclientextends AbstractTexture1.3 KB

API Surface (3)

void loadTexture(IResourceManager resourceManager)
void updateDynamicTexture()
int[] getTextureData()

Fields & Constants (3)

dynamicTextureData
width
height

Code Graph: Dependencies (3)

Edges (calls / imports / inherits / references) resolved by graphify from the AST. Every chip opens the class source.

Full Source

DynamicTexture.java46 lines · MCP 1.8.9 · verbatimOriginal ↗
1
package net.minecraft.client.renderer.texture;
2
3
import java.awt.image.BufferedImage;
4
import java.io.IOException;
5
import net.minecraft.client.resources.IResourceManager;
6
7
public class DynamicTexture extends AbstractTexture
8
{
9
    private final int[] dynamicTextureData;
10
11
    /** width of this icon in pixels */
12
    private final int width;
13
14
    /** height of this icon in pixels */
15
    private final int height;
16
17
    public DynamicTexture(BufferedImage bufferedImage)
18
    {
19
        this(bufferedImage.getWidth(), bufferedImage.getHeight());
20
        bufferedImage.getRGB(0, 0, bufferedImage.getWidth(), bufferedImage.getHeight(), this.dynamicTextureData, 0, bufferedImage.getWidth());
21
        this.updateDynamicTexture();
22
    }
23
24
    public DynamicTexture(int textureWidth, int textureHeight)
25
    {
26
        this.width = textureWidth;
27
        this.height = textureHeight;
28
        this.dynamicTextureData = new int[textureWidth * textureHeight];
29
        TextureUtil.allocateTexture(this.getGlTextureId(), textureWidth, textureHeight);
30
    }
31
32
    public void loadTexture(IResourceManager resourceManager) throws IOException
33
    {
34
    }
35
36
    public void updateDynamicTexture()
37
    {
38
        TextureUtil.uploadTexture(this.getGlTextureId(), this.dynamicTextureData, this.width, this.height);
39
    }
40
41
    public int[] getTextureData()
42
    {
43
        return this.dynamicTextureData;
44
    }
45
}
46

Deobfuscated MCP 1.8.9 source of DynamicTexture from Marcelektro/MavenMCP-1.8.9 (net/minecraft/client/renderer/texture/DynamicTexture.java), stored verbatim.