Пример #1
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 doesn't do that.
   */
  public void doRender(
      Entity par1Entity, double par2, double par4, double par6, float par8, float par9) {
    GL11.glPushMatrix();
    GL11.glTranslatef((float) par2, (float) par4, (float) par6);
    GL11.glEnable(GL12.GL_RESCALE_NORMAL);
    GL11.glScalef(0.5F, 0.5F, 0.5F);
    // this.loadTexture("/warpcraft/items/Items.png");
    Tessellator var10 = Tessellator.instance;

    if (this.itemIconIndex == 9) {
      int var11 = PotionHelper.func_77915_a(((EntityPotion) par1Entity).getPotionDamage(), false);
      float var12 = (float) (var11 >> 16 & 255) / 255.0F;
      float var13 = (float) (var11 >> 8 & 255) / 255.0F;
      float var14 = (float) (var11 & 255) / 255.0F;
      GL11.glColor3f(var12, var13, var14);
      GL11.glPushMatrix();
      this.func_77026_a(var10, 141);
      GL11.glPopMatrix();
      GL11.glColor3f(1.0F, 1.0F, 1.0F);
    }

    this.func_77026_a(var10, this.itemIconIndex);
    GL11.glDisable(GL12.GL_RESCALE_NORMAL);
    GL11.glPopMatrix();
  }
  private void drawLightningBolt(Entity entity) {
    glDisable(GL_TEXTURE_2D);
    glDisable(GL_LIGHTING);

    glColor3f(0, 0.6f, 1);
    glBegin(GL_QUADS);
    int lastX = 0;
    int lastY = 0;
    for (int i = 0; i < 60; i++) {
      int x = i * 2;
      int y = (int) (Math.sin(i * (Math.PI / 4) - entity.ticksExisted * 2.05f) * 2.5f);

      glColor3f(1, 1f, 1);
      glVertex3d(x + 0, y + 0, 0);
      glVertex3d(x + 0, y + 1, 0);
      glVertex3d(lastX, lastY + 1, 0);
      glVertex3d(lastX, lastY, 0);

      glColor3f(0, 0.6f, 1);
      glVertex3d(x + 0, y + 1, 0);
      glVertex3d(x + 0, y + 1.25, 0);
      glVertex3d(lastX, lastY + 1.25, 0);
      glVertex3d(lastX, lastY + 1, 0);

      glVertex3d(x + 0, y - 0.25, 0);
      glVertex3d(x + 0, y, 0);
      glVertex3d(lastX, lastY, 0);
      glVertex3d(lastX, lastY - 0.25, 0);
      lastX = x;
      lastY = y;
    }
    glEnd();
    glEnable(GL_LIGHTING);
    glEnable(GL_TEXTURE_2D);
  }
Пример #3
0
 public final void debugRenderRegions(float landscape_x, float landscape_y) {
   int RADIUS = 30;
   int center_x = toGridCoordinate(landscape_x);
   int center_y = toGridCoordinate(landscape_y);
   int start_x = StrictMath.max(0, center_x - RADIUS);
   int end_x = StrictMath.min(occupants.length - 0, center_x + RADIUS);
   int start_y = StrictMath.max(0, center_y - RADIUS);
   int end_y = StrictMath.min(occupants.length - 0, center_y + RADIUS);
   GL11.glDisable(GL11.GL_TEXTURE_2D);
   GL11.glPointSize(3f);
   GL11.glBegin(GL11.GL_POINTS);
   Region last_region = null;
   for (int y = start_y; y < end_y; y++)
     for (int x = start_x; x < end_x; x++) {
       float xf = coordinateFromGrid(x);
       float yf = coordinateFromGrid(y);
       Region region = getRegion(x, y);
       if (region == null) {
         GL11.glColor3f(1f, 0f, 0f);
       } else {
         last_region = region;
         DebugRender.setColor(region.hashCode());
       }
       GL11.glVertex3f(xf, yf, heightmap.getNearestHeight(xf, yf) + 2f);
     }
   GL11.glEnd();
   GL11.glBegin(GL11.GL_LINES);
   GL11.glColor3f(1f, 0f, 0f);
   if (last_region != null) {
     last_region.debugRenderConnections(heightmap);
     last_region.debugRenderConnectionsReset();
   }
   GL11.glEnd();
   GL11.glEnable(GL11.GL_TEXTURE_2D);
 }
Пример #4
0
 /** Draws a basic loading splash screen. */
 public void drawLoading() {
   // setup
   String s = "Loading...";
   int sWidth = fontManager.s.getWidth(s);
   int sHeight = fontManager.s.getLineHeight();
   int x = -sWidth / 2;
   int y = -sHeight / 2;
   // draw
   gameWindow.clearScreen();
   glDisable(GL_TEXTURE_2D);
   // bottom fade
   glBegin(GL_QUADS);
   glColor3f(0.0f, 0.0f, 0.0f);
   {
     glVertex2f(-gameWindow.getGameWidth() / 2, -gameWindow.getWindowHeight() / 2);
     glVertex2f(gameWindow.getGameWidth() / 2, -gameWindow.getWindowHeight() / 2);
     glVertex2f(gameWindow.getGameWidth() / 2, gameWindow.getWindowHeight() / 2);
     glVertex2f(-gameWindow.getGameWidth() / 2, gameWindow.getWindowHeight() / 2);
   }
   glEnd();
   // center stripe
   glBegin(GL_QUADS);
   glColor3f(0.2f, 0.2f, 0.2f);
   {
     glVertex2f(-gameWindow.getGameWidth() / 2, y - sHeight * 2);
     glVertex2f(gameWindow.getGameWidth() / 2, y - sHeight * 2);
     glVertex2f(gameWindow.getGameWidth() / 2, y + fontManager.s.getLineHeight() + sHeight * 2);
     glVertex2f(-gameWindow.getGameWidth() / 2, y + fontManager.s.getLineHeight() + sHeight * 2);
   }
   glEnd();
   // text
   fontManager.s.drawString(x, y, s, Color.black);
   gameWindow.update();
 }
Пример #5
0
  public void renderGL() {
    GL11.glClear(
        GL11.GL_COLOR_BUFFER_BIT
            | GL11.GL_DEPTH_BUFFER_BIT); // Clear The Screen And The Depth Buffer

    GL11.glColor3f(0.5f, 0.5f, 1.0f); // set the color of the quad (R,G,B,A)
    GL11.glBegin(GL11.GL_QUADS); // draw quad
    GL11.glVertex2f(100, 100);
    GL11.glVertex2f(100 + 200, 100);
    GL11.glVertex2f(100 + 200, 100 + 200);
    GL11.glVertex2f(100, 100 + 200);
    GL11.glEnd();

    font.draw_str("HELLO", 150, 150);

    s.draw(100, 400, 2f);
    s.draw(300, 400, 2.23f);

    GL11.glColor3f(0.5f, 0.5f, 1.0f); // R,G,B,A Set The Color To Blue One Time Only
    GL11.glPushMatrix(); // draw quad
    GL11.glTranslatef(x, y, 0);
    GL11.glRotatef(rotation, 0f, 0f, 1f);
    GL11.glTranslatef(-x, -y, 0);

    GL11.glBegin(GL11.GL_QUADS);
    GL11.glVertex2f(x - 50, y - 50);
    GL11.glVertex2f(x + 50, y - 50);
    GL11.glVertex2f(x + 50, y + 50);
    GL11.glVertex2f(x - 50, y + 50);
    GL11.glEnd();
    GL11.glPopMatrix();
  }
Пример #6
0
 public static void minimap(float playerX, float playerZ, List<Zombie> zombies) {
   glColor3f(0, 0, 0);
   glBegin(GL_QUADS);
   glVertex2i(64, 64);
   glVertex2i(192, 64);
   glVertex2i(192, 192);
   glVertex2i(64, 192);
   glEnd();
   glBegin(GL_POINTS);
   for (int i = 0; i < zombies.size(); i++) {
     glColor3f(zombies.get(i).getCr(), zombies.get(i).getCg(), zombies.get(i).getCb());
     glVertex2f(zombies.get(i).getPx() + 64, (64 - zombies.get(i).getPz()) + 128);
   }
   glColor3f(1, 1, 1);
   for (int i = -1; i <= 1; i++) {
     for (int j = -1; j <= 1; j++) {
       glVertex2f(playerX + 64 + i, (64 - playerZ) + 128 + j);
     }
   }
   glEnd();
   glColor3f(0, 1, 0);
   glBegin(GL_LINE_LOOP);
   glVertex2i(64, 64);
   glVertex2i(192, 64);
   glVertex2i(192, 192);
   glVertex2i(64, 192);
   glEnd();
 }
 public void render(
     Entity p_78088_1_,
     float p_78088_2_,
     float p_78088_3_,
     float p_78088_4_,
     float p_78088_5_,
     float p_78088_6_,
     float scale,
     boolean headOverlay) {
   resetRotations();
   this.setRotationAngles(
       p_78088_2_, p_78088_3_, p_78088_4_, p_78088_5_, p_78088_6_, scale, p_78088_1_);
   GL11.glColor3f(1F, 1F, 1F);
   this.bipedHead.render(scale);
   this.bipedBody.render(scale);
   this.bipedRightArm.render(scale);
   this.bipedLeftArm.render(scale);
   this.bipedRightLeg.render(scale);
   this.bipedLeftLeg.render(scale);
   if (headOverlay) {
     GL11.glDisable(GL11.GL_CULL_FACE);
     this.bipedHeadwear.render(scale);
     GL11.glEnable(GL11.GL_CULL_FACE);
   }
   GL11.glColor3f(1F, 1F, 1F);
 }
  /**
   * 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 doesn't do that.
   */
  public void doRender(
      Entity par1Entity, double par2, double par4, double par6, float par8, float par9) {
    Icon icon = this.field_94151_a.getIconFromDamage(this.field_94150_f);

    if (icon != null) {
      GL11.glPushMatrix();
      GL11.glTranslatef((float) par2, (float) par4, (float) par6);
      GL11.glEnable(GL12.GL_RESCALE_NORMAL);
      GL11.glScalef(0.5F, 0.5F, 0.5F);
      this.bindEntityTexture(par1Entity);
      Tessellator tessellator = Tessellator.instance;

      if (icon == ItemPotion.func_94589_d("bottle_splash")) {
        int i = PotionHelper.func_77915_a(((LaunchedPotion) par1Entity).getPotionDamage(), false);
        float f2 = (float) (i >> 16 & 255) / 255.0F;
        float f3 = (float) (i >> 8 & 255) / 255.0F;
        float f4 = (float) (i & 255) / 255.0F;
        GL11.glColor3f(f2, f3, f4);
        GL11.glPushMatrix();
        this.func_77026_a(tessellator, ItemPotion.func_94589_d("overlay"));
        GL11.glPopMatrix();
        GL11.glColor3f(1.0F, 1.0F, 1.0F);
      }

      this.func_77026_a(tessellator, icon);
      GL11.glDisable(GL12.GL_RESCALE_NORMAL);
      GL11.glPopMatrix();
    }
  }
Пример #9
0
  public static void drawSkeleton(Model m) {
    glPointSize(4);

    // Bones
    glBegin(GL_POINTS);
    {
      for (Bone b : m.bones) {
        glColor3f(0, 0, 1);
        glVertex3f(b.pos.x, b.pos.y, b.pos.z);
      }
    }
    glEnd();

    glColor3f(1, 1, 0);

    Bone b2;

    glBegin(GL_LINES);
    {
      for (Bone b : m.bones) {
        if (b.parent != null) {
          b2 = b.parent;

          glVertex3f(b.pos.x, b.pos.y, b.pos.z);
          glVertex3f(b2.pos.x, b2.pos.y, b2.pos.z);
        }
      }
    }
    glEnd();

    glColor4f(1, 1, 1, 1);
    glPointSize(1);
  }
Пример #10
0
  public static void renderSphere(Vector3f center, float radius, Vector3f colour) {
    glPushAttrib(GL_ENABLE_BIT);
    {
      glDisable(GL_TEXTURE_2D); // Texture 2D is disabled so no textures are incorporated
      glDisable(GL_LIGHTING); // Lighting is turned off for 2D
      glBegin(GL_LINE_LOOP);
      {
        glColor3f(colour.x, colour.y, colour.z);
        for (int i = 0; i < 360; i++) {
          double degInRad = i * Math.PI / 180;
          glVertex3f(
              (float) (center.x + Math.cos(degInRad) * radius),
              (float) (center.y + Math.sin(degInRad) * radius),
              center.z);
        }
      }
      glEnd();

      glBegin(GL_LINE_LOOP);
      {
        glColor3f(colour.x, colour.y, colour.z);
        for (int i = 0; i < 360; i++) {
          double degInRad = i * Math.PI / 180;
          glVertex3f(
              center.x,
              (float) (center.y + Math.cos(degInRad) * radius),
              (float) (center.z + Math.sin(degInRad) * radius));
        }
      }
      glEnd();
    }
    glPopAttrib();
  }
  /** Render quiver on skeletons if possible */
  @SubscribeEvent
  public void renderLiving(RenderLivingEvent.Post event) {

    if (BattlegearConfig.enableSkeletonQuiver
        && event.entity instanceof EntitySkeleton
        && event.renderer instanceof RenderSkeleton) {

      GL11.glPushMatrix();
      GL11.glDisable(GL11.GL_CULL_FACE);

      GL11.glColor3f(1, 1, 1);
      Minecraft.getMinecraft().getTextureManager().bindTexture(quiverDetails);

      GL11.glTranslatef((float) event.x, (float) event.y, (float) event.z);

      GL11.glScalef(1, -1, 1);

      float f2 =
          interpolateRotation(event.entity.prevRenderYawOffset, event.entity.renderYawOffset, 0);

      GL11.glRotatef(180.0F - f2, 0.0F, 1.0F, 0.0F);

      if (event.entity.deathTime > 0) {
        float f3 =
            ((float) event.entity.deathTime + BattlegearClientTickHandeler.getPartialTick() - 1.0F)
                / 20.0F
                * 1.6F;
        f3 = MathHelper.sqrt_float(f3);

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

        GL11.glRotatef(-f3 * 90, 0.0F, 0.0F, 1.0F);
      }

      GL11.glTranslatef(0, -1.5F, 0);

      GL11.glRotatef(event.entity.rotationPitch, 0, 1, 0);

      if (event.entity.getEquipmentInSlot(3) != null) { // chest armor
        GL11.glTranslatef(0, 0, BattlegearRenderHelper.RENDER_UNIT);
      }
      ((ModelBiped) event.renderer.mainModel)
          .bipedBody.postRender(BattlegearRenderHelper.RENDER_UNIT);
      GL11.glScalef(1.05F, 1.05F, 1.05F);
      quiverModel.render(SKELETON_ARROW, BattlegearRenderHelper.RENDER_UNIT);

      Minecraft.getMinecraft().getTextureManager().bindTexture(quiverBase);
      GL11.glColor3f(0.10F, 0.10F, 0.10F);
      quiverModel.render(0, BattlegearRenderHelper.RENDER_UNIT);
      GL11.glColor3f(1, 1, 1);

      GL11.glEnable(GL11.GL_CULL_FACE);
      GL11.glPopMatrix();
    }
  }
 public void renderInventoryBlock(Block block, int metadata, int modelID, RenderBlocks renderer) {
   GL11.glDisable(GL11.GL_LIGHTING);
   GL11.glColor3f(1f, 1f, 1f);
   // if (!YC_Options.EnableOptifineCompability)
   // GL11.glTranslatef(0, 0, 1f);
   GL11.glBindTexture(GL11.GL_TEXTURE_2D, YC_Constants.RemainsTextureID);
   YC_Mod.m_Ore.Draw(0, 0, 1);
   GL11.glColor3f(1f, 1f, 1f);
   GL11.glBindTexture(
       GL11.GL_TEXTURE_2D, Minecraft.getMinecraft().renderEngine.getTexture("/terrain.png"));
   GL11.glEnable(GL11.GL_LIGHTING);
 }
 public void renderInventoryBlock(Block block, int metadata, int modelID, RenderBlocks renderer) {
   GL11.glPushMatrix();
   GL11.glDisable(GL11.GL_LIGHTING);
   GL11.glColor3f(1, 1, 1);
   GL11.glBindTexture(GL11.GL_TEXTURE_2D, YC_Constants.TreeCrystalTextureID);
   GL11.glTranslatef(0, 0, 1);
   YC_Mod.m_TreeCrystal.DrawWOTranslation();
   GL11.glColor3f(1f, 1f, 1f);
   GL11.glPopMatrix();
   // GL11.glBindTexture(GL11.GL_TEXTURE_2D, YC_Constants.TerrainTextureID);
   GL11.glEnable(GL11.GL_LIGHTING);
 }
 public void renderInventoryBlock(Block block, int metadata, int modelId, RenderBlocks renderer) {
   GL11.glPushMatrix();
   GL11.glTranslatef(0.0F, 0.42F, 0.0F);
   GL11.glScalef(0.76F, 0.66F, 0.76F);
   GL11.glRotatef(180.0F, 0.0F, 0.0F, 1.0F);
   GL11.glRotatef(180.0F, 0.0F, 1.0F, 0.0F);
   setMaterialTexture(metadata);
   GL11.glColor3f(1.0F, 1.0F, 1.0F);
   this.model.render((Entity) null, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0625F);
   this.bindTexture(resourceTop);
   float[] color = BlockRendererInterface.colorTable[15 - metadata];
   GL11.glColor3f(color[0], color[1], color[2]);
   this.top.render((Entity) null, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0625F);
   GL11.glPopMatrix();
 }
Пример #15
0
  public void render(int frame) {
    if (childs == null) return;
    Vec3 a = getOffset(frame).getPosition();
    for (int i = 0; i < childs.size(); i++) {
      Vec3 cOffset = childs.get(i).getOffset(frame).getPosition();
      glBegin(GL_LINES);
      glColor3f(1, 0, 0);
      glVertex3f(a.x, a.y, a.z);

      glColor3f(1, 1, 1);
      glVertex3f(cOffset.x, cOffset.y, cOffset.z);
      glEnd();
      childs.get(i).render(frame);
    }
  }
Пример #16
0
  public void draw() {
    float x = 0, y = 0, z = 0, X = (float) -Math.PI, Y = 0.0f, Z = 0.0f;
    Vector3f first = new Vector3f();
    Vector3f second = new Vector3f();
    Vector3f thrird = new Vector3f();

    glPushMatrix();
    {
      glTranslatef(translate.getX(), translate.getY(), translate.getZ());
      glRotatef(angleOfRotation, rotate.getX(), rotate.getY(), rotate.getZ());
      glScalef(scale.getX(), scale.getY(), scale.getZ());
      glColor3f(color.getX(), color.getY(), color.getY());
      glDisable(GL_CULL_FACE);
      glLineWidth(10);

      glBegin(GL_LINE_STRIP);
      {
        while (X < 2 * Math.PI) {
          while (Y < 2 * Math.PI) {
            x = size * (float) Math.cos(X) * (float) Math.cos(Y);
            y = size * (float) Math.cos(X) * (float) Math.sin(Y);
            z = size * (float) Math.sin(X);
            glVertex3f(x, y, z);

            first.setX(x);
            first.setY(y);
            first.setZ(z);

            x = size * (float) Math.cos(X) * (float) Math.cos(Y);
            y = size * (float) Math.cos(X) * (float) Math.sin(Y);
            z = size * (float) Math.sin(X);
            glVertex3f(x, y, z);

            second.setX(x);
            second.setY(y);
            second.setZ(z);

            x = size * (float) Math.cos(X) * (float) Math.cos(Y);
            y = size * (float) Math.cos(X) * (float) Math.sin(Y);
            z = size * (float) Math.sin(X);
            glVertex3f(x, y, z);
            Y += 0.1;

            thrird.setX(x);
            thrird.setY(y);
            thrird.setZ(z);

            first = thrird.crossProduct(first, second, thrird);
            glNormal3f(first.getX(), first.getY(), first.getZ());
          }
          Y = 0;
          X += 0.1;
        }
      }
      glEnd();
      glEnable(GL_CULL_FACE);
      glLineWidth(1);
    }
    glPopMatrix();
  }
Пример #17
0
  public void RenderContingency(int i, int j) {

    AMVector2 contingencyPos = getShiftedVector(AMCore.config.getContingencyPosition(), i, j);

    IIcon icon = null;
    ContingencyTypes type =
        ExtendedProperties.For(Minecraft.getMinecraft().thePlayer).getContingencyType();
    switch (type) {
      case DAMAGE_TAKEN:
        icon = SpellIconManager.instance.getIcon("Contingency_Damage");
        break;
      case FALL:
        icon = SpellIconManager.instance.getIcon("Contingency_Fall");
        break;
      case HEALTH_LOW:
        icon = SpellIconManager.instance.getIcon("Contingency_Health");
        break;
      case ON_FIRE:
        icon = SpellIconManager.instance.getIcon("Contingency_Fire");
        break;
      case DEATH:
        icon = SpellIconManager.instance.getIcon("Contingency_Death");
        break;
      case NONE:
      default:
        return;
    }

    DrawIconAtXY(icon, "items", contingencyPos.iX, contingencyPos.iY, 16, 16, true);
    GL11.glColor3f(1.0f, 1.0f, 1.0f);
  }
Пример #18
0
  public void render() {

    glBindTexture(GL_TEXTURE_2D, x_pos * 2 * (1 + y_pos * 2));

    glBegin(GL_TRIANGLES);
    glColor3f(1f, 1f, 1f);
    glTexCoord2f(0f, 1f);
    glVertex2f(x_pos + 0f, y_pos + 0f);

    glTexCoord2f(1f, 1f);
    glVertex2f(x_pos + 1f, y_pos + 0f);

    glTexCoord2f(0f, 0f);
    glVertex2f(x_pos + 0f, y_pos + 1f);
    glEnd();

    glBegin(GL_TRIANGLES);
    glTexCoord2f(1f, 1f);
    glVertex2f(x_pos + 1f, y_pos + 0f);

    glTexCoord2f(1f, 0f);
    glVertex2f(x_pos + 1f, y_pos + 1f);

    glTexCoord2f(0f, 0f);
    glVertex2f(x_pos + 0f, y_pos + 1f);
    glEnd();
  }
Пример #19
0
  @Override
  protected void doFlush() {
    // TODO: Use fallback material modes for this
    if (!(activeMaterial.getShader() instanceof BasicShader)) {
      throw new IllegalStateException("Need Basic Shader in 1.1 mode");
    }

    GL11.glNewList(displayList, GL11.GL_COMPILE);
    ((BasicShader) activeMaterial.getShader()).assign(true);
    GL11.glPushMatrix();
    GL11.glBegin(renderMode);
    for (int i = 0; i < numVerticies; i += 1) {
      int index = i * 4;
      if (useColors) {
        GL11.glColor3f(
            colorBuffer.get(index), colorBuffer.get(index + 1), colorBuffer.get(index + 2));
      }
      if (useNormals) {
        GL11.glNormal3f(
            normalBuffer.get(index), normalBuffer.get(index + 1), normalBuffer.get(index + 2));
      }
      if (useTextures) {
        GL11.glTexCoord2f(uvBuffer.get((i * 2)), uvBuffer.get((i * 2) + 1));
      }
      GL11.glVertex4f(
          vertexBuffer.get(index),
          vertexBuffer.get(index + 1),
          vertexBuffer.get(index + 2),
          vertexBuffer.get(index + 3));
    }
    GL11.glEnd();
    GL11.glPopMatrix();
    GL11.glEndList();
  }
Пример #20
0
  private void func_77008_a(EntityPainting p_77008_1_, float p_77008_2_, float p_77008_3_) {
    int var4 = MathHelper.func_76128_c(p_77008_1_.field_70165_t);
    int var5 = MathHelper.func_76128_c(p_77008_1_.field_70163_u + (double) (p_77008_3_ / 16.0F));
    int var6 = MathHelper.func_76128_c(p_77008_1_.field_70161_v);
    if (p_77008_1_.field_82332_a == 2) {
      var4 = MathHelper.func_76128_c(p_77008_1_.field_70165_t + (double) (p_77008_2_ / 16.0F));
    }

    if (p_77008_1_.field_82332_a == 1) {
      var6 = MathHelper.func_76128_c(p_77008_1_.field_70161_v - (double) (p_77008_2_ / 16.0F));
    }

    if (p_77008_1_.field_82332_a == 0) {
      var4 = MathHelper.func_76128_c(p_77008_1_.field_70165_t - (double) (p_77008_2_ / 16.0F));
    }

    if (p_77008_1_.field_82332_a == 3) {
      var6 = MathHelper.func_76128_c(p_77008_1_.field_70161_v + (double) (p_77008_2_ / 16.0F));
    }

    int var7 = this.field_76990_c.field_78722_g.func_72802_i(var4, var5, var6, 0);
    int var8 = var7 % 65536;
    int var9 = var7 / 65536;
    OpenGlHelper.func_77475_a(OpenGlHelper.field_77476_b, (float) var8, (float) var9);
    GL11.glColor3f(1.0F, 1.0F, 1.0F);
  }
Пример #21
0
 public static void render() {
   GL11.glClearColor(0f, 255f / 191f, 1f, 0f);
   GL11.glClear(GL11.GL_COLOR_BUFFER_BIT | GL11.GL_DEPTH_BUFFER_BIT);
   GL11.glColor3f(0.5f, 0.5f, 1.0f);
   GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MAG_FILTER, GL11.GL_NEAREST);
   GL11.glLoadIdentity();
   lookThrough();
   /*doPicking();
   namemap = new HashMap<Integer, Location>();
   Render.renderArray(world.getSpawn());
   GL11.glLoadIdentity();
   game.render();
   stopPicking();*/
   // Picking junk
   /*GL11.glClear(GL11.GL_COLOR_BUFFER_BIT | GL11.GL_DEPTH_BUFFER_BIT);
   GL11.glColor3f(0.5f,0.5f,1.0f);
   GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MAG_FILTER, GL11.GL_NEAREST);
   GL11.glLoadIdentity();
   lookThrough();*/
   Render.renderArray(world.getSpawn());
   Render.renderEntities(world.entities);
   /*GL11.glLoadIdentity();
   game.render();*/
   Display.update();
 }
Пример #22
0
 public void renderFirstPersonArm(EntityPlayer p_82441_1_) {
   float f = 1.0F;
   GL11.glColor3f(f, f, f);
   this.modelBipedMain.onGround = 0.0F;
   this.modelBipedMain.setRotationAngles(0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0625F, p_82441_1_);
   this.modelMainEgg.RightArm_1.render(0.0625F);
 }
Пример #23
0
 public void func_82441_a(EntityPlayer par1EntityPlayer) {
   float var2 = 1.0F;
   GL11.glColor3f(var2, var2, var2);
   this.modelBipedMain.onGround = 0.0F;
   this.modelBipedMain.setRotationAngles(0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0625F, par1EntityPlayer);
   this.modelBipedMain.bipedRightArm.render(0.0625F);
 }
Пример #24
0
  /*
   * If the shader was setup succesfully, we use the shader. Otherwise
   * we run normal drawing code.
   */
  public void draw() {
    if (useShader) {
      ARBShaderObjects.glUseProgramObjectARB(shader);
    }
    GL11.glLoadIdentity();
    GL11.glTranslatef(0.0f, 0.0f, -10.0f);
    GL11.glColor3f(1.0f, 1.0f, 1.0f); // red

    GL11.glBegin(GL11.GL_QUADS);
    GL11.glVertex3f(-1.0f, 1.0f, 0.0f);
    GL11.glVertex3f(1.0f, 1.0f, 0.0f);
    GL11.glVertex3f(1.0f, -1.0f, 0.0f);
    GL11.glVertex3f(-1.0f, -1.0f, 0.0f);
    GL11.glEnd();

    // GL11.glColor3f(0.0f, 1.0f, 0.0f);//green

    // if(useShader) {
    // ARBShaderObjects.glUseProgramObjectARB(fragShader);
    // }

    /*GL11.glBegin(GL11.GL_QUADS);
    GL11.glVertex3f(-1.0f, 1.0f, 0.0f);
    GL11.glVertex3f(1.0f, 1.0f, 0.0f);
    GL11.glVertex3f(1.0f, -1.0f, 0.0f);
    GL11.glVertex3f(-1.0f, -1.0f, 0.0f);
    GL11.glEnd();*/

    // release the shader
    ARBShaderObjects.glUseProgramObjectARB(0);
  }
Пример #25
0
  @Override
  public void renderItem(ItemRenderType type, ItemStack item, Object... data) {
    GL11.glPushMatrix();
    ArrayList upgrades = PolytoolItem.getUpgrades(item);
    int count = 1;
    float red = 0F;
    float green = 0F;
    float blue = 0F;

    for (int i = 0; i < upgrades.size(); i++) {
      for (int j = 0; j < ((PolytoolUpgradeType) upgrades.get(i)).power; j++) {
        count++;
      }
    }
    for (int i = 0; i < upgrades.size(); i++) {
      for (int j = 0; j < ((PolytoolUpgradeType) upgrades.get(i)).power; j++) {
        ElementEnum element = ((PolytoolUpgradeType) upgrades.get(i)).getElement();
        red += (1 / count) * getRed(element);
        green += (1 / count) * getGreen(element);
        blue += (1 / count) * getBlue(element);
      }
    }
    GL11.glColor3f(red, green, blue);

    // Get icon index for the texture
    IIcon icon = item.getIconIndex();
    // Use vanilla code to render the icon in a 16x16 square of inventory slot
    renderItem.renderIcon(0, 0, icon, 16, 16);

    GL11.glPopMatrix();
  }
Пример #26
0
  public void RenderAffinity(int i, int j) {
    AMVector2 affinityPos = getShiftedVector(AMCore.config.getAffinityPosition(), i, j);

    int x = affinityPos.iX;
    int y = affinityPos.iY;

    AffinityData ad = AffinityData.For(Minecraft.getMinecraft().thePlayer);
    for (Affinity affinity : ad.getHighestAffinities()) {
      if (affinity == null || affinity == Affinity.NONE) continue;
      GL11.glColor3f(1.0f, 1.0f, 1.0f);
      AMGuiHelper.instance.DrawIconAtXY(
          affinity.representItem.getIconFromDamage(affinity.representMeta), x, y, j, 12, 12, true);

      if (AMCore.config.getShowNumerics()) {
        String display =
            String.format(
                "%.2f%%", AffinityData.For(mc.thePlayer).getAffinityDepth(affinity) * 100);
        if (x < i / 2)
          Minecraft.getMinecraft().fontRenderer.drawString(display, x + 14, y + 2, affinity.color);
        else
          Minecraft.getMinecraft()
              .fontRenderer
              .drawString(
                  display,
                  x - 2 - Minecraft.getMinecraft().fontRenderer.getStringWidth(display),
                  y + 2,
                  affinity.color);
      }
      y += 15;
    }
  }
Пример #27
0
 @SubscribeEvent(priority = EventPriority.LOWEST)
 @Optional.Method(modid = Mods.OpenComputers)
 public void onRobotRender(RobotRenderEvent e) {
   if (!rendering) {
     return;
   }
   if (e.mountPoints == null || e.mountPoints.length < 2) {
     return;
   }
   MountPoint mountPoint = e.mountPoints[1];
   GL11.glPushMatrix();
   GL11.glPushAttrib(GL11.GL_ALL_ATTRIB_BITS);
   GL11.glTranslatef(0.5f, 0.5f, 0.5f);
   GL11.glColor3f(color.r, color.g, color.b);
   float degrees = 360 - ((time % 160) / 160F * 360F);
   Minecraft.getMinecraft().getTextureManager().bindTexture(modelRadar);
   GL11.glDisable(GL11.GL_CULL_FACE);
   GL11.glRotatef(180, 1, 0, 0);
   GL11.glRotatef(
       mountPoint.rotation.getW(),
       mountPoint.rotation.getX(),
       mountPoint.rotation.getY(),
       mountPoint.rotation.getZ());
   GL11.glTranslatef(0F, -0.8F, 0F);
   GL11.glTranslatef(mountPoint.offset.getX(), mountPoint.offset.getY(), mountPoint.offset.getZ());
   GL11.glScalef(0.3f, 0.3f, 0.3f);
   GL11.glPushMatrix();
   radarModel.render(Math.max(degrees, 0));
   GL11.glPopMatrix();
   GL11.glPopMatrix();
   GL11.glPopAttrib();
 }
 public void renderTileEntityAt(
     TileEntity var1, double var2, double var4, double var6, float var8) {
   TileTallLamp tile = (TileTallLamp) var1;
   GL11.glDisable('\u803a');
   GL11.glPushMatrix();
   GL11.glTranslatef((float) var2 + 0.5F, (float) var4 + 1.5F, (float) var6 + 0.5F);
   GL11.glRotatef(180.0F, 0.0F, 0.0F, 1.0F);
   GL11.glRotatef((float) (90 * tile.rotation), 0.0F, 1.0F, 0.0F);
   GL11.glColor3f(1.0F, 1.0F, 1.0F);
   setMaterialTexture(var1.getBlockMetadata());
   this.model.render((Entity) null, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0625F);
   this.bindTexture(resourceTop);
   float[] color = BlockRendererInterface.colorTable[tile.color];
   GL11.glColor3f(color[0], color[1], color[2]);
   this.top.render((Entity) null, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0625F);
   GL11.glPopMatrix();
 }
Пример #29
0
 public static void renderScene() {
   game.render();
   GL11.glColor3f(0.5f, 0.5f, 1.0f);
   GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MAG_FILTER, GL11.GL_NEAREST);
   Render.renderArray(world.getSpawn());
   GL11.glLoadIdentity();
   Display.update();
 }
Пример #30
0
  /** 画出视点跟视角 */
  public void drawFrustum() {

    GL11.glDisable(GL11.GL_LIGHTING);
    GL11.glDisable(GL11.GL_TEXTURE_2D);
    GL11.glDisable(GL11.GL_TEXTURE_GEN_S);
    GL11.glDisable(GL11.GL_TEXTURE_GEN_T);
    GL11.glBegin(GL11.GL_LINES);

    // Draw the View Vector starting at the eye (red)
    GL11.glColor3f(1, 0, 0);
    GL11.glVertex3f(viewPosition[0], viewPosition[1], viewPosition[2]);
    GL11.glVertex3f(
        (float) (viewPosition[0] + 50.0f * Math.sin(gClipAngle * Math.PI / 180.0f)),
        viewPosition[1],
        (float) (viewPosition[2] - 50.0f * Math.cos(gClipAngle * Math.PI / 180.0f)));
    // Draw the view frustum (blue)
    GL11.glColor3f(0, 0, 1);
    GL11.glVertex3f(viewPosition[0], viewPosition[1], viewPosition[2]);
    GL11.glVertex3f(
        (float) (viewPosition[0] + 1000.0f * Math.sin((gClipAngle - 45.0f) * Math.PI / 180.0f)),
        viewPosition[1],
        (float) (viewPosition[2] - 1000.0f * Math.cos((gClipAngle - 45.0f) * Math.PI / 180.0f)));
    GL11.glVertex3f(viewPosition[0], viewPosition[1], viewPosition[2]);
    GL11.glVertex3f(
        (float) (viewPosition[0] + 1000.0f * Math.sin((gClipAngle + 45.0f) * Math.PI / 180.0f)),
        viewPosition[1],
        (float) (viewPosition[2] - 1000.0f * Math.cos((gClipAngle + 45.0f) * Math.PI / 180.0f)));
    // Draw the clipping planes behind the eye (yellow)
    int ptEyeX = (int) (viewPosition[0] - patchSize * Math.sin(gClipAngle * PI_DIV_180));
    int ptEyeY = (int) (viewPosition[2] + patchSize * Math.cos(gClipAngle * PI_DIV_180));

    int ptLeftX = (int) (ptEyeX + 100.0f * Math.sin((gClipAngle - FOV_DIV_2) * PI_DIV_180));
    int ptLeftY = (int) (ptEyeY - 100.0f * Math.cos((gClipAngle - FOV_DIV_2) * PI_DIV_180));

    int ptRightX = (int) (ptEyeX + 100.0f * Math.sin((gClipAngle + FOV_DIV_2) * PI_DIV_180));
    int ptRightY = (int) (ptEyeY - 100.0f * Math.cos((gClipAngle + FOV_DIV_2) * PI_DIV_180));

    GL11.glColor3f(1, 1, 0);
    GL11.glVertex3f((float) ptEyeX, viewPosition[1], (float) ptEyeY);
    GL11.glVertex3f((float) ptLeftX, viewPosition[1], (float) ptLeftY);
    GL11.glVertex3f((float) ptEyeX, viewPosition[1], (float) ptEyeY);
    GL11.glVertex3f((float) ptRightX, viewPosition[1], (float) ptRightY);
    GL11.glEnd();
    GL11.glLineWidth(1.f);
    GL11.glColor3f(1, 1, 1);
  }