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


Java GlStateManager.disableAlpha方法代码示例

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


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

示例1: renderPumpkinOverlay

import net.minecraft.client.renderer.GlStateManager; //导入方法依赖的package包/类
private void renderPumpkinOverlay(ScaledResolution p_180476_1_)
{
    GlStateManager.disableDepth();
    GlStateManager.depthMask(false);
    GlStateManager.tryBlendFuncSeparate(770, 771, 1, 0);
    GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
    GlStateManager.disableAlpha();
    this.mc.getTextureManager().bindTexture(pumpkinBlurTexPath);
    Tessellator tessellator = Tessellator.getInstance();
    WorldRenderer worldrenderer = tessellator.getWorldRenderer();
    worldrenderer.begin(7, DefaultVertexFormats.POSITION_TEX);
    worldrenderer.pos(0.0D, (double)p_180476_1_.getScaledHeight(), -90.0D).tex(0.0D, 1.0D).endVertex();
    worldrenderer.pos((double)p_180476_1_.getScaledWidth(), (double)p_180476_1_.getScaledHeight(), -90.0D).tex(1.0D, 1.0D).endVertex();
    worldrenderer.pos((double)p_180476_1_.getScaledWidth(), 0.0D, -90.0D).tex(1.0D, 0.0D).endVertex();
    worldrenderer.pos(0.0D, 0.0D, -90.0D).tex(0.0D, 0.0D).endVertex();
    tessellator.draw();
    GlStateManager.depthMask(true);
    GlStateManager.enableDepth();
    GlStateManager.enableAlpha();
    GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:22,代码来源:GuiIngame.java

示例2: draw

import net.minecraft.client.renderer.GlStateManager; //导入方法依赖的package包/类
/**
 * Draws the camera to the screen.
 * Stretches the Framebuffer over the specified area.
 */
public final void draw(float x, float y, float x1, float y1) {
    GlStateManager.pushMatrix();
    GlStateManager.enableTexture2D();
    GlStateManager.disableLighting();
    GlStateManager.disableAlpha();
    GlStateManager.disableBlend();
    GlStateManager.enableColorMaterial();

    GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);

    framebuffer.bindFramebufferTexture();
    if (reflected)
        RenderUtils.drawReflectedTexturedRect(x, y, x1, y1);
    else
        RenderUtils.drawFlippedTexturedRect(x, y, x1, y1);
    framebuffer.unbindFramebufferTexture();

    GlStateManager.popMatrix();
}
 
开发者ID:ImpactDevelopment,项目名称:ClientAPI,代码行数:24,代码来源:Camera.java

示例3: doRenderLayer

import net.minecraft.client.renderer.GlStateManager; //导入方法依赖的package包/类
public void doRenderLayer(EntityDragon entitylivingbaseIn, float p_177141_2_, float p_177141_3_, float partialTicks, float p_177141_5_, float p_177141_6_, float p_177141_7_, float scale)
{
    this.dragonRenderer.bindTexture(TEXTURE);
    GlStateManager.enableBlend();
    GlStateManager.disableAlpha();
    GlStateManager.blendFunc(1, 1);
    GlStateManager.disableLighting();
    GlStateManager.depthFunc(514);
    int i = 61680;
    int j = i % 65536;
    int k = i / 65536;
    OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, (float)j / 1.0F, (float)k / 1.0F);
    GlStateManager.enableLighting();
    GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
    this.dragonRenderer.getMainModel().render(entitylivingbaseIn, p_177141_2_, p_177141_3_, p_177141_5_, p_177141_6_, p_177141_7_, scale);
    this.dragonRenderer.func_177105_a(entitylivingbaseIn, partialTicks);
    GlStateManager.disableBlend();
    GlStateManager.enableAlpha();
    GlStateManager.depthFunc(515);
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:21,代码来源:LayerEnderDragonEyes.java

示例4: renderTick

import net.minecraft.client.renderer.GlStateManager; //导入方法依赖的package包/类
@Override
public void renderTick(float partialTicks)
{
    Minecraft.getMinecraft().mcProfiler.startSection("expParticleDraw");
    Minecraft.getMinecraft().renderEngine.bindTexture(ExPTextures.PARTICLES);
    BufferBuilder bb = Tessellator.getInstance().getBuffer();
    GlStateManager.disableAlpha();
    GlStateManager.disableBlend();
    bb.begin(GL11.GL_QUADS, this.getDrawFormat());
    particles.get(BlockRenderLayer.SOLID).forEach(p -> p.draw(bb, partialTicks, ActiveRenderInfo.getRotationX(), ActiveRenderInfo.getRotationXZ(), ActiveRenderInfo.getRotationZ(), ActiveRenderInfo.getRotationYZ(), ActiveRenderInfo.getRotationXY()));
    Tessellator.getInstance().draw();
    GlStateManager.enableAlpha();
    GlStateManager.alphaFunc(GL11.GL_GREATER, 0.1F);
    bb.begin(GL11.GL_QUADS, this.getDrawFormat());
    particles.get(BlockRenderLayer.CUTOUT).forEach(p -> p.draw(bb, partialTicks, ActiveRenderInfo.getRotationX(), ActiveRenderInfo.getRotationXZ(), ActiveRenderInfo.getRotationZ(), ActiveRenderInfo.getRotationYZ(), ActiveRenderInfo.getRotationXY()));
    Tessellator.getInstance().draw();
    GlStateManager.enableBlend();
    GlStateManager.blendFunc(GlStateManager.SourceFactor.SRC_ALPHA, GlStateManager.DestFactor.ONE_MINUS_SRC_ALPHA);
    bb.begin(GL11.GL_QUADS, this.getDrawFormat());
    particles.get(BlockRenderLayer.TRANSLUCENT).forEach(p -> p.draw(bb, partialTicks, ActiveRenderInfo.getRotationX(), ActiveRenderInfo.getRotationXZ(), ActiveRenderInfo.getRotationZ(), ActiveRenderInfo.getRotationYZ(), ActiveRenderInfo.getRotationXY()));
    Tessellator.getInstance().draw();
    Minecraft.getMinecraft().mcProfiler.endSection();
}
 
开发者ID:V0idWa1k3r,项目名称:ExPetrum,代码行数:24,代码来源:ParticleEngine.java

示例5: drawScreen

import net.minecraft.client.renderer.GlStateManager; //导入方法依赖的package包/类
public void drawScreen(int mouseX, int mouseY, float partialTicks) {
	GlStateManager.disableAlpha();
	this.renderSkybox(mouseX, mouseY, partialTicks);
	GlStateManager.enableAlpha();
	this.drawGradientRect(0, 0, this.width, this.height, -2130706433, 16777215);
	this.drawGradientRect(0, 0, this.width, this.height, 0, Integer.MIN_VALUE);
	GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);

	Client.getClient().onUpdate();
	super.drawScreen(mouseX, mouseY, partialTicks);
}
 
开发者ID:SkidJava,项目名称:BaseClient,代码行数:12,代码来源:GuiLoading.java

示例6: drawGradientRect

import net.minecraft.client.renderer.GlStateManager; //导入方法依赖的package包/类
protected void drawGradientRect(int left, int top, int right, int bottom, int color1, int color2)
{
    float a1 = (float)(color1 >> 24 & 255) / 255.0F;
    float r1 = (float)(color1 >> 16 & 255) / 255.0F;
    float g1 = (float)(color1 >>  8 & 255) / 255.0F;
    float b1 = (float)(color1       & 255) / 255.0F;
    float a2 = (float)(color2 >> 24 & 255) / 255.0F;
    float r2 = (float)(color2 >> 16 & 255) / 255.0F;
    float g2 = (float)(color2 >>  8 & 255) / 255.0F;
    float b2 = (float)(color2       & 255) / 255.0F;
    GlStateManager.disableTexture2D();
    GlStateManager.enableBlend();
    GlStateManager.disableAlpha();
    GlStateManager.tryBlendFuncSeparate(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA, 1, 0);
    GlStateManager.shadeModel(GL11.GL_SMOOTH);
    Tessellator tessellator = Tessellator.getInstance();
    VertexBuffer VertexBuffer = tessellator.getBuffer();
    VertexBuffer.begin(7, DefaultVertexFormats.POSITION_COLOR);
    VertexBuffer.pos(right, top, 0.0D).color(r1, g1, b1, a1).endVertex();
    VertexBuffer.pos(left,  top, 0.0D).color(r1, g1, b1, a1).endVertex();
    VertexBuffer.pos(left,  bottom, 0.0D).color(r2, g2, b2, a2).endVertex();
    VertexBuffer.pos(right, bottom, 0.0D).color(r2, g2, b2, a2).endVertex();
    tessellator.draw();
    GlStateManager.shadeModel(GL11.GL_FLAT);
    GlStateManager.disableBlend();
    GlStateManager.enableAlpha();
    GlStateManager.enableTexture2D();
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:29,代码来源:GuiScrollingList.java

示例7: doRenderLayer

import net.minecraft.client.renderer.GlStateManager; //导入方法依赖的package包/类
public void doRenderLayer(EntitySpider entitylivingbaseIn, float p_177141_2_, float p_177141_3_, float partialTicks, float p_177141_5_, float p_177141_6_, float p_177141_7_, float scale)
{
    this.spiderRenderer.bindTexture(SPIDER_EYES);
    GlStateManager.enableBlend();
    GlStateManager.disableAlpha();
    GlStateManager.blendFunc(1, 1);

    if (entitylivingbaseIn.isInvisible())
    {
        GlStateManager.depthMask(false);
    }
    else
    {
        GlStateManager.depthMask(true);
    }

    int i = 61680;
    int j = i % 65536;
    int k = i / 65536;
    OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, (float)j / 1.0F, (float)k / 1.0F);
    GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
    this.spiderRenderer.getMainModel().render(entitylivingbaseIn, p_177141_2_, p_177141_3_, p_177141_5_, p_177141_6_, p_177141_7_, scale);
    i = entitylivingbaseIn.getBrightnessForRender(partialTicks);
    j = i % 65536;
    k = i / 65536;
    OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, (float)j / 1.0F, (float)k / 1.0F);
    this.spiderRenderer.func_177105_a(entitylivingbaseIn, partialTicks);
    GlStateManager.disableBlend();
    GlStateManager.enableAlpha();
}
 
开发者ID:SkidJava,项目名称:BaseClient,代码行数:31,代码来源:LayerSpiderEyes.java

示例8: drawGradientRect

import net.minecraft.client.renderer.GlStateManager; //导入方法依赖的package包/类
/**
 * Draws a rectangle with a vertical gradient between the specified colors (ARGB format). Args : x1, y1, x2, y2,
 * topColor, bottomColor
 */
protected void drawGradientRect(int left, int top, int right, int bottom, int startColor, int endColor)
{
    float f = (float)(startColor >> 24 & 255) / 255.0F;
    float f1 = (float)(startColor >> 16 & 255) / 255.0F;
    float f2 = (float)(startColor >> 8 & 255) / 255.0F;
    float f3 = (float)(startColor & 255) / 255.0F;
    float f4 = (float)(endColor >> 24 & 255) / 255.0F;
    float f5 = (float)(endColor >> 16 & 255) / 255.0F;
    float f6 = (float)(endColor >> 8 & 255) / 255.0F;
    float f7 = (float)(endColor & 255) / 255.0F;
    GlStateManager.disableTexture2D();
    GlStateManager.enableBlend();
    GlStateManager.disableAlpha();
    GlStateManager.tryBlendFuncSeparate(770, 771, 1, 0);
    GlStateManager.shadeModel(7425);
    Tessellator tessellator = Tessellator.getInstance();
    WorldRenderer worldrenderer = tessellator.getWorldRenderer();
    worldrenderer.begin(7, DefaultVertexFormats.POSITION_COLOR);
    worldrenderer.pos((double)right, (double)top, (double)this.zLevel).color(f1, f2, f3, f).endVertex();
    worldrenderer.pos((double)left, (double)top, (double)this.zLevel).color(f1, f2, f3, f).endVertex();
    worldrenderer.pos((double)left, (double)bottom, (double)this.zLevel).color(f5, f6, f7, f4).endVertex();
    worldrenderer.pos((double)right, (double)bottom, (double)this.zLevel).color(f5, f6, f7, f4).endVertex();
    tessellator.draw();
    GlStateManager.shadeModel(7424);
    GlStateManager.disableBlend();
    GlStateManager.enableAlpha();
    GlStateManager.enableTexture2D();
}
 
开发者ID:SkidJava,项目名称:BaseClient,代码行数:33,代码来源:Gui.java

示例9: renderItemWithTransform

import net.minecraft.client.renderer.GlStateManager; //导入方法依赖的package包/类
public static void renderItemWithTransform(World world, ItemStack stack,
		ItemCameraTransforms.TransformType transform)
{
	GlStateManager.pushMatrix();
	GlStateManager.pushAttrib();
	GlStateManager.enableCull();
	GlStateManager.depthMask(true);
	RenderHelper.enableStandardItemLighting();
	GlStateManager.enableAlpha();
	GlStateManager.enableRescaleNormal();
	GlStateManager.alphaFunc(516, 0.1F);
	GlStateManager.enableBlend();
	GlStateManager.tryBlendFuncSeparate(GlStateManager.SourceFactor.SRC_ALPHA,
			GlStateManager.DestFactor.ONE_MINUS_SRC_ALPHA, GlStateManager.SourceFactor.ONE,
			GlStateManager.DestFactor.ZERO);

	IBakedModel ibakedmodel = Minecraft.getMinecraft().getRenderItem().getItemModelWithOverrides(stack, world,
			(EntityLivingBase) null);
	IBakedModel transformedModel = net.minecraftforge.client.ForgeHooksClient.handleCameraTransforms(ibakedmodel,
			transform, false);
	Minecraft.getMinecraft().getRenderItem().renderItem(stack, transformedModel);

	GlStateManager.disableBlend();
	GlStateManager.disableAlpha();
	RenderHelper.disableStandardItemLighting();
	GlStateManager.depthMask(false);
	GlStateManager.disableCull();
	GlStateManager.popAttrib();
	GlStateManager.popMatrix();
}
 
开发者ID:raphydaphy,项目名称:ArcaneMagic,代码行数:31,代码来源:GLHelper.java

示例10: renderItemOverlayIntoGUI

import net.minecraft.client.renderer.GlStateManager; //导入方法依赖的package包/类
/**
 * Renders the stack size and/or damage bar for the given ItemStack.
 */
public void renderItemOverlayIntoGUI(FontRenderer fr, ItemStack stack, int xPosition, int yPosition, String text)
{
    if (stack != null)
    {
        if (stack.stackSize != 1 || text != null)
        {
            String s = text == null ? String.valueOf(stack.stackSize) : text;

            if (text == null && stack.stackSize < 1)
            {
                s = EnumChatFormatting.RED + String.valueOf(stack.stackSize);
            }

            GlStateManager.disableLighting();
            GlStateManager.disableDepth();
            GlStateManager.disableBlend();
            fr.drawStringWithShadow(s, (float)(xPosition + 19 - 2 - fr.getStringWidth(s)), (float)(yPosition + 6 + 3), 16777215);
            GlStateManager.enableLighting();
            GlStateManager.enableDepth();
        }

        boolean flag = stack.isItemDamaged();

        if (Reflector.ForgeItem_showDurabilityBar.exists())
        {
            flag = Reflector.callBoolean(stack.getItem(), Reflector.ForgeItem_showDurabilityBar, new Object[] {stack});
        }

        if (flag)
        {
            int i = (int)Math.round(13.0D - (double)stack.getItemDamage() * 13.0D / (double)stack.getMaxDamage());
            int j = (int)Math.round(255.0D - (double)stack.getItemDamage() * 255.0D / (double)stack.getMaxDamage());

            if (Reflector.ForgeItem_getDurabilityForDisplay.exists())
            {
                double d0 = Reflector.callDouble(stack.getItem(), Reflector.ForgeItem_getDurabilityForDisplay, new Object[] {stack});
                i = (int)Math.round(13.0D - d0 * 13.0D);
                j = (int)Math.round(255.0D - d0 * 255.0D);
            }

            GlStateManager.disableLighting();
            GlStateManager.disableDepth();
            GlStateManager.disableTexture2D();
            GlStateManager.disableAlpha();
            GlStateManager.disableBlend();
            Tessellator tessellator = Tessellator.getInstance();
            WorldRenderer worldrenderer = tessellator.getWorldRenderer();
            this.func_181565_a(worldrenderer, xPosition + 2, yPosition + 13, 13, 2, 0, 0, 0, 255);
            this.func_181565_a(worldrenderer, xPosition + 2, yPosition + 13, 12, 1, (255 - j) / 4, 64, 0, 255);
            this.func_181565_a(worldrenderer, xPosition + 2, yPosition + 13, i, 1, 255 - j, j, 0, 255);

            if (!Reflector.ForgeHooksClient.exists())
            {
                GlStateManager.enableBlend();
            }

            GlStateManager.enableAlpha();
            GlStateManager.enableTexture2D();
            GlStateManager.enableLighting();
            GlStateManager.enableDepth();
        }
    }
}
 
开发者ID:SkidJava,项目名称:BaseClient,代码行数:67,代码来源:RenderItem.java

示例11: doRenderLayer

import net.minecraft.client.renderer.GlStateManager; //导入方法依赖的package包/类
public void doRenderLayer(EntityDragon entitylivingbaseIn, float p_177141_2_, float p_177141_3_, float partialTicks, float p_177141_5_, float p_177141_6_, float p_177141_7_, float scale)
{
    if (entitylivingbaseIn.deathTicks > 0)
    {
        Tessellator tessellator = Tessellator.getInstance();
        WorldRenderer worldrenderer = tessellator.getWorldRenderer();
        RenderHelper.disableStandardItemLighting();
        float f = ((float)entitylivingbaseIn.deathTicks + partialTicks) / 200.0F;
        float f1 = 0.0F;

        if (f > 0.8F)
        {
            f1 = (f - 0.8F) / 0.2F;
        }

        Random random = new Random(432L);
        GlStateManager.disableTexture2D();
        GlStateManager.shadeModel(7425);
        GlStateManager.enableBlend();
        GlStateManager.blendFunc(770, 1);
        GlStateManager.disableAlpha();
        GlStateManager.enableCull();
        GlStateManager.depthMask(false);
        GlStateManager.pushMatrix();
        GlStateManager.translate(0.0F, -1.0F, -2.0F);

        for (int i = 0; (float)i < (f + f * f) / 2.0F * 60.0F; ++i)
        {
            GlStateManager.rotate(random.nextFloat() * 360.0F, 1.0F, 0.0F, 0.0F);
            GlStateManager.rotate(random.nextFloat() * 360.0F, 0.0F, 1.0F, 0.0F);
            GlStateManager.rotate(random.nextFloat() * 360.0F, 0.0F, 0.0F, 1.0F);
            GlStateManager.rotate(random.nextFloat() * 360.0F, 1.0F, 0.0F, 0.0F);
            GlStateManager.rotate(random.nextFloat() * 360.0F, 0.0F, 1.0F, 0.0F);
            GlStateManager.rotate(random.nextFloat() * 360.0F + f * 90.0F, 0.0F, 0.0F, 1.0F);
            float f2 = random.nextFloat() * 20.0F + 5.0F + f1 * 10.0F;
            float f3 = random.nextFloat() * 2.0F + 1.0F + f1 * 2.0F;
            worldrenderer.begin(6, DefaultVertexFormats.POSITION_COLOR);
            worldrenderer.pos(0.0D, 0.0D, 0.0D).color(255, 255, 255, (int)(255.0F * (1.0F - f1))).endVertex();
            worldrenderer.pos(-0.866D * (double)f3, (double)f2, (double)(-0.5F * f3)).color(255, 0, 255, 0).endVertex();
            worldrenderer.pos(0.866D * (double)f3, (double)f2, (double)(-0.5F * f3)).color(255, 0, 255, 0).endVertex();
            worldrenderer.pos(0.0D, (double)f2, (double)(1.0F * f3)).color(255, 0, 255, 0).endVertex();
            worldrenderer.pos(-0.866D * (double)f3, (double)f2, (double)(-0.5F * f3)).color(255, 0, 255, 0).endVertex();
            tessellator.draw();
        }

        GlStateManager.popMatrix();
        GlStateManager.depthMask(true);
        GlStateManager.disableCull();
        GlStateManager.disableBlend();
        GlStateManager.shadeModel(7424);
        GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
        GlStateManager.enableTexture2D();
        GlStateManager.enableAlpha();
        RenderHelper.enableStandardItemLighting();
    }
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:57,代码来源:LayerEnderDragonDeath.java

示例12: render

import net.minecraft.client.renderer.GlStateManager; //导入方法依赖的package包/类
private void render(boolean noOverlayRendering)
{
    int i = 0;
    int j = 0;
    Tessellator tessellator = Tessellator.getInstance();
    WorldRenderer worldrenderer = tessellator.getWorldRenderer();
    float f = 0.0F;
    MapItemRenderer.this.textureManager.bindTexture(this.location);
    GlStateManager.enableBlend();
    GlStateManager.tryBlendFuncSeparate(1, 771, 0, 1);
    GlStateManager.disableAlpha();
    worldrenderer.begin(7, DefaultVertexFormats.POSITION_TEX);
    worldrenderer.pos((double)((float)(i + 0) + f), (double)((float)(j + 128) - f), -0.009999999776482582D).tex(0.0D, 1.0D).endVertex();
    worldrenderer.pos((double)((float)(i + 128) - f), (double)((float)(j + 128) - f), -0.009999999776482582D).tex(1.0D, 1.0D).endVertex();
    worldrenderer.pos((double)((float)(i + 128) - f), (double)((float)(j + 0) + f), -0.009999999776482582D).tex(1.0D, 0.0D).endVertex();
    worldrenderer.pos((double)((float)(i + 0) + f), (double)((float)(j + 0) + f), -0.009999999776482582D).tex(0.0D, 0.0D).endVertex();
    tessellator.draw();
    GlStateManager.enableAlpha();
    GlStateManager.disableBlend();
    MapItemRenderer.this.textureManager.bindTexture(MapItemRenderer.mapIcons);
    int k = 0;

    for (Vec4b vec4b : this.mapData.mapDecorations.values())
    {
        if (!noOverlayRendering || vec4b.func_176110_a() == 1)
        {
            GlStateManager.pushMatrix();
            GlStateManager.translate((float)i + (float)vec4b.func_176112_b() / 2.0F + 64.0F, (float)j + (float)vec4b.func_176113_c() / 2.0F + 64.0F, -0.02F);
            GlStateManager.rotate((float)(vec4b.func_176111_d() * 360) / 16.0F, 0.0F, 0.0F, 1.0F);
            GlStateManager.scale(4.0F, 4.0F, 3.0F);
            GlStateManager.translate(-0.125F, 0.125F, 0.0F);
            byte b0 = vec4b.func_176110_a();
            float f1 = (float)(b0 % 4 + 0) / 4.0F;
            float f2 = (float)(b0 / 4 + 0) / 4.0F;
            float f3 = (float)(b0 % 4 + 1) / 4.0F;
            float f4 = (float)(b0 / 4 + 1) / 4.0F;
            worldrenderer.begin(7, DefaultVertexFormats.POSITION_TEX);
            float f5 = -0.001F;
            worldrenderer.pos(-1.0D, 1.0D, (double)((float)k * -0.001F)).tex((double)f1, (double)f2).endVertex();
            worldrenderer.pos(1.0D, 1.0D, (double)((float)k * -0.001F)).tex((double)f3, (double)f2).endVertex();
            worldrenderer.pos(1.0D, -1.0D, (double)((float)k * -0.001F)).tex((double)f3, (double)f4).endVertex();
            worldrenderer.pos(-1.0D, -1.0D, (double)((float)k * -0.001F)).tex((double)f1, (double)f4).endVertex();
            tessellator.draw();
            GlStateManager.popMatrix();
            ++k;
        }
    }

    GlStateManager.pushMatrix();
    GlStateManager.translate(0.0F, 0.0F, -0.04F);
    GlStateManager.scale(1.0F, 1.0F, 1.0F);
    GlStateManager.popMatrix();
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:54,代码来源:MapItemRenderer.java

示例13: drawScreen

import net.minecraft.client.renderer.GlStateManager; //导入方法依赖的package包/类
public void drawScreen(int mouseXIn, int mouseYIn, float partialTicks)
{
    if (this.visible)
    {
        this.mouseX = mouseXIn;
        this.mouseY = mouseYIn;
        this.drawBackground();
        int i = this.getScrollBarX();
        int j = i + 6;
        this.bindAmountScrolled();
        GlStateManager.disableLighting();
        GlStateManager.disableFog();
        Tessellator tessellator = Tessellator.getInstance();
        VertexBuffer vertexbuffer = tessellator.getBuffer();
        int k = this.left + this.width / 2 - this.getListWidth() / 2 + 2;
        int l = this.top + 4 - (int)this.amountScrolled;

        if (this.hasListHeader)
        {
            this.drawListHeader(k, l, tessellator);
        }

        this.drawSelectionBox(k, l, mouseXIn, mouseYIn);
        GlStateManager.disableDepth();
        this.overlayBackground(0, this.top, 255, 255);
        this.overlayBackground(this.bottom, this.height, 255, 255);
        GlStateManager.enableBlend();
        GlStateManager.tryBlendFuncSeparate(GlStateManager.SourceFactor.SRC_ALPHA, GlStateManager.DestFactor.ONE_MINUS_SRC_ALPHA, GlStateManager.SourceFactor.ZERO, GlStateManager.DestFactor.ONE);
        GlStateManager.disableAlpha();
        GlStateManager.shadeModel(7425);
        GlStateManager.disableTexture2D();
        int i1 = this.getMaxScroll();

        if (i1 > 0)
        {
            int j1 = (this.bottom - this.top) * (this.bottom - this.top) / this.getContentHeight();
            j1 = MathHelper.clamp_int(j1, 32, this.bottom - this.top - 8);
            int k1 = (int)this.amountScrolled * (this.bottom - this.top - j1) / i1 + this.top;

            if (k1 < this.top)
            {
                k1 = this.top;
            }

            vertexbuffer.begin(7, DefaultVertexFormats.POSITION_TEX_COLOR);
            vertexbuffer.pos((double)i, (double)this.bottom, 0.0D).tex(0.0D, 1.0D).color(0, 0, 0, 255).endVertex();
            vertexbuffer.pos((double)j, (double)this.bottom, 0.0D).tex(1.0D, 1.0D).color(0, 0, 0, 255).endVertex();
            vertexbuffer.pos((double)j, (double)this.top, 0.0D).tex(1.0D, 0.0D).color(0, 0, 0, 255).endVertex();
            vertexbuffer.pos((double)i, (double)this.top, 0.0D).tex(0.0D, 0.0D).color(0, 0, 0, 255).endVertex();
            tessellator.draw();
            vertexbuffer.begin(7, DefaultVertexFormats.POSITION_TEX_COLOR);
            vertexbuffer.pos((double)i, (double)(k1 + j1), 0.0D).tex(0.0D, 1.0D).color(128, 128, 128, 255).endVertex();
            vertexbuffer.pos((double)j, (double)(k1 + j1), 0.0D).tex(1.0D, 1.0D).color(128, 128, 128, 255).endVertex();
            vertexbuffer.pos((double)j, (double)k1, 0.0D).tex(1.0D, 0.0D).color(128, 128, 128, 255).endVertex();
            vertexbuffer.pos((double)i, (double)k1, 0.0D).tex(0.0D, 0.0D).color(128, 128, 128, 255).endVertex();
            tessellator.draw();
            vertexbuffer.begin(7, DefaultVertexFormats.POSITION_TEX_COLOR);
            vertexbuffer.pos((double)i, (double)(k1 + j1 - 1), 0.0D).tex(0.0D, 1.0D).color(192, 192, 192, 255).endVertex();
            vertexbuffer.pos((double)(j - 1), (double)(k1 + j1 - 1), 0.0D).tex(1.0D, 1.0D).color(192, 192, 192, 255).endVertex();
            vertexbuffer.pos((double)(j - 1), (double)k1, 0.0D).tex(1.0D, 0.0D).color(192, 192, 192, 255).endVertex();
            vertexbuffer.pos((double)i, (double)k1, 0.0D).tex(0.0D, 0.0D).color(192, 192, 192, 255).endVertex();
            tessellator.draw();
        }

        this.renderDecorations(mouseXIn, mouseYIn);
        GlStateManager.enableTexture2D();
        GlStateManager.shadeModel(7424);
        GlStateManager.enableAlpha();
        GlStateManager.disableBlend();
    }
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:72,代码来源:GuiSimpleScrolledSelectionListProxy.java

示例14: renderItemOverlayIntoGUI

import net.minecraft.client.renderer.GlStateManager; //导入方法依赖的package包/类
@Override
public void renderItemOverlayIntoGUI(FontRenderer fontRenderer, @Nonnull ItemStack is, int par4, int par5, String par6Str) {
	if (!is.isEmpty() && !dankNull.isEmpty()) {
		float scaleFactor = useLg ? 1.0F : 0.5F;
		float inverseScaleFactor = 1.0F / scaleFactor;
		int offset = useLg ? 0 : -1;
		String stackSize = "";

		boolean unicodeFlag = fontRenderer.getUnicodeFlag();
		fontRenderer.setUnicodeFlag(false);
		if (is.getItem().showDurabilityBar(is)) {
			double health = is.getItem().getDurabilityForDisplay(is);
			int j = (int) Math.round(13.0D - health * 13.0D);
			int i = (int) Math.round(255.0D - health * 255.0D);

			GlStateManager.disableDepth();
			GlStateManager.disableTexture2D();

			Tessellator tessellator = Tessellator.getInstance();
			VertexBuffer vertexbuffer = tessellator.getBuffer();
			draw(vertexbuffer, par4 + 2, par5 + 13, 13, 2, 0, 0, 0, 255);
			draw(vertexbuffer, par4 + 2, par5 + 13, 12, 1, (255 - i) / 4, 64, 0, 255);
			draw(vertexbuffer, par4 + 2, par5 + 13, j, 1, 255 - i, i, 0, 255);

			GlStateManager.enableTexture2D();

			GlStateManager.enableDepth();
		}
		int amount = 0;
		amount = is.getCount();
		if (container != null) {
			//amount = container.getDankNullInventory().getSizeForSlot(DankNullUtils.getIndexForStack(container.getDankNullInventory(), is));
		}
		if (amount < 0 || amount > 127) {
			//amount = (byte) amount & (0xff);
		}
		if (amount != 0) {
			scaleFactor = 0.5F;
			inverseScaleFactor = 1.0F / scaleFactor;
			offset = -1;
			stackSize = getToBeRenderedStackSize(amount);
		}
		GlStateManager.disableLighting();
		GlStateManager.disableAlpha();
		GlStateManager.disableBlend();
		GlStateManager.disableDepth();
		GlStateManager.pushMatrix();
		GlStateManager.scale(scaleFactor, scaleFactor, scaleFactor);
		int X = (int) ((par4 + offset + 16.0F - fontRenderer.getStringWidth(stackSize) * scaleFactor) * inverseScaleFactor);
		int Y = (int) ((par5 + offset + 16.0F - 7.0F * scaleFactor) * inverseScaleFactor);
		if (amount > 1L) {
			fontRenderer.drawStringWithShadow(stackSize, X, Y, 16777215);
		}
		GlStateManager.popMatrix();
		GlStateManager.enableDepth();
		GlStateManager.enableBlend();
		GlStateManager.enableAlpha();
		GlStateManager.enableLighting();

		fontRenderer.setUnicodeFlag(unicodeFlag);
	}
}
 
开发者ID:p455w0rd,项目名称:DankNull,代码行数:63,代码来源:DankNullRenderItem.java

示例15: drawPanorama

import net.minecraft.client.renderer.GlStateManager; //导入方法依赖的package包/类
private void drawPanorama(int p_73970_1_, int p_73970_2_, float p_73970_3_) {
    Tessellator var4 = Tessellator.getInstance();
    WorldRenderer var5 = var4.getWorldRenderer();
    GlStateManager.matrixMode((int)5889);
    GlStateManager.pushMatrix();
    GlStateManager.loadIdentity();
    Project.gluPerspective((float)120.0f, (float)1.0f, (float)0.05f, (float)10.0f);
    GlStateManager.matrixMode((int)5888);
    GlStateManager.pushMatrix();
    GlStateManager.loadIdentity();
    GlStateManager.color((float)1.0f, (float)1.0f, (float)1.0f, (float)1.0f);
    GlStateManager.rotate((float)180.0f, (float)1.0f, (float)0.0f, (float)0.0f);
    GlStateManager.rotate((float)90.0f, (float)0.0f, (float)0.0f, (float)1.0f);
    GlStateManager.enableBlend();
    GlStateManager.disableAlpha();
    GlStateManager.disableCull();
    GlStateManager.depthMask((boolean)false);
    GlStateManager.tryBlendFuncSeparate((int)770, (int)771, (int)1, (int)0);
    int var6 = 8;
    int var7 = 0;
    while (var7 < var6 * var6) {
        GlStateManager.pushMatrix();
        float var8 = ((float)(var7 % var6) / (float)var6 - 0.5f) / 64.0f;
        float var9 = ((float)(var7 / var6) / (float)var6 - 0.5f) / 64.0f;
        float var10 = 0.0f;
        GlStateManager.translate((float)var8, (float)var9, (float)var10);
        GlStateManager.rotate((float)(MathHelper.sin((float)((this.panoramaTimer + p_73970_3_) / 400.0f)) * 25.0f + 20.0f), (float)1.0f, (float)0.0f, (float)0.0f);
        GlStateManager.rotate((float)((- this.panoramaTimer + p_73970_3_) * 0.1f), (float)0.0f, (float)1.0f, (float)0.0f);
        int var11 = 0;
        while (var11 < 6) {
            GlStateManager.pushMatrix();
            if (var11 == 1) {
                GlStateManager.rotate((float)90.0f, (float)0.0f, (float)1.0f, (float)0.0f);
            }
            if (var11 == 2) {
                GlStateManager.rotate((float)180.0f, (float)0.0f, (float)1.0f, (float)0.0f);
            }
            if (var11 == 3) {
                GlStateManager.rotate((float)-90.0f, (float)0.0f, (float)1.0f, (float)0.0f);
            }
            if (var11 == 4) {
                GlStateManager.rotate((float)90.0f, (float)1.0f, (float)0.0f, (float)0.0f);
            }
            if (var11 == 5) {
                GlStateManager.rotate((float)-90.0f, (float)1.0f, (float)0.0f, (float)0.0f);
            }
            this.mc.getTextureManager().bindTexture(titlePanoramaPaths[var11]);
            var5.begin(7, DefaultVertexFormats.POSITION_TEX_COLOR);
            int l = 255 / (var11 + 1);
            float f3 = 0.0F;
            var5.pos(-1.0D, -1.0D, 1.0D).tex(0.0D, 0.0D).color(255, 255, 255, l).endVertex();
            var5.pos(1.0D, -1.0D, 1.0D).tex(1.0D, 0.0D).color(255, 255, 255, l).endVertex();
            var5.pos(1.0D, 1.0D, 1.0D).tex(1.0D, 1.0D).color(255, 255, 255, l).endVertex();
            var5.pos(-1.0D, 1.0D, 1.0D).tex(0.0D, 1.0D).color(255, 255, 255, l).endVertex();
            var4.draw();
            GlStateManager.popMatrix();
            ++var11;
        }
        GlStateManager.popMatrix();
        GlStateManager.colorMask((boolean)true, (boolean)true, (boolean)true, (boolean)false);
        ++var7;
    }
    var5.setTranslation(0.0, 0.0, 0.0);
    GlStateManager.colorMask((boolean)true, (boolean)true, (boolean)true, (boolean)true);
    GlStateManager.matrixMode((int)5889);
    GlStateManager.popMatrix();
    GlStateManager.matrixMode((int)5888);
    GlStateManager.popMatrix();
    GlStateManager.depthMask((boolean)true);
    GlStateManager.enableCull();
    GlStateManager.enableDepth();
}
 
开发者ID:SkidJava,项目名称:BaseClient,代码行数:73,代码来源:AccountScreen.java


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