MCPcopy Create free account
hub / github.com/5zig/The-5zig-Mod / drawGradientRect

Method drawGradientRect

Minecraft-Utils/1.7.10/src/GuiHandle.java:192–230  ·  view source on GitHub ↗
(double left, double top, double right, double bottom, int startColor, int endColor, boolean vertical)

Source from the content-addressed store, hash-verified

190 }
191
192 public static void drawGradientRect(double left, double top, double right, double bottom, int startColor, int endColor, boolean vertical) {
193 float a1 = (float) (startColor >> 24 & 255) / 255.0F;
194 float r1 = (float) (startColor >> 16 & 255) / 255.0F;
195 float g1 = (float) (startColor >> 8 & 255) / 255.0F;
196 float b1 = (float) (startColor & 255) / 255.0F;
197 float a2 = (float) (endColor >> 24 & 255) / 255.0F;
198 float r2 = (float) (endColor >> 16 & 255) / 255.0F;
199 float g2 = (float) (endColor >> 8 & 255) / 255.0F;
200 float b2 = (float) (endColor & 255) / 255.0F;
201
202 GL11.glDisable(GL11.GL_TEXTURE_2D);
203 GLUtil.enableBlend();
204 GLUtil.disableAlpha();
205 GLUtil.tryBlendFuncSeparate(770, 771, 1, 0);
206 GL11.glShadeModel(GL11.GL_SMOOTH);
207 bmh tesselator = bmh.a;
208 tesselator.b();
209 if (!vertical) {
210 tesselator.a(r1, g1, b1, a1);
211 tesselator.a(right, top, 1.0);
212 tesselator.a(left, top, 1.0);
213 tesselator.a(r2, g2, b2, a2);
214 tesselator.b(left, bottom, 1.0);
215 tesselator.b(right, bottom, 1.0);
216 } else {
217 tesselator.a(r1, g1, b1, a1);
218 tesselator.a(left, top, 1.0);
219 tesselator.a(left, bottom, 1.0);
220 tesselator.a(r2, g2, b2, a2);
221 tesselator.a(right, bottom, 1.0);
222 tesselator.a(right, top, 1.0);
223 }
224 tesselator.a();
225
226 GL11.glShadeModel(GL11.GL_FLAT);
227 GLUtil.disableBlend();
228 GL11.glEnable(GL11.GL_ALPHA_TEST);
229 GL11.glEnable(GL11.GL_TEXTURE_2D);
230 }
231
232 public Gui getChild() {
233 return child;

Callers

nothing calls this directly

Calls 6

enableBlendMethod · 0.95
disableAlphaMethod · 0.95
tryBlendFuncSeparateMethod · 0.95
disableBlendMethod · 0.95
bMethod · 0.45
aMethod · 0.45

Tested by

no test coverage detected