本文整理匯總了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;
}
}
}
示例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();
}
}
示例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);
}
}
示例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;
}
}
示例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;
}
}
示例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;
}
}
}
示例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);
}
示例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;
}
示例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;
}
示例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;
}
示例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);
}
}
示例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);
}
示例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);
}
示例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);
}