当前位置: 首页>>代码示例>>Java>>正文


Java TextureUtil.uploadTextureImage方法代码示例

本文整理汇总了Java中net.minecraft.client.renderer.texture.TextureUtil.uploadTextureImage方法的典型用法代码示例。如果您正苦于以下问题:Java TextureUtil.uploadTextureImage方法的具体用法?Java TextureUtil.uploadTextureImage怎么用?Java TextureUtil.uploadTextureImage使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在net.minecraft.client.renderer.texture.TextureUtil的用法示例。


在下文中一共展示了TextureUtil.uploadTextureImage方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: checkTextureUploaded

import net.minecraft.client.renderer.texture.TextureUtil; //导入方法依赖的package包/类
private void checkTextureUploaded()
{
    if (!this.textureUploaded)
    {
        if (this.bufferedImage != null)
        {
            if (this.textureLocation != null)
            {
                this.deleteGlTexture();
            }

            TextureUtil.uploadTextureImage(super.getGlTextureId(), this.bufferedImage);
            this.textureUploaded = true;
        }
    }
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:17,代码来源:ThreadDownloadImageData.java

示例2: loadTexture

import net.minecraft.client.renderer.texture.TextureUtil; //导入方法依赖的package包/类
public void loadTexture(ResourceManager par1ResourceManager) throws IOException
{
    if (this.bufferedImage == null)
    {
        if (this.imageLocation != null)
        {
            this.imageLocation.loadTexture(par1ResourceManager);
            this.glTextureId = this.imageLocation.getGlTextureId();
        }
    }
    else
    {
        TextureUtil.uploadTextureImage(this.getGlTextureId(), this.bufferedImage);
    }

    if (this.imageThread == null)
    {
        this.imageThread = new ThreadDownloadImageDataINNER1(this);
        this.imageThread.setDaemon(true);
        this.imageThread.setName("Skin downloader: " + this.imageUrl);
        this.imageThread.start();
    }
}
 
开发者ID:HATB0T,项目名称:RuneCraftery,代码行数:24,代码来源:ThreadDownloadImageData.java

示例3: checkTextureUploaded

import net.minecraft.client.renderer.texture.TextureUtil; //导入方法依赖的package包/类
private void checkTextureUploaded()
{
    if (!this.textureUploaded && this.bufferedImage != null)
    {
        this.textureUploaded = true;

        if (this.textureLocation != null)
        {
            this.deleteGlTexture();
        }

        TextureUtil.uploadTextureImage(super.getGlTextureId(), this.bufferedImage);
    }
}
 
开发者ID:SkidJava,项目名称:BaseClient,代码行数:15,代码来源:ThreadDownloadImageData.java

示例4: checkTextureUploaded

import net.minecraft.client.renderer.texture.TextureUtil; //导入方法依赖的package包/类
private void checkTextureUploaded()
{
    if (!this.textureUploaded && this.bufferedImage != null)
    {
        if (this.textureLocation != null)
        {
            this.deleteGlTexture();
        }

        TextureUtil.uploadTextureImage(super.getGlTextureId(), this.bufferedImage);
        this.textureUploaded = true;
    }
}
 
开发者ID:SkidJava,项目名称:BaseClient,代码行数:14,代码来源:ThreadDownloadImageData.java

示例5: checkTextureUploaded

import net.minecraft.client.renderer.texture.TextureUtil; //导入方法依赖的package包/类
private void checkTextureUploaded() {
	if (!textureUploaded)
		if (bufferedImage != null) {
			if (textureLocation != null)
				deleteGlTexture();

			TextureUtil.uploadTextureImage(super.getGlTextureId(), bufferedImage);
			if (imgDownload != null) {
				BufferedImage oldStyleImg = imgDownload.getOldSyleImage();
				Minecraft.getMinecraft().getTextureManager().loadTexture(resLocationOld, new DynamicTexture(oldStyleImg));
			}
			textureUploaded = true;
		}
}
 
开发者ID:jm-organization,项目名称:connor41-etfuturum2,代码行数:15,代码来源:NewThreadDownloadImageData.java

示例6: checkTextureUploaded

import net.minecraft.client.renderer.texture.TextureUtil; //导入方法依赖的package包/类
private void checkTextureUploaded() {
    if (!this.textureUploaded) {
        if (this.bufferedImage != null) {
            if (this.textureLocation != null) {
                this.deleteGlTexture();
            }

            TextureUtil.uploadTextureImage(super.getGlTextureId(), this.bufferedImage);
            this.textureUploaded = true;
        }
    }
}
 
开发者ID:MineLittlePony,项目名称:MineLittlePony,代码行数:13,代码来源:ThreadDownloadImageETag.java

示例7: func_147640_e

import net.minecraft.client.renderer.texture.TextureUtil; //导入方法依赖的package包/类
private void func_147640_e()
{
    if (!this.textureUploaded && this.bufferedImage != null)
    {
        if (this.textureLocation != null)
        {
            this.func_147631_c();
        }

        TextureUtil.uploadTextureImage(super.getGlTextureId(), this.bufferedImage);
        this.textureUploaded = true;
    }
}
 
开发者ID:MinecraftModdedClients,项目名称:Resilience-Client-Source,代码行数:14,代码来源:ThreadDownloadImageData.java

示例8: loadTexture

import net.minecraft.client.renderer.texture.TextureUtil; //导入方法依赖的package包/类
@Override
public void loadTexture(ResourceManager resourcemanager) {
    int [][][][] patt = PatternStore.patterns.get(heraldryData.getPatternIndex());
    BufferedImage image = new BufferedImage(patt[heraldryData.getPattern()][0].length, patt[heraldryData.getPattern()][0][0].length,BufferedImage.TYPE_4BYTE_ABGR);

    for(int x = 0; x < image.getWidth(); x++){
        for(int y = 0; y < image.getHeight(); y++){
            image.setRGB(x, y, PatternStore.getBlendedSmallPixel(patt, heraldryData.getPattern(), x, y, heraldryData.getColour(0), heraldryData.getColour(1), heraldryData.getColour(2)));
        }
    }
    TextureUtil.uploadTextureImage(this.getGlTextureId(),  image);
}
 
开发者ID:TheAwesomeGem,项目名称:MineFantasy,代码行数:13,代码来源:HeraldryTextureSmall.java

示例9: createScreenshot

import net.minecraft.client.renderer.texture.TextureUtil; //导入方法依赖的package包/类
public static Screenshot createScreenshot() {
    Screenshot shot = new Screenshot();

    try {
        int screenSize = minecraft.displayWidth * minecraft.displayHeight;

        if (PIXEL_BUFFER == null || PIXEL_BUFFER.capacity() < screenSize) {
            PIXEL_BUFFER = BufferUtils.createIntBuffer(screenSize);
            PIXEL_ARRAY = new int[screenSize];
        }

        glPixelStorei(GL_PACK_ALIGNMENT, 1);
        glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
        PIXEL_BUFFER.clear();
        glReadPixels(0, 0, minecraft.displayWidth, minecraft.displayHeight, GL_BGRA, GL_UNSIGNED_INT_8_8_8_8_REV, PIXEL_BUFFER);
        PIXEL_BUFFER.get(PIXEL_ARRAY);
        copyScreenBuffer(PIXEL_ARRAY, minecraft.displayWidth, minecraft.displayHeight);
        shot.image = new BufferedImage(minecraft.displayWidth, minecraft.displayHeight, 1);
        shot.image.setRGB(0, 0, minecraft.displayWidth, minecraft.displayHeight, PIXEL_ARRAY, 0, minecraft.displayWidth);
        shot.imageID = TextureUtil.uploadTextureImage(TextureUtil.glGenTextures(), shot.image);
    } catch (Exception ex) {
        ex.printStackTrace();
        shot.image = null;
        shot.imageID = 0;
    }

    return shot;
}
 
开发者ID:CodingBadgers,项目名称:bUpload,代码行数:29,代码来源:ScreenshotHandler.java

示例10: getGlTextureId

import net.minecraft.client.renderer.texture.TextureUtil; //导入方法依赖的package包/类
public int getGlTextureId()
{
    int i = super.getGlTextureId();

    if (!this.textureUploaded && this.bufferedImage != null)
    {
        TextureUtil.uploadTextureImage(i, this.bufferedImage);
        this.textureUploaded = true;
    }

    return i;
}
 
开发者ID:HATB0T,项目名称:RuneCraftery,代码行数:13,代码来源:ThreadDownloadImageData.java

示例11: getGlTextureId

import net.minecraft.client.renderer.texture.TextureUtil; //导入方法依赖的package包/类
@Override
public int getGlTextureId() {
	int tex = super.getGlTextureId();

	if (bufferedImage==null)
		return fallbackTexture.getGlTextureId();
	
	if(! textureUploaded){
		bufferedImage=effect.parseUserSkin(bufferedImage);
		TextureUtil.uploadTextureImage(tex, bufferedImage);
		textureUploaded = true;
	}
	
	return tex;
}
 
开发者ID:asiekierka,项目名称:Statues,代码行数:16,代码来源:StatueTextureDownloaded.java

示例12: loadTexture

import net.minecraft.client.renderer.texture.TextureUtil; //导入方法依赖的package包/类
@Override
public void loadTexture(IResourceManager par1ResourceManager) {
	if (bufferedImage == null) {
		try {
			fallbackTexture.loadTexture(par1ResourceManager);
		} catch(Exception e) { e.printStackTrace(); }
	} else {
		TextureUtil.uploadTextureImage(getGlTextureId(), bufferedImage);
	}
}
 
开发者ID:asiekierka,项目名称:Statues,代码行数:11,代码来源:StatueTextureDownloaded.java

示例13: loadTexture

import net.minecraft.client.renderer.texture.TextureUtil; //导入方法依赖的package包/类
@Override
public void loadTexture(IResourceManager resourceManager) throws IOException {
	deleteGlTexture();
	BufferedImage bufferedImage;

	bufferedImage = getImage(resourceManager, face.isVertical() ? vertical : horizontal);
	int[] pixels = ((DataBufferInt) bufferedImage.getRaster().getDataBuffer()).getData();

	byte[] data = face.getData();
	boolean lit = face.isLit();
	for (int x = 0; x < 16; x++) {
		for (int y = 0; y < 16; y++) {
			if (data[x + y * 16] != 0) {
				if (x > 0 && y > 0 && data[x - 1 + (y - 1) * 16] != 0) {
					pixels[x + y * 16] = lit ? blend(INTERNAL_LIGHT, INTERNAL_LIGHT_FADE, MathHelper.sqrt_float((x - 8) * (x - 8) + (y - 8) * (y - 8)) / 8) : BACK;
				} else {
					pixels[x + y * 16] = lit ? LIT_WALL_SHADOW : WALL_SHADOW;
				}
			} else {
				if (x < 15 && data[x + 1 + y * 16] != 0 || x > 0 && data[x - 1 + y * 16] != 0) {
					pixels[x + y * 16] = DISCOLORATION;
				}
				if (lit) {
					float exposure = ((x > 0 ? data[x - 1 + y * 16] : 0) + (y > 0 ? data[x + (y - 1) * 16] : 0) + (x < 15 ? data[x + 1 + y * 16] : 0) + (y < 15 ? data[x + (y + 1) * 16] : 0)) / 4f;
					if (exposure > 0) {
						pixels[x + y * 16] = blend(pixels[x + y * 16], EXTERNAL_LIGHT, exposure * 0.5f + 0.25f);
					}
				}
			}
		}
	}

	TextureUtil.uploadTextureImage(getGlTextureId(), bufferedImage);
}
 
开发者ID:pau101,项目名称:Pumpkin-Carvier,代码行数:35,代码来源:TexturePumpkin.java

示例14: loadTexture

import net.minecraft.client.renderer.texture.TextureUtil; //导入方法依赖的package包/类
@Override
public void loadTexture(IResourceManager resourceManager) throws IOException {
	deleteGlTexture();
	BufferedImage image = new BufferedImage(RESOLUTION + BLUR_RADIUS, RESOLUTION + BLUR_RADIUS, BufferedImage.TYPE_INT_ARGB);
	Graphics2D g = image.createGraphics();
	g.setColor(Color.BLACK);
	g.fillRect(0, 0, image.getWidth(), image.getHeight());
	g.setComposite(AlphaComposite.getInstance(AlphaComposite.SRC));
	g.setColor(TRANSPARENT);
	for (int x = 0; x < 16; x++) {
		for (int y = 0; y < 16; y++) {
			if (data[x + y * 16] == 1) {
				g.fillRect((15 - x) * (RESOLUTION / 16) + OFFSET, y * (RESOLUTION / 16) + OFFSET, RESOLUTION / 16, RESOLUTION / 16);
			}
		}
	}

	image = convolve.filter(image, null);

	BufferedImage finalImage = new BufferedImage(RESOLUTION, RESOLUTION, BufferedImage.TYPE_INT_ARGB);
	g = finalImage.createGraphics();
	AffineTransform transform = new AffineTransform();
	transform.translate(-OFFSET - 1, -OFFSET - 1);
	g.drawRenderedImage(image, transform);

	TextureUtil.uploadTextureImage(getGlTextureId(), finalImage);
}
 
开发者ID:pau101,项目名称:Pumpkin-Carvier,代码行数:28,代码来源:TexturePumpkinBlur.java

示例15: loadTexture

import net.minecraft.client.renderer.texture.TextureUtil; //导入方法依赖的package包/类
@Override
public void loadTexture(IResourceManager resourcemanager) {
    int [][][][] patt = PatternStore.DEFAULT.patterns.get(heraldryData.getPatternIndex());
    BufferedImage image = new BufferedImage(patt[heraldryData.getPattern()][0].length, patt[heraldryData.getPattern()][0][0].length,BufferedImage.TYPE_4BYTE_ABGR);

    for(int x = 0; x < image.getWidth(); x++){
        for(int y = 0; y < image.getHeight(); y++){
            image.setRGB(x, y, PatternStore.getBlendedSmallPixel(patt, heraldryData.getPattern(), x, y, heraldryData.getColour(0), heraldryData.getColour(1), heraldryData.getColour(2)));
        }
    }
    TextureUtil.uploadTextureImage(this.getGlTextureId(),  image);
}
 
开发者ID:Mine-and-blade-admin,项目名称:Battlegear2,代码行数:13,代码来源:HeraldryTextureSmall.java


注:本文中的net.minecraft.client.renderer.texture.TextureUtil.uploadTextureImage方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。