Update #14 - Fixed stupid mistake in the u13 FPS boost patch

This commit is contained in:
LAX1DUDE 2023-01-18 17:37:05 -08:00
parent 48ba6f6176
commit 1f8473deeb
5 changed files with 31 additions and 7 deletions

View File

@ -1 +1 @@
u13 u14

View File

@ -77,7 +77,12 @@
~ for (Score score1 : (List<Score>) arraylist1) { ~ for (Score score1 : (List<Score>) arraylist1) {
> INSERT 64 : 65 @ 64 > INSERT 40 : 42 @ 40
+ GlStateManager.enableBlend();
+ GlStateManager.tryBlendFuncSeparate(770, 771, 1, 0);
> INSERT 24 : 25 @ 24
+ this.mc.getTextureManager().bindTexture(icons); + this.mc.getTextureManager().bindTexture(icons);

View File

@ -138,7 +138,7 @@
> DELETE 39 @ 39 : 52 > DELETE 39 @ 39 : 52
> CHANGE 4 : 41 @ 4 : 5 > CHANGE 4 : 43 @ 4 : 5
~ long framebufferAge = this.overlayFramebuffer.getAge(); ~ long framebufferAge = this.overlayFramebuffer.getAge();
~ if (framebufferAge == -1l || framebufferAge > (Minecraft.getDebugFPS() < 25 ? 125l : 75l)) { ~ if (framebufferAge == -1l || framebufferAge > (Minecraft.getDebugFPS() < 25 ? 125l : 75l)) {
@ -146,7 +146,9 @@
~ GlStateManager.colorMask(true, true, true, true); ~ GlStateManager.colorMask(true, true, true, true);
~ GlStateManager.clearColor(0.0f, 0.0f, 0.0f, 0.0f); ~ GlStateManager.clearColor(0.0f, 0.0f, 0.0f, 0.0f);
~ GlStateManager.clear(16640); ~ GlStateManager.clear(16640);
~ GlStateManager.enableOverlayFramebufferBlending();
~ this.mc.ingameGUI.renderGameOverlay(parFloat1); ~ this.mc.ingameGUI.renderGameOverlay(parFloat1);
~ GlStateManager.disableOverlayFramebufferBlending();
~ this.overlayFramebuffer.endRender(); ~ this.overlayFramebuffer.endRender();
~ } ~ }
~ this.setupOverlayRendering(); ~ this.setupOverlayRendering();
@ -158,7 +160,7 @@
~ GlStateManager.bindTexture(this.overlayFramebuffer.getTexture()); ~ GlStateManager.bindTexture(this.overlayFramebuffer.getTexture());
~ GlStateManager.color(1.0f, 1.0f, 1.0f, 1.0f); ~ GlStateManager.color(1.0f, 1.0f, 1.0f, 1.0f);
~ GlStateManager.enableBlend(); ~ GlStateManager.enableBlend();
~ GlStateManager.blendFunc(770, 771); ~ GlStateManager.blendFunc(1, 771);
~ GlStateManager.disableAlpha(); ~ GlStateManager.disableAlpha();
~ GlStateManager.disableDepth(); ~ GlStateManager.disableDepth();
~ GlStateManager.depthMask(false); ~ GlStateManager.depthMask(false);

View File

@ -8,7 +8,7 @@ public class EaglercraftVersion {
/// Customize these to fit your fork: /// Customize these to fit your fork:
public static final String projectForkName = "EaglercraftX"; public static final String projectForkName = "EaglercraftX";
public static final String projectForkVersion = "u13"; public static final String projectForkVersion = "u14";
public static final String projectForkVendor = "lax1dude"; public static final String projectForkVendor = "lax1dude";
public static final String projectForkURL = "https://gitlab.com/lax1dude/eaglercraftx-1.8"; public static final String projectForkURL = "https://gitlab.com/lax1dude/eaglercraftx-1.8";
@ -23,7 +23,7 @@ public class EaglercraftVersion {
public static final String projectOriginName = "EaglercraftX"; public static final String projectOriginName = "EaglercraftX";
public static final String projectOriginAuthor = "lax1dude"; public static final String projectOriginAuthor = "lax1dude";
public static final String projectOriginRevision = "1.8"; public static final String projectOriginRevision = "1.8";
public static final String projectOriginVersion = "u13"; public static final String projectOriginVersion = "u14";
public static final String projectOriginURL = "https://gitlab.com/lax1dude/eaglercraftx-1.8"; public static final String projectOriginURL = "https://gitlab.com/lax1dude/eaglercraftx-1.8";

View File

@ -59,7 +59,8 @@ public class GlStateManager {
static int stateBlendEquation = -1; static int stateBlendEquation = -1;
static int stateBlendSRC = -1; static int stateBlendSRC = -1;
static int stateBlendDST = -1; static int stateBlendDST = -1;
static boolean stateEnableOverlayFramebufferBlending = false;
static boolean stateAlphaTest = false; static boolean stateAlphaTest = false;
static float stateAlphaTestRef = 0.1f; static float stateAlphaTestRef = 0.1f;
@ -336,6 +337,10 @@ public class GlStateManager {
} }
public static final void blendFunc(int srcFactor, int dstFactor) { public static final void blendFunc(int srcFactor, int dstFactor) {
if(stateEnableOverlayFramebufferBlending) {
tryBlendFuncSeparate(srcFactor, dstFactor, 0, 1);
return;
}
int srcBits = (srcFactor | (srcFactor << 16)); int srcBits = (srcFactor | (srcFactor << 16));
int dstBits = (dstFactor | (dstFactor << 16)); int dstBits = (dstFactor | (dstFactor << 16));
if(srcBits != stateBlendSRC || dstBits != stateBlendDST) { if(srcBits != stateBlendSRC || dstBits != stateBlendDST) {
@ -346,6 +351,10 @@ public class GlStateManager {
} }
public static final void tryBlendFuncSeparate(int srcFactor, int dstFactor, int srcFactorAlpha, int dstFactorAlpha) { public static final void tryBlendFuncSeparate(int srcFactor, int dstFactor, int srcFactorAlpha, int dstFactorAlpha) {
if(stateEnableOverlayFramebufferBlending) { // game overlay framebuffer in EntityRenderer.java
srcFactorAlpha = GL_ONE;
dstFactorAlpha = GL_ONE_MINUS_SRC_ALPHA;
}
int srcBits = (srcFactor | (srcFactorAlpha << 16)); int srcBits = (srcFactor | (srcFactorAlpha << 16));
int dstBits = (dstFactor | (dstFactorAlpha << 16)); int dstBits = (dstFactor | (dstFactorAlpha << 16));
if(srcBits != stateBlendSRC || dstBits != stateBlendDST) { if(srcBits != stateBlendSRC || dstBits != stateBlendDST) {
@ -355,6 +364,14 @@ public class GlStateManager {
} }
} }
public static final void enableOverlayFramebufferBlending() {
stateEnableOverlayFramebufferBlending = true;
}
public static final void disableOverlayFramebufferBlending() {
stateEnableOverlayFramebufferBlending = false;
}
public static final void setShaderBlendSrc(float r, float g, float b, float a) { public static final void setShaderBlendSrc(float r, float g, float b, float a) {
stateShaderBlendSrcColorR = r; stateShaderBlendSrcColorR = r;
stateShaderBlendSrcColorG = g; stateShaderBlendSrcColorG = g;