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

Method drawGradientRect

Minecraft-Utils/1.8/src/GuiHandle.java:191–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

189 }
190
191 public static void drawGradientRect(double left, double top, double right, double bottom, int startColor, int endColor, boolean vertical) {
192 float a1 = (float) (startColor >> 24 & 255) / 255.0F;
193 float r1 = (float) (startColor >> 16 & 255) / 255.0F;
194 float g1 = (float) (startColor >> 8 & 255) / 255.0F;
195 float b1 = (float) (startColor & 255) / 255.0F;
196 float a2 = (float) (endColor >> 24 & 255) / 255.0F;
197 float r2 = (float) (endColor >> 16 & 255) / 255.0F;
198 float g2 = (float) (endColor >> 8 & 255) / 255.0F;
199 float b2 = (float) (endColor & 255) / 255.0F;
200
201 cjm.x();
202 GLUtil.enableBlend();
203 GLUtil.disableAlpha();
204 GLUtil.tryBlendFuncSeparate(770, 771, 1, 0);
205 cjm.j(7425);
206 ckx worldRenderer = ckx.a();
207 civ tesselator = worldRenderer.c();
208 tesselator.b();
209 if (!vertical) {
210 tesselator.a(r1, g1, b1, a1);
211 tesselator.b(right, top, 1.0);
212 tesselator.b(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.b(left, top, 1.0);
219 tesselator.b(left, bottom, 1.0);
220 tesselator.a(r2, g2, b2, a2);
221 tesselator.b(right, bottom, 1.0);
222 tesselator.b(right, top, 1.0);
223 }
224 worldRenderer.b();
225
226 cjm.j(7424);
227 GLUtil.disableBlend();
228 cjm.d();
229 cjm.w();
230 }
231
232 public Gui getChild() {
233 return child;

Callers

nothing calls this directly

Calls 8

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

Tested by

no test coverage detected