Skip to content

Commit e52f70a

Browse files
committed
remove some redundant gl calls
1 parent f81ecea commit e52f70a

File tree

2 files changed

+2
-9
lines changed

2 files changed

+2
-9
lines changed

src/main/java/com/cleanroommc/modularui/screen/ClientScreenHandler.java

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -420,17 +420,14 @@ public static void drawContainer(ModularScreen muiScreen, GuiContainer mcScreen,
420420
GlStateManager.disableDepth();
421421
// mainly for invtweaks compat
422422
drawVanillaElements(mcScreen, mouseX, mouseY, partialTicks);
423-
GlStateManager.pushMatrix();
424-
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
425-
GlStateManager.enableRescaleNormal();
426423
acc.setHoveredSlot(null);
424+
GlStateManager.pushMatrix();
427425
OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, 240.0F, 240.0F);
428426
GlStateManager.enableRescaleNormal();
429427
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
430428
RenderHelper.disableStandardItemLighting();
431429
acc.invokeDrawGuiContainerForegroundLayer(mouseX, mouseY);
432430
muiScreen.drawForeground();
433-
RenderHelper.enableGUIStandardItemLighting();
434431

435432
acc.setHoveredSlot(null);
436433
IGuiElement hovered = muiScreen.getContext().getHovered();

src/main/java/com/cleanroommc/modularui/widget/WidgetTree.java

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -139,11 +139,10 @@ public static void drawTree(IWidget parent, ModularGuiContext context, boolean i
139139
GlStateManager.pushMatrix();
140140
context.applyToOpenGl();
141141

142+
GlStateManager.colorMask(true, true, true, true);
142143
if (canBeSeen) {
143144
// draw widget
144-
GlStateManager.colorMask(true, true, true, true);
145145
GlStateManager.color(1f, 1f, 1f, alpha);
146-
GlStateManager.enableBlend();
147146
WidgetThemeEntry<?> widgetTheme = parent.getWidgetTheme(context.getTheme());
148147
if (drawBackground) parent.drawBackground(context, widgetTheme);
149148
parent.draw(context, widgetTheme);
@@ -154,7 +153,6 @@ public static void drawTree(IWidget parent, ModularGuiContext context, boolean i
154153
if (canBeSeen) {
155154
// draw viewport without children transformation
156155
GlStateManager.color(1f, 1f, 1f, alpha);
157-
GlStateManager.enableBlend();
158156
viewport.preDraw(context, false);
159157
GlStateManager.popMatrix();
160158
// apply children transformation of the viewport
@@ -191,7 +189,6 @@ public static void drawTree(IWidget parent, ModularGuiContext context, boolean i
191189
if (canBeSeen) {
192190
// apply opengl transformations again and draw
193191
GlStateManager.color(1f, 1f, 1f, alpha);
194-
GlStateManager.enableBlend();
195192
GlStateManager.pushMatrix();
196193
context.applyToOpenGl();
197194
viewport.postDraw(context, true);
@@ -234,7 +231,6 @@ public static void drawBackground(IWidget parent, ModularGuiContext context, boo
234231
// draw widget
235232
GlStateManager.colorMask(true, true, true, true);
236233
GlStateManager.color(1f, 1f, 1f, alpha);
237-
GlStateManager.enableBlend();
238234
WidgetThemeEntry<?> widgetTheme = parent.getWidgetTheme(context.getTheme());
239235
parent.drawBackground(context, widgetTheme);
240236

0 commit comments

Comments
 (0)