java类net.minecraft.client.renderer.GlStateManager的实例源码

LayerEndermanEyes.java 文件源码 项目:BaseClient 阅读 26 收藏 0 点赞 0 评论 0
public void doRenderLayer(EntityEnderman 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.endermanRenderer.bindTexture(field_177203_a);
    GlStateManager.enableBlend();
    GlStateManager.disableAlpha();
    GlStateManager.blendFunc(1, 1);
    GlStateManager.disableLighting();
    GlStateManager.depthMask(!entitylivingbaseIn.isInvisible());
    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.endermanRenderer.getMainModel().render(entitylivingbaseIn, p_177141_2_, p_177141_3_, p_177141_5_, p_177141_6_, p_177141_7_, scale);
    this.endermanRenderer.func_177105_a(entitylivingbaseIn, partialTicks);
    GlStateManager.depthMask(true);
    GlStateManager.disableBlend();
    GlStateManager.enableAlpha();
}
ItemCameraTransforms.java 文件源码 项目:CustomWorldGen 阅读 24 收藏 0 点赞 0 评论 0
public static void applyTransformSide(ItemTransformVec3f vec, boolean leftHand)
{
    if (vec != ItemTransformVec3f.DEFAULT)
    {
        int i = leftHand ? -1 : 1;
        GlStateManager.translate((float)i * (offsetTranslateX + vec.translation.x), offsetTranslateY + vec.translation.y, offsetTranslateZ + vec.translation.z);
        float f = offsetRotationX + vec.rotation.x;
        float f1 = offsetRotationY + vec.rotation.y;
        float f2 = offsetRotationZ + vec.rotation.z;

        if (leftHand)
        {
            f1 = -f1;
            f2 = -f2;
        }

        GlStateManager.rotate(makeQuaternion(f, f1, f2));
        GlStateManager.scale(offsetScaleX + vec.scale.x, offsetScaleY + vec.scale.y, offsetScaleZ + vec.scale.z);
    }
}
RenderPainting.java 文件源码 项目:BaseClient 阅读 21 收藏 0 点赞 0 评论 0
/**
 * Actually renders the given argument. This is a synthetic bridge method, always casting down its argument and then
 * handing it off to a worker function which does the actual work. In all probabilty, the class Render is generic
 * (Render<T extends Entity>) and this method has signature public void doRender(T entity, double d, double d1,
 * double d2, float f, float f1). But JAD is pre 1.5 so doe
 */
public void doRender(EntityPainting entity, double x, double y, double z, float entityYaw, float partialTicks)
{
    GlStateManager.pushMatrix();
    GlStateManager.translate(x, y, z);
    GlStateManager.rotate(180.0F - entityYaw, 0.0F, 1.0F, 0.0F);
    GlStateManager.enableRescaleNormal();
    this.bindEntityTexture(entity);
    EntityPainting.EnumArt entitypainting$enumart = entity.art;
    float f = 0.0625F;
    GlStateManager.scale(f, f, f);
    this.renderPainting(entity, entitypainting$enumart.sizeX, entitypainting$enumart.sizeY, entitypainting$enumart.offsetX, entitypainting$enumart.offsetY);
    GlStateManager.disableRescaleNormal();
    GlStateManager.popMatrix();
    super.doRender(entity, x, y, z, entityYaw, partialTicks);
}
RenderBoat.java 文件源码 项目:CustomWorldGen 阅读 24 收藏 0 点赞 0 评论 0
/**
 * Renders the desired {@code T} type Entity.
 */
public void doRender(EntityBoat entity, double x, double y, double z, float entityYaw, float partialTicks)
{
    GlStateManager.pushMatrix();
    this.setupTranslation(x, y, z);
    this.setupRotation(entity, entityYaw, partialTicks);
    this.bindEntityTexture(entity);

    if (this.renderOutlines)
    {
        GlStateManager.enableColorMaterial();
        GlStateManager.enableOutlineMode(this.getTeamColor(entity));
    }

    this.modelBoat.render(entity, partialTicks, 0.0F, -0.1F, 0.0F, 0.0F, 0.0625F);

    if (this.renderOutlines)
    {
        GlStateManager.disableOutlineMode();
        GlStateManager.disableColorMaterial();
    }

    GlStateManager.popMatrix();
    super.doRender(entity, x, y, z, entityYaw, partialTicks);
}
RenderWitherSkull.java 文件源码 项目:DecompiledMinecraft 阅读 22 收藏 0 点赞 0 评论 0
/**
 * Actually renders the given argument. This is a synthetic bridge method, always casting down its argument and then
 * handing it off to a worker function which does the actual work. In all probabilty, the class Render is generic
 * (Render<T extends Entity>) and this method has signature public void doRender(T entity, double d, double d1,
 * double d2, float f, float f1). But JAD is pre 1.5 so doe
 */
public void doRender(EntityWitherSkull entity, double x, double y, double z, float entityYaw, float partialTicks)
{
    GlStateManager.pushMatrix();
    GlStateManager.disableCull();
    float f = this.func_82400_a(entity.prevRotationYaw, entity.rotationYaw, partialTicks);
    float f1 = entity.prevRotationPitch + (entity.rotationPitch - entity.prevRotationPitch) * partialTicks;
    GlStateManager.translate((float)x, (float)y, (float)z);
    float f2 = 0.0625F;
    GlStateManager.enableRescaleNormal();
    GlStateManager.scale(-1.0F, -1.0F, 1.0F);
    GlStateManager.enableAlpha();
    this.bindEntityTexture(entity);
    this.skeletonHeadModel.render(entity, 0.0F, 0.0F, 0.0F, f, f1, f2);
    GlStateManager.popMatrix();
    super.doRender(entity, x, y, z, entityYaw, partialTicks);
}
GuiSpectator.java 文件源码 项目:BaseClient 阅读 17 收藏 0 点赞 0 评论 0
private void func_175266_a(int p_175266_1_, int p_175266_2_, float p_175266_3_, float p_175266_4_, ISpectatorMenuObject p_175266_5_)
{
    this.field_175268_g.getTextureManager().bindTexture(field_175269_a);

    if (p_175266_5_ != SpectatorMenu.field_178657_a)
    {
        int i = (int)(p_175266_4_ * 255.0F);
        GlStateManager.pushMatrix();
        GlStateManager.translate((float)p_175266_2_, p_175266_3_, 0.0F);
        float f = p_175266_5_.func_178662_A_() ? 1.0F : 0.25F;
        GlStateManager.color(f, f, f, p_175266_4_);
        p_175266_5_.func_178663_a(f, i);
        GlStateManager.popMatrix();
        String s = String.valueOf((Object)GameSettings.getKeyDisplayString(this.field_175268_g.gameSettings.keyBindsHotbar[p_175266_1_].getKeyCode()));

        if (i > 3 && p_175266_5_.func_178662_A_())
        {
            this.field_175268_g.fontRendererObj.drawStringWithShadow(s, (float)(p_175266_2_ + 19 - 2 - this.field_175268_g.fontRendererObj.getStringWidth(s)), p_175266_3_ + 6.0F + 3.0F, 16777215 + (i << 24));
        }
    }
}
EyeOfSchrodingerRenderer.java 文件源码 项目:Solar 阅读 23 收藏 0 点赞 0 评论 0
@Override
protected void applyRotations(EntityEyeOfSchrodinger schrodinger, float p_77043_2_, float rotationYaw, float partialTicks) {
    GlStateManager.rotate(180F - rotationYaw, 0F, 1F, 0F);
    GlStateManager.rotate(-schrodinger.rotationPitch, 1F, 0F, 0.0F);

    if(schrodinger.deathTime > 0) {
        float f = ((float) schrodinger.deathTime + partialTicks - 1.0F) / 20.0F * 1.6F;
        f = MathHelper.sqrt(f);

        if(f > 1.0F) {
            f = 1.0F;
        }

        GlStateManager.rotate(f * this.getDeathMaxRotation(schrodinger), 0.0F, 0.0F, 1.0F);
    }
}
GLHelper.java 文件源码 项目:ArcaneMagic 阅读 31 收藏 0 点赞 0 评论 0
public static void renderParchmentFirstPerson(float pitch, float p_187463_2_, float p_187463_3_,
        ItemStack parchment)
{
    GlStateManager.pushMatrix();
    GlStateManager.pushAttrib();

    float f = MathHelper.sqrt(p_187463_3_);
    float f1 = -0.2F * MathHelper.sin(p_187463_3_ * (float) Math.PI);
    float f2 = -0.4F * MathHelper.sin(f * (float) Math.PI);
    GlStateManager.translate(0.0F, -f1 / 2.0F, f2);
    float f3 = Minecraft.getMinecraft().getItemRenderer().getMapAngleFromPitch(pitch);
    GlStateManager.translate(0.0F, 0.04F + p_187463_2_ * -1.2F + f3 * -0.5F, -0.72F);
    GlStateManager.rotate(f3 * -85.0F, 1.0F, 0.0F, 0.0F);
    Minecraft.getMinecraft().getItemRenderer().renderArms();
    float f4 = MathHelper.sin(f * (float) Math.PI);
    GlStateManager.rotate(f4 * 20.0F, 1.0F, 0.0F, 0.0F);
    GlStateManager.scale(2.0F, 2.0F, 2.0F);
    renderParchmentFirstPerson(parchment);

    GlStateManager.popAttrib();
    GlStateManager.popMatrix();
}
GuiScreen.java 文件源码 项目:DecompiledMinecraft 阅读 24 收藏 0 点赞 0 评论 0
/**
 * Draws the background (i is always 0 as of 1.2.2)
 */
public void drawBackground(int tint)
{
    GlStateManager.disableLighting();
    GlStateManager.disableFog();
    Tessellator tessellator = Tessellator.getInstance();
    WorldRenderer worldrenderer = tessellator.getWorldRenderer();
    this.mc.getTextureManager().bindTexture(optionsBackground);
    GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
    float f = 32.0F;
    worldrenderer.begin(7, DefaultVertexFormats.POSITION_TEX_COLOR);
    worldrenderer.pos(0.0D, (double)this.height, 0.0D).tex(0.0D, (double)((float)this.height / 32.0F + (float)tint)).color(64, 64, 64, 255).endVertex();
    worldrenderer.pos((double)this.width, (double)this.height, 0.0D).tex((double)((float)this.width / 32.0F), (double)((float)this.height / 32.0F + (float)tint)).color(64, 64, 64, 255).endVertex();
    worldrenderer.pos((double)this.width, 0.0D, 0.0D).tex((double)((float)this.width / 32.0F), (double)tint).color(64, 64, 64, 255).endVertex();
    worldrenderer.pos(0.0D, 0.0D, 0.0D).tex(0.0D, (double)tint).color(64, 64, 64, 255).endVertex();
    tessellator.draw();
}
LayerEndermanEyes.java 文件源码 项目:CustomWorldGen 阅读 28 收藏 0 点赞 0 评论 0
public void doRenderLayer(EntityEnderman entitylivingbaseIn, float limbSwing, float limbSwingAmount, float partialTicks, float ageInTicks, float netHeadYaw, float headPitch, float scale)
{
    this.endermanRenderer.bindTexture(RES_ENDERMAN_EYES);
    GlStateManager.enableBlend();
    GlStateManager.disableAlpha();
    GlStateManager.blendFunc(GlStateManager.SourceFactor.ONE, GlStateManager.DestFactor.ONE);
    GlStateManager.disableLighting();
    GlStateManager.depthMask(!entitylivingbaseIn.isInvisible());
    int i = 61680;
    int j = 61680;
    int k = 0;
    OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, 61680.0F, 0.0F);
    GlStateManager.enableLighting();
    GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
    this.endermanRenderer.getMainModel().render(entitylivingbaseIn, limbSwing, limbSwingAmount, ageInTicks, netHeadYaw, headPitch, scale);
    this.endermanRenderer.setLightmap(entitylivingbaseIn, partialTicks);
    GlStateManager.depthMask(true);
    GlStateManager.disableBlend();
    GlStateManager.enableAlpha();
}
RenderVillager.java 文件源码 项目:BaseClient 阅读 22 收藏 0 点赞 0 评论 0
/**
 * Allows the render to do any OpenGL state modifications necessary before the model is rendered. Args:
 * entityLiving, partialTickTime
 */
protected void preRenderCallback(EntityVillager entitylivingbaseIn, float partialTickTime)
{
    float f = 0.9375F;

    if (entitylivingbaseIn.getGrowingAge() < 0)
    {
        f = (float)((double)f * 0.5D);
        this.shadowSize = 0.25F;
    }
    else
    {
        this.shadowSize = 0.5F;
    }

    GlStateManager.scale(f, f, f);
}
ModelArmorSockBiped.java 文件源码 项目:PonySocks2 阅读 17 收藏 0 点赞 0 评论 0
@Override
public void render(Entity entityIn, float limbSwing, float limbSwingAmount, float ageInTicks, float netHeadYaw, float headPitch, float scale) {
    if (stack.getMetadata() > 0) {
        Minecraft.getMinecraft().getTextureManager().bindTexture(LAYERS[Math.min(LAYERS.length - 1, 1 + stack.getMetadata())]);
        super.render(entityIn, limbSwing, limbSwingAmount, ageInTicks, netHeadYaw, headPitch, scale);
        return;
    }

    for (int i = 0; i < 2; i++) {
        int color = PonySocks.sock.getColor(stack, i > 0);
        GlStateManager.color(
                (float) ((color >> 16) & 0xFF) / 255.0f,
                (float) ((color >> 8) & 0xFF) / 255.0f,
                (float) (color & 0xFF) / 255.0f,
                1.0f
        );
        Minecraft.getMinecraft().getTextureManager().bindTexture(LAYERS[i]);
        super.render(entityIn, limbSwing, limbSwingAmount, ageInTicks, netHeadYaw, headPitch, scale);
    }
}
RenderUtils.java 文件源码 项目:EMC 阅读 24 收藏 0 点赞 0 评论 0
public static void searchBox(IBlockPos IBlockPos) {
    RenderUtils.fixDarkLight();
    GlStateManager.resetColor();
    double x = IBlockPos.getX() - Minecraft.getMinecraft().getRenderManager().renderPosX;
    double y = IBlockPos.getY() - Minecraft.getMinecraft().getRenderManager().renderPosY;
    double z = IBlockPos.getZ() - Minecraft.getMinecraft().getRenderManager().renderPosZ;
    GL11.glBlendFunc(770, 771);
    GL11.glEnable(3042);
    GL11.glLineWidth(1.0F);
    float sinus = 1.0F - MathHelper
            .abs(MathHelper.sin(Minecraft.getSystemTime() % 10000L / 10000.0F * 3.1415927F * 4.0F) * 1.0F);
    GL11.glDisable(3553);
    GL11.glDisable(2929);
    GL11.glDepthMask(false);
    GL11.glColor4f(1.0F - sinus, sinus, 0.0F, 0.15F);
    drawColorBox(new AxisAlignedBB(x, y, z, x + 1.0D, y + 1.0D, z + 1.0D), 1.0F - sinus, sinus, 0.0F, 0.15F);
    GL11.glColor4d(0.0D, 0.0D, 0.0D, 0.5D);
    drawSelectionBoundingBox(new AxisAlignedBB(x, y, z, x + 1.0D, y + 1.0D, z + 1.0D));
    GL11.glEnable(3553);
    GL11.glEnable(2929);
    GL11.glDepthMask(true);
    GL11.glDisable(3042);
}
GuiScreenOptionsSounds.java 文件源码 项目:DecompiledMinecraft 阅读 25 收藏 0 点赞 0 评论 0
protected void mouseDragged(Minecraft mc, int mouseX, int mouseY)
{
    if (this.visible)
    {
        if (this.field_146155_p)
        {
            this.field_146156_o = (float)(mouseX - (this.xPosition + 4)) / (float)(this.width - 8);
            this.field_146156_o = MathHelper.clamp_float(this.field_146156_o, 0.0F, 1.0F);
            mc.gameSettings.setSoundLevel(this.field_146153_r, this.field_146156_o);
            mc.gameSettings.saveOptions();
            this.displayString = this.field_146152_s + ": " + GuiScreenOptionsSounds.this.getSoundVolume(this.field_146153_r);
        }

        GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
        this.drawTexturedModalRect(this.xPosition + (int)(this.field_146156_o * (float)(this.width - 8)), this.yPosition, 0, 66, 4, 20);
        this.drawTexturedModalRect(this.xPosition + (int)(this.field_146156_o * (float)(this.width - 8)) + 4, this.yPosition, 196, 66, 4, 20);
    }
}
EntityPickupFX.java 文件源码 项目:DecompiledMinecraft 阅读 22 收藏 0 点赞 0 评论 0
/**
 * Renders the particle
 */
public void renderParticle(WorldRenderer worldRendererIn, Entity entityIn, float partialTicks, float p_180434_4_, float p_180434_5_, float p_180434_6_, float p_180434_7_, float p_180434_8_)
{
    float f = ((float)this.age + partialTicks) / (float)this.maxAge;
    f = f * f;
    double d0 = this.field_174840_a.posX;
    double d1 = this.field_174840_a.posY;
    double d2 = this.field_174840_a.posZ;
    double d3 = this.field_174843_ax.lastTickPosX + (this.field_174843_ax.posX - this.field_174843_ax.lastTickPosX) * (double)partialTicks;
    double d4 = this.field_174843_ax.lastTickPosY + (this.field_174843_ax.posY - this.field_174843_ax.lastTickPosY) * (double)partialTicks + (double)this.field_174841_aA;
    double d5 = this.field_174843_ax.lastTickPosZ + (this.field_174843_ax.posZ - this.field_174843_ax.lastTickPosZ) * (double)partialTicks;
    double d6 = d0 + (d3 - d0) * (double)f;
    double d7 = d1 + (d4 - d1) * (double)f;
    double d8 = d2 + (d5 - d2) * (double)f;
    int i = this.getBrightnessForRender(partialTicks);
    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);
    d6 = d6 - interpPosX;
    d7 = d7 - interpPosY;
    d8 = d8 - interpPosZ;
    this.field_174842_aB.renderEntityWithPosYaw(this.field_174840_a, (double)((float)d6), (double)((float)d7), (double)((float)d8), this.field_174840_a.rotationYaw, partialTicks);
}
CustomItemProperties.java 文件源码 项目:BaseClient 阅读 21 收藏 0 点赞 0 评论 0
public float getTextureHeight(TextureManager p_getTextureHeight_1_)
{
    if (this.textureHeight <= 0)
    {
        if (this.textureLocation != null)
        {
            ITextureObject itextureobject = p_getTextureHeight_1_.getTexture(this.textureLocation);
            int i = itextureobject.getGlTextureId();
            int j = GlStateManager.getBoundTexture();
            GlStateManager.bindTexture(i);
            this.textureHeight = GL11.glGetTexLevelParameteri(GL11.GL_TEXTURE_2D, 0, GL11.GL_TEXTURE_HEIGHT);
            GlStateManager.bindTexture(j);
        }

        if (this.textureHeight <= 0)
        {
            this.textureHeight = 16;
        }
    }

    return (float)this.textureHeight;
}
GuiMachine.java 文件源码 项目:Metalworks 阅读 42 收藏 0 点赞 0 评论 0
@Override
protected void drawGuiContainerBackgroundLayer(float partialTicks, int mouseX, int mouseY) {
    GlStateManager.pushMatrix();
    GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
    this.drawDefaultBackground();
    Pair<Integer, Integer> invCoords = this.machineInterface.getInventoryLocation(this.tile, this.player);
    if(invCoords != null){
        this.texture.bindTexture(INVENTORY_LOCATION);
        this.drawTexturedModalRect(invCoords.getLeft() + this.guiLeft, invCoords.getRight() + this.guiTop, 0, 0, 176, 85);
    }
    this.machineInterface.drawBackground(this.tile, this, this.texture, this.guiLeft, this.guiTop, mouseX, mouseY, partialTicks);
    if(this.energyBar != null){
        IEnergyStorage energy = this.tile.getEnergy(EnumFacing.NORTH);
        if(energy != null && energy.getMaxEnergyStored() > 0){
            this.energyBar.draw(energy.getEnergyStored(), energy.getMaxEnergyStored(), -1);
        }
    }
    GlStateManager.popMatrix();
}
PetrifiedFuelInfoPiece.java 文件源码 项目:Industrial-Foregoing 阅读 17 收藏 0 点赞 0 评论 0
@Override
public void drawForegroundLayer(BasicTeslaGuiContainer container, int guiX, int guiY, int mouseX, int mouseY) {
    super.drawForegroundLayer(container, guiX, guiY, mouseX, mouseY);
    if (this.tile != null) {
        long timeLeft = 0;
        long generatingRate = 0;
        if (this.tile.getGeneratedPowerStored() > 0) {
            timeLeft = ((this.tile.getGeneratedPowerStored() / 2) / this.tile.getGeneratedPowerReleaseRate()) / 20;
            generatingRate = this.tile.getGeneratedPowerReleaseRate();
        }
        FontRenderer renderer = Minecraft.getMinecraft().fontRenderer;
        GlStateManager.pushMatrix();
        GlStateManager.translate(this.getLeft() + 2, this.getTop() + 2, 0);
        GlStateManager.scale(1, 1, 1);
        renderer.drawString(TextFormatting.DARK_GRAY + new TextComponentTranslation("text.industrialforegoing.display.burning").getFormattedText(), 4, 4, 0xFFFFFF);
        renderer.drawString(TextFormatting.DARK_GRAY + getFormatedTime(timeLeft * 1000), 8, (renderer.FONT_HEIGHT) + 5, 0xFFFFFF);
        renderer.drawString(TextFormatting.DARK_GRAY + new TextComponentTranslation("text.industrialforegoing.display.producing").getFormattedText(), 4, 2 * (renderer.FONT_HEIGHT) + 9, 0xFFFFFF);
        renderer.drawString(TextFormatting.DARK_GRAY + "" + generatingRate + " RF/tick", 8, 3 * (renderer.FONT_HEIGHT) + 10, 0xFFFFFF);
        GlStateManager.popMatrix();
    }
}
GuiCreateFlatWorld.java 文件源码 项目:BaseClient 阅读 25 收藏 0 点赞 0 评论 0
private void func_148224_c(int p_148224_1_, int p_148224_2_, int p_148224_3_, int p_148224_4_)
{
    GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
    this.mc.getTextureManager().bindTexture(Gui.statIcons);
    float f = 0.0078125F;
    float f1 = 0.0078125F;
    int i = 18;
    int j = 18;
    Tessellator tessellator = Tessellator.getInstance();
    WorldRenderer worldrenderer = tessellator.getWorldRenderer();
    worldrenderer.begin(7, DefaultVertexFormats.POSITION_TEX);
    worldrenderer.pos((double)(p_148224_1_ + 0), (double)(p_148224_2_ + 18), (double)GuiCreateFlatWorld.this.zLevel).tex((double)((float)(p_148224_3_ + 0) * 0.0078125F), (double)((float)(p_148224_4_ + 18) * 0.0078125F)).endVertex();
    worldrenderer.pos((double)(p_148224_1_ + 18), (double)(p_148224_2_ + 18), (double)GuiCreateFlatWorld.this.zLevel).tex((double)((float)(p_148224_3_ + 18) * 0.0078125F), (double)((float)(p_148224_4_ + 18) * 0.0078125F)).endVertex();
    worldrenderer.pos((double)(p_148224_1_ + 18), (double)(p_148224_2_ + 0), (double)GuiCreateFlatWorld.this.zLevel).tex((double)((float)(p_148224_3_ + 18) * 0.0078125F), (double)((float)(p_148224_4_ + 0) * 0.0078125F)).endVertex();
    worldrenderer.pos((double)(p_148224_1_ + 0), (double)(p_148224_2_ + 0), (double)GuiCreateFlatWorld.this.zLevel).tex((double)((float)(p_148224_3_ + 0) * 0.0078125F), (double)((float)(p_148224_4_ + 0) * 0.0078125F)).endVertex();
    tessellator.draw();
}
GuiStats.java 文件源码 项目:CustomWorldGen 阅读 20 收藏 0 点赞 0 评论 0
/**
 * Draws a sprite from assets/textures/gui/container/stats_icons.png
 */
private void drawSprite(int p_146527_1_, int p_146527_2_, int p_146527_3_, int p_146527_4_)
{
    GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
    this.mc.getTextureManager().bindTexture(STAT_ICONS);
    float f = 0.0078125F;
    float f1 = 0.0078125F;
    int i = 18;
    int j = 18;
    Tessellator tessellator = Tessellator.getInstance();
    VertexBuffer vertexbuffer = tessellator.getBuffer();
    vertexbuffer.begin(7, DefaultVertexFormats.POSITION_TEX);
    vertexbuffer.pos((double)(p_146527_1_ + 0), (double)(p_146527_2_ + 18), (double)this.zLevel).tex((double)((float)(p_146527_3_ + 0) * 0.0078125F), (double)((float)(p_146527_4_ + 18) * 0.0078125F)).endVertex();
    vertexbuffer.pos((double)(p_146527_1_ + 18), (double)(p_146527_2_ + 18), (double)this.zLevel).tex((double)((float)(p_146527_3_ + 18) * 0.0078125F), (double)((float)(p_146527_4_ + 18) * 0.0078125F)).endVertex();
    vertexbuffer.pos((double)(p_146527_1_ + 18), (double)(p_146527_2_ + 0), (double)this.zLevel).tex((double)((float)(p_146527_3_ + 18) * 0.0078125F), (double)((float)(p_146527_4_ + 0) * 0.0078125F)).endVertex();
    vertexbuffer.pos((double)(p_146527_1_ + 0), (double)(p_146527_2_ + 0), (double)this.zLevel).tex((double)((float)(p_146527_3_ + 0) * 0.0078125F), (double)((float)(p_146527_4_ + 0) * 0.0078125F)).endVertex();
    tessellator.draw();
}
GuiScreen.java 文件源码 项目:CustomWorldGen 阅读 24 收藏 0 点赞 0 评论 0
/**
 * Draws the background (i is always 0 as of 1.2.2)
 */
public void drawBackground(int tint)
{
    GlStateManager.disableLighting();
    GlStateManager.disableFog();
    Tessellator tessellator = Tessellator.getInstance();
    VertexBuffer vertexbuffer = tessellator.getBuffer();
    this.mc.getTextureManager().bindTexture(OPTIONS_BACKGROUND);
    GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
    float f = 32.0F;
    vertexbuffer.begin(7, DefaultVertexFormats.POSITION_TEX_COLOR);
    vertexbuffer.pos(0.0D, (double)this.height, 0.0D).tex(0.0D, (double)((float)this.height / 32.0F + (float)tint)).color(64, 64, 64, 255).endVertex();
    vertexbuffer.pos((double)this.width, (double)this.height, 0.0D).tex((double)((float)this.width / 32.0F), (double)((float)this.height / 32.0F + (float)tint)).color(64, 64, 64, 255).endVertex();
    vertexbuffer.pos((double)this.width, 0.0D, 0.0D).tex((double)((float)this.width / 32.0F), (double)tint).color(64, 64, 64, 255).endVertex();
    vertexbuffer.pos(0.0D, 0.0D, 0.0D).tex(0.0D, (double)tint).color(64, 64, 64, 255).endVertex();
    tessellator.draw();
}
LayerDeadmau5Head.java 文件源码 项目:BaseClient 阅读 22 收藏 0 点赞 0 评论 0
public void doRenderLayer(AbstractClientPlayer 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.getName().equals("deadmau5") && entitylivingbaseIn.hasSkin() && !entitylivingbaseIn.isInvisible())
    {
        this.playerRenderer.bindTexture(entitylivingbaseIn.getLocationSkin());

        for (int i = 0; i < 2; ++i)
        {
            float f = entitylivingbaseIn.prevRotationYaw + (entitylivingbaseIn.rotationYaw - entitylivingbaseIn.prevRotationYaw) * partialTicks - (entitylivingbaseIn.prevRenderYawOffset + (entitylivingbaseIn.renderYawOffset - entitylivingbaseIn.prevRenderYawOffset) * partialTicks);
            float f1 = entitylivingbaseIn.prevRotationPitch + (entitylivingbaseIn.rotationPitch - entitylivingbaseIn.prevRotationPitch) * partialTicks;
            GlStateManager.pushMatrix();
            GlStateManager.rotate(f, 0.0F, 1.0F, 0.0F);
            GlStateManager.rotate(f1, 1.0F, 0.0F, 0.0F);
            GlStateManager.translate(0.375F * (float)(i * 2 - 1), 0.0F, 0.0F);
            GlStateManager.translate(0.0F, -0.375F, 0.0F);
            GlStateManager.rotate(-f1, 1.0F, 0.0F, 0.0F);
            GlStateManager.rotate(-f, 0.0F, 1.0F, 0.0F);
            float f2 = 1.3333334F;
            GlStateManager.scale(f2, f2, f2);
            this.playerRenderer.getMainModel().renderDeadmau5Head(0.0625F);
            GlStateManager.popMatrix();
        }
    }
}
Framebuffer.java 文件源码 项目:Backmemed 阅读 23 收藏 0 点赞 0 评论 0
public void bindFramebuffer(boolean p_147610_1_)
{
    if (OpenGlHelper.isFramebufferEnabled())
    {
        OpenGlHelper.glBindFramebuffer(OpenGlHelper.GL_FRAMEBUFFER, this.framebufferObject);

        if (p_147610_1_)
        {
            GlStateManager.viewport(0, 0, this.framebufferWidth, this.framebufferHeight);
        }
    }
}
ChemicalInventoryGui.java 文件源码 项目:FundamentalChemistry 阅读 19 收藏 0 点赞 0 评论 0
@Override
protected void drawGuiContainerBackgroundLayer(float partialTicks,
        int mouseX, int mouseY) {
   GlStateManager.color(1.0f, 1.0f, 1.0f, 1.0f);
   this.mc.getTextureManager().bindTexture(new ResourceLocation("fundamentalchemistry:textures/gui/container/chemical_inventory.png"));
   this.drawTexturedModalRect(this.guiLeft, this.guiTop, 0, 0, this.xSize, this.ySize);

   //display energy
   if(this.inv.max_energy > 0){
    int eh = (int)(this.inv.energy/(float)this.inv.max_energy*39);
    if(eh > 0)
        this.drawTexturedModalRect(this.guiLeft+160, this.guiTop+8+39-eh, 176, 39-eh, 8, eh);
   }
}
EntityLargeExplodeFX.java 文件源码 项目:BaseClient 阅读 27 收藏 0 点赞 0 评论 0
/**
 * Renders the particle
 */
public void renderParticle(WorldRenderer worldRendererIn, Entity entityIn, float partialTicks, float p_180434_4_, float p_180434_5_, float p_180434_6_, float p_180434_7_, float p_180434_8_)
{
    int i = (int)(((float)this.field_70581_a + partialTicks) * 15.0F / (float)this.field_70584_aq);

    if (i <= 15)
    {
        this.theRenderEngine.bindTexture(EXPLOSION_TEXTURE);
        float f = (float)(i % 4) / 4.0F;
        float f1 = f + 0.24975F;
        float f2 = (float)(i / 4) / 4.0F;
        float f3 = f2 + 0.24975F;
        float f4 = 2.0F * this.field_70582_as;
        float f5 = (float)(this.prevPosX + (this.posX - this.prevPosX) * (double)partialTicks - interpPosX);
        float f6 = (float)(this.prevPosY + (this.posY - this.prevPosY) * (double)partialTicks - interpPosY);
        float f7 = (float)(this.prevPosZ + (this.posZ - this.prevPosZ) * (double)partialTicks - interpPosZ);
        GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
        GlStateManager.disableLighting();
        RenderHelper.disableStandardItemLighting();
        worldRendererIn.begin(7, field_181549_az);
        worldRendererIn.pos((double)(f5 - p_180434_4_ * f4 - p_180434_7_ * f4), (double)(f6 - p_180434_5_ * f4), (double)(f7 - p_180434_6_ * f4 - p_180434_8_ * f4)).tex((double)f1, (double)f3).color(this.particleRed, this.particleGreen, this.particleBlue, 1.0F).lightmap(0, 240).normal(0.0F, 1.0F, 0.0F).endVertex();
        worldRendererIn.pos((double)(f5 - p_180434_4_ * f4 + p_180434_7_ * f4), (double)(f6 + p_180434_5_ * f4), (double)(f7 - p_180434_6_ * f4 + p_180434_8_ * f4)).tex((double)f1, (double)f2).color(this.particleRed, this.particleGreen, this.particleBlue, 1.0F).lightmap(0, 240).normal(0.0F, 1.0F, 0.0F).endVertex();
        worldRendererIn.pos((double)(f5 + p_180434_4_ * f4 + p_180434_7_ * f4), (double)(f6 + p_180434_5_ * f4), (double)(f7 + p_180434_6_ * f4 + p_180434_8_ * f4)).tex((double)f, (double)f2).color(this.particleRed, this.particleGreen, this.particleBlue, 1.0F).lightmap(0, 240).normal(0.0F, 1.0F, 0.0F).endVertex();
        worldRendererIn.pos((double)(f5 + p_180434_4_ * f4 - p_180434_7_ * f4), (double)(f6 - p_180434_5_ * f4), (double)(f7 + p_180434_6_ * f4 - p_180434_8_ * f4)).tex((double)f, (double)f3).color(this.particleRed, this.particleGreen, this.particleBlue, 1.0F).lightmap(0, 240).normal(0.0F, 1.0F, 0.0F).endVertex();
        Tessellator.getInstance().draw();
        GlStateManager.enableLighting();
    }
}
RenderCreeper.java 文件源码 项目:BaseClient 阅读 24 收藏 0 点赞 0 评论 0
/**
 * Allows the render to do any OpenGL state modifications necessary before the model is rendered. Args:
 * entityLiving, partialTickTime
 */
protected void preRenderCallback(EntityCreeper entitylivingbaseIn, float partialTickTime)
{
    float f = entitylivingbaseIn.getCreeperFlashIntensity(partialTickTime);
    float f1 = 1.0F + MathHelper.sin(f * 100.0F) * f * 0.01F;
    f = MathHelper.clamp_float(f, 0.0F, 1.0F);
    f = f * f;
    f = f * f;
    float f2 = (1.0F + f * 0.4F) * f1;
    float f3 = (1.0F + f * 0.1F) / f1;
    GlStateManager.scale(f2, f3, f2);
}
RenderLeashKnot.java 文件源码 项目:BaseClient 阅读 22 收藏 0 点赞 0 评论 0
/**
 * Actually renders the given argument. This is a synthetic bridge method, always casting down its argument and then
 * handing it off to a worker function which does the actual work. In all probabilty, the class Render is generic
 * (Render<T extends Entity>) and this method has signature public void doRender(T entity, double d, double d1,
 * double d2, float f, float f1). But JAD is pre 1.5 so doe
 */
public void doRender(EntityLeashKnot entity, double x, double y, double z, float entityYaw, float partialTicks)
{
    GlStateManager.pushMatrix();
    GlStateManager.disableCull();
    GlStateManager.translate((float)x, (float)y, (float)z);
    float f = 0.0625F;
    GlStateManager.enableRescaleNormal();
    GlStateManager.scale(-1.0F, -1.0F, 1.0F);
    GlStateManager.enableAlpha();
    this.bindEntityTexture(entity);
    this.leashKnotModel.render(entity, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, f);
    GlStateManager.popMatrix();
    super.doRender(entity, x, y, z, entityYaw, partialTicks);
}
ChunkRenderDispatcher.java 文件源码 项目:BaseClient 阅读 20 收藏 0 点赞 0 评论 0
private void uploadDisplayList(WorldRenderer p_178510_1_, int p_178510_2_, RenderChunk chunkRenderer)
{
    GL11.glNewList(p_178510_2_, GL11.GL_COMPILE);
    GlStateManager.pushMatrix();
    chunkRenderer.multModelviewMatrix();
    this.worldVertexUploader.func_181679_a(p_178510_1_);
    GlStateManager.popMatrix();
    GL11.glEndList();
}
RenderMagmaCube.java 文件源码 项目:BaseClient 阅读 25 收藏 0 点赞 0 评论 0
/**
 * Allows the render to do any OpenGL state modifications necessary before the model is rendered. Args:
 * entityLiving, partialTickTime
 */
protected void preRenderCallback(EntityMagmaCube entitylivingbaseIn, float partialTickTime)
{
    int i = entitylivingbaseIn.getSlimeSize();
    float f = (entitylivingbaseIn.prevSquishFactor + (entitylivingbaseIn.squishFactor - entitylivingbaseIn.prevSquishFactor) * partialTickTime) / ((float)i * 0.5F + 1.0F);
    float f1 = 1.0F / (f + 1.0F);
    float f2 = (float)i;
    GlStateManager.scale(f1 * f2, 1.0F / f1 * f2, f1 * f2);
}
SurfaceHelper.java 文件源码 项目:ForgeHax 阅读 23 收藏 0 点赞 0 评论 0
public static void drawText(String msg, int x, int y, int color, double scale, boolean shadow) {
    GlStateManager.pushMatrix();
    GlStateManager.disableDepth();
    GlStateManager.scale(scale, scale, scale);
    MC.fontRenderer.drawString(msg, (int)(x * (1/scale)), (int)(y * (1/scale)), color, shadow);
    GlStateManager.enableDepth();
    GlStateManager.popMatrix();
}


问题


面经


文章

微信
公众号

扫码关注公众号