本文整理匯總了Java中net.minecraft.client.renderer.texture.TextureUtil.uploadTextureImageAllocate方法的典型用法代碼示例。如果您正苦於以下問題:Java TextureUtil.uploadTextureImageAllocate方法的具體用法?Java TextureUtil.uploadTextureImageAllocate怎麽用?Java TextureUtil.uploadTextureImageAllocate使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類net.minecraft.client.renderer.texture.TextureUtil
的用法示例。
在下文中一共展示了TextureUtil.uploadTextureImageAllocate方法的11個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: loadTexture
import net.minecraft.client.renderer.texture.TextureUtil; //導入方法依賴的package包/類
public void loadTexture(IResourceManager resourceManager) throws IOException
{
this.deleteGlTexture();
InputStream inputstream = Shaders.getShaderPackResourceStream(this.texturePath);
if (inputstream == null)
{
throw new FileNotFoundException("Shader texture not found: " + this.texturePath);
}
else
{
try
{
BufferedImage bufferedimage = TextureUtil.readBufferedImage(inputstream);
TextureMetadataSection texturemetadatasection = this.loadTextureMetadataSection();
TextureUtil.uploadTextureImageAllocate(this.getGlTextureId(), bufferedimage, texturemetadatasection.getTextureBlur(), texturemetadatasection.getTextureClamp());
}
finally
{
IOUtils.closeQuietly(inputstream);
}
}
}
示例2: loadTexture
import net.minecraft.client.renderer.texture.TextureUtil; //導入方法依賴的package包/類
@Override
public void loadTexture(IResourceManager resourceManager) throws IOException
{
TextureUtil.uploadTextureImageAllocate(this.getGlTextureId(), image, false, false);
ImmutableList.Builder<BakedQuad> builder = ImmutableList.builder();
tasi = new TextureAtlasSpriteBufferedImage(this.rl, this.image);
tasi.load(Minecraft.getMinecraft().getResourceManager(), rl);
builder.addAll(ItemLayerModel.getQuadsForSprite(0, tasi, DefaultVertexFormats.ITEM, Optional.empty()));
quads = builder.build();
}
示例3: loadTexture
import net.minecraft.client.renderer.texture.TextureUtil; //導入方法依賴的package包/類
@Override
public void loadTexture(IResourceManager var1) throws IOException
{
imageEffect.load(var1);
BufferedImage image = IvTextureCreatorMC.getImage(var1, resourceLocation, logger);
if (image == null)
throw new IOException();
BufferedImage modified = IvTextureCreator.applyEffect(image, imageEffect);
TextureUtil.uploadTextureImageAllocate(this.getGlTextureId(), modified, false, false);
}
示例4: addPlayerClothing
import net.minecraft.client.renderer.texture.TextureUtil; //導入方法依賴的package包/類
public static void addPlayerClothing(PlayerClothing clothing) {
players.put(clothing.player, clothing);
try {
if(clothing.glTextureID == -1) {
clothing.glTextureID = TextureUtil.glGenTextures();
}
clothing.createClothingFile(clothingDir, clothingFileDir);
BufferedImage image = ImageIO.read(clothing.getClothingFile(clothingFileDir));
TextureUtil.uploadTextureImageAllocate(clothing.glTextureID, image, false, false);
} catch(Exception e) {
e.printStackTrace();
}
}
示例5: updatePlayerClothing
import net.minecraft.client.renderer.texture.TextureUtil; //導入方法依賴的package包/類
public static void updatePlayerClothing(String username) {
if(players.containsKey(username)) {
try {
PlayerClothing clothing = players.get(username);
if(clothing.glTextureID == -1) {
clothing.glTextureID = TextureUtil.glGenTextures();
}
clothing.createClothingFile(clothingDir, clothingFileDir);
BufferedImage image = ImageIO.read(clothing.getClothingFile(clothingFileDir));
TextureUtil.uploadTextureImageAllocate(clothing.glTextureID, image, false, false);
} catch(Exception e) {
e.printStackTrace();
}
}
}
示例6: loadTexture
import net.minecraft.client.renderer.texture.TextureUtil; //導入方法依賴的package包/類
@Override
public void loadTexture(IResourceManager arg0) throws IOException
{
deleteGlTexture();
TextureUtil.uploadTextureImageAllocate(getGlTextureId(), skin.image, false, false);
SkinData.store.put(location, skin);
}
示例7: setupTexture
import net.minecraft.client.renderer.texture.TextureUtil; //導入方法依賴的package包/類
private void setupTexture(final boolean antiAlias)
{
if(font.getSize() <= 15)
{
IMAGE_WIDTH = 256;
IMAGE_HEIGHT = 256;
}
if(font.getSize() <= 43)
{
IMAGE_WIDTH = 512;
IMAGE_HEIGHT = 512;
}else if(font.getSize() <= 91)
{
IMAGE_WIDTH = 1024;
IMAGE_HEIGHT = 1024;
}else
{
IMAGE_WIDTH = 2048;
IMAGE_HEIGHT = 2048;
}
final BufferedImage img = new BufferedImage(IMAGE_WIDTH, IMAGE_HEIGHT,
BufferedImage.TYPE_INT_ARGB);
final Graphics2D g = (Graphics2D)img.getGraphics();
g.setFont(font);
g.setColor(new Color(255, 255, 255, 0));
g.fillRect(0, 0, IMAGE_WIDTH, IMAGE_HEIGHT);
g.setColor(Color.white);
int rowHeight = 0;
int positionX = 0;
int positionY = 0;
for(int i = 0; i < 2048; i++)
{
final char ch = (char)i;
final BufferedImage fontImage = getFontImage(ch, antiAlias);
final IntObject newIntObject = new IntObject();
newIntObject.width = fontImage.getWidth();
newIntObject.height = fontImage.getHeight();
if(positionX + newIntObject.width >= IMAGE_WIDTH)
{
positionX = 0;
positionY += rowHeight;
rowHeight = 0;
}
newIntObject.storedX = positionX;
newIntObject.storedY = positionY;
if(newIntObject.height > fontHeight)
fontHeight = newIntObject.height;
if(newIntObject.height > rowHeight)
rowHeight = newIntObject.height;
chars[i] = newIntObject;
g.drawImage(fontImage, positionX, positionY, null);
positionX += newIntObject.width;
}
try
{
texID = TextureUtil.uploadTextureImageAllocate(
TextureUtil.glGenTextures(), img, true, true);
}catch(final NullPointerException e)
{
e.printStackTrace();
}
}
示例8: setupTexture
import net.minecraft.client.renderer.texture.TextureUtil; //導入方法依賴的package包/類
private void setupTexture(final boolean antiAlias) {
if (font.getSize() <= 15) {
IMAGE_WIDTH = 256;
IMAGE_HEIGHT = 256;
}
if (font.getSize() <= 43) {
IMAGE_WIDTH = 512;
IMAGE_HEIGHT = 512;
} else if (font.getSize() <= 91) {
IMAGE_WIDTH = 1024;
IMAGE_HEIGHT = 1024;
} else {
IMAGE_WIDTH = 2048;
IMAGE_HEIGHT = 2048;
}
final BufferedImage img = new BufferedImage(IMAGE_WIDTH, IMAGE_HEIGHT, BufferedImage.TYPE_INT_ARGB);
final Graphics2D g = (Graphics2D) img.getGraphics();
g.setFont(font);
g.setColor(new Color(255, 255, 255, 0));
g.fillRect(0, 0, IMAGE_WIDTH, IMAGE_HEIGHT);
g.setColor(Color.white);
int rowHeight = 0;
int positionX = 0;
int positionY = 0;
for (int i = 0; i < 2048; i++) {
final char ch = (char) i;
final BufferedImage fontImage = getFontImage(ch, antiAlias);
final IntObject newIntObject = new IntObject();
newIntObject.width = fontImage.getWidth();
newIntObject.height = fontImage.getHeight();
if (positionX + newIntObject.width >= IMAGE_WIDTH) {
positionX = 0;
positionY += rowHeight;
rowHeight = 0;
}
newIntObject.storedX = positionX;
newIntObject.storedY = positionY;
if (newIntObject.height > fontHeight)
fontHeight = newIntObject.height;
if (newIntObject.height > rowHeight)
rowHeight = newIntObject.height;
chars[i] = newIntObject;
g.drawImage(fontImage, positionX, positionY, null);
positionX += newIntObject.width;
}
try {
texID = TextureUtil.uploadTextureImageAllocate(TextureUtil.glGenTextures(), img, true, true);
} catch (final NullPointerException e) {
e.printStackTrace();
}
}
示例9: loadTexture
import net.minecraft.client.renderer.texture.TextureUtil; //導入方法依賴的package包/類
@Override
public void loadTexture(IResourceManager p_110551_1_) throws IOException {
TextureUtil.uploadTextureImageAllocate(getGlTextureId(), image, false, false);
}
示例10: loadTexture
import net.minecraft.client.renderer.texture.TextureUtil; //導入方法依賴的package包/類
@Override
public void loadTexture(IResourceManager resourceManager) throws IOException {
this.deleteGlTexture();
InputStream inputstream = null;
try
{
IResource iresource = resourceManager.getResource(this.textureLocation);
inputstream = iresource.getInputStream();
BufferedImage bufferedimage = manipulateImage(resourceManager, ImageIO.read(inputstream));
boolean flag = false;
boolean flag1 = false;
if (iresource.hasMetadata())
{
try
{
TextureMetadataSection texturemetadatasection = (TextureMetadataSection)iresource.getMetadata("texture");
if (texturemetadatasection != null)
{
flag = texturemetadatasection.getTextureBlur();
flag1 = texturemetadatasection.getTextureClamp();
}
}
catch (RuntimeException runtimeexception)
{
LOGGER.warn("Failed reading metadata of: " + this.textureLocation, runtimeexception);
}
}
TextureUtil.uploadTextureImageAllocate(this.getGlTextureId(), bufferedimage, flag, flag1);
}
finally
{
if (inputstream != null)
{
inputstream.close();
}
}
}
示例11: loadTexture
import net.minecraft.client.renderer.texture.TextureUtil; //導入方法依賴的package包/類
@Override
public void loadTexture(IResourceManager var1) throws IOException
{
TextureUtil.uploadTextureImageAllocate(this.getGlTextureId(), bufferedImage, false, false);
}