本文整理汇总了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);
}