/*
* Dungeons Guide - The most intelligent Hypixel Skyblock Dungeons Mod
* Copyright (C) 2021 cyoung06
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published
* by the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package kr.syeyoung.dungeonsguide.utils;
import kr.syeyoung.dungeonsguide.config.types.AColor;
import kr.syeyoung.dungeonsguide.dungeon.doorfinder.DungeonDoor;
import net.minecraft.client.Minecraft;
import net.minecraft.client.entity.EntityOtherPlayerMP;
import net.minecraft.client.entity.EntityPlayerSP;
import net.minecraft.client.gui.FontRenderer;
import net.minecraft.client.gui.ScaledResolution;
import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.client.renderer.RenderHelper;
import net.minecraft.client.renderer.Tessellator;
import net.minecraft.client.renderer.WorldRenderer;
import net.minecraft.client.renderer.entity.RenderManager;
import net.minecraft.client.renderer.vertex.DefaultVertexFormats;
import net.minecraft.entity.Entity;
import net.minecraft.entity.item.EntityArmorStand;
import net.minecraft.entity.passive.EntityBat;
import net.minecraft.util.*;
import org.lwjgl.input.Keyboard;
import org.lwjgl.input.Mouse;
import org.lwjgl.opengl.GL11;
import org.lwjgl.opengl.GL14;
import javax.vecmath.Vector3f;
import java.awt.*;
import java.util.List;
public class RenderUtils {
public static final ResourceLocation icons = new ResourceLocation("textures/gui/icons.png");
public static void drawTexturedRect(float x, float y, float width, float height, int filter) {
drawTexturedRect(x, y, width, height, 0.0F, 1.0F, 0.0F, 1.0F, filter);
}
private static float zLevel = 0;
public static int scrollY = 0;
public static boolean allowScrolling;
public static int scrollX = 0;
public static void drawRect(int left, int top, int right, int bottom, AColor color)
{
if (left < right)
{
int i = left;
left = right;
right = i;
}
if (top < bottom)
{
int j = top;
top = bottom;
bottom = j;
}
float f3 = (float)(color.getRGB() >> 24 & 255) / 255.0F;
float f = (float)(color.getRGB() >> 16 & 255) / 255.0F;
float f1 = (float)(color.getRGB() >> 8 & 255) / 255.0F;
float f2 = (float)(color.getRGB() & 255) / 255.0F;
if (!color.isChroma() && f3 == 0) return;
Tessellator tessellator = Tessellator.getInstance();
WorldRenderer worldrenderer = tessellator.getWorldRenderer();
GlStateManager.enableBlend();
GlStateManager.disableTexture2D();
GlStateManager.tryBlendFuncSeparate(770, 771, 1, 0);
if (!color.isChroma()) {
GlStateManager.color(f, f1, f2, f3);
worldrenderer.begin(GL11.GL_QUADS, DefaultVertexFormats.POSITION);
worldrenderer.pos(left, bottom, 0.0D).endVertex();
worldrenderer.pos(right, bottom, 0.0D).endVertex();
worldrenderer.pos(right, top, 0.0D).endVertex();
worldrenderer.pos(left, top, 0.0D).endVertex();
} else {
worldrenderer.begin(GL11.GL_QUADS, DefaultVertexFormats.POSITION_COLOR);
GlStateManager.shadeModel(GL11.GL_SMOOTH);
color(worldrenderer.pos(left, bottom, 0.0D), getColorAt(left, bottom, color)).endVertex();