Skip to content

Commit

Permalink
I need to learn to try my code
Browse files Browse the repository at this point in the history
  • Loading branch information
IMS212 committed Nov 22, 2023
1 parent 04c2e0c commit 0d33d99
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 47 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -58,19 +58,19 @@ public abstract class MixinDebugScreenOverlay {

messages.add(3, "Direct Buffers: +" + iris$humanReadableByteCountBin(iris$directPool.getMemoryUsed()));

if (!Iris.isSodiumInstalled()) {
messages.add(3, "Native Memory: +" + iris$humanReadableByteCountBin(iris$getNativeMemoryUsage()));
}
//if (!Iris.isSodiumInstalled()) {
// messages.add(3, "Native Memory: +" + iris$humanReadableByteCountBin(iris$getNativeMemoryUsage()));
//}
}

@Inject(method = "getGameInformation", at = @At("RETURN"))
private void iris$appendShadowDebugText(CallbackInfoReturnable<List<String>> cir) {
List<String> messages = cir.getReturnValue();

if (!Iris.isSodiumInstalled() && Iris.getCurrentPack().isPresent()) {
messages.add(1, ChatFormatting.YELLOW + "[" + Iris.MODNAME + "] Sodium isn't installed; you will have poor performance.");
messages.add(2, ChatFormatting.YELLOW + "[" + Iris.MODNAME + "] Install Sodium if you want to run benchmarks or get higher FPS!");
}
//if (!Iris.isSodiumInstalled() && Iris.getCurrentPack().isPresent()) {
// messages.add(1, ChatFormatting.YELLOW + "[" + Iris.MODNAME + "] Sodium isn't installed; you will have poor performance.");
// messages.add(2, ChatFormatting.YELLOW + "[" + Iris.MODNAME + "] Install Sodium if you want to run benchmarks or get higher FPS!");
//}

Iris.getPipelineManager().getPipeline().ifPresent(pipeline -> pipeline.addDebugText(messages));
}
Expand Down
5 changes: 0 additions & 5 deletions src/main/java/net/coderbot/iris/mixin/MixinLevelRenderer.java
Original file line number Diff line number Diff line change
Expand Up @@ -69,11 +69,6 @@ public class MixinLevelRenderer {
private void iris$setupPipeline(PoseStack poseStack, float tickDelta, long startTime, boolean renderBlockOutline,
Camera camera, GameRenderer gameRenderer, LightTexture lightTexture,
Matrix4f projection, CallbackInfo callback) {
if (Iris.isSodiumInvalid()) {
throw new IllegalStateException("An invalid version of Sodium is installed, and the warning screen somehow" +
" didn't work. This is a bug! Please report it to the Iris developers.");
}

IrisTimeUniforms.updateTime();
CapturedRenderingState.INSTANCE.setGbufferModelView(poseStack.last().pose());
CapturedRenderingState.INSTANCE.setGbufferProjection(projection);
Expand Down
8 changes: 0 additions & 8 deletions src/main/java/net/coderbot/iris/mixin/MixinSystemReport.java
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,5 @@ private void fillSystemDetails(CallbackInfo ci) {
});
return sb.toString();
});

this.setDetail("NEC status", () -> {
if (Iris.hasNotEnoughCrashes()) {
return "Has NEC: INVALID";
} else {
return "No NEC detected";
}
});
}
}
27 changes: 0 additions & 27 deletions src/main/java/net/coderbot/iris/mixin/gui/MixinGui.java
Original file line number Diff line number Diff line change
Expand Up @@ -35,33 +35,6 @@ public class MixinGui {
}
}

// TODO: Move this to a more appropriate mixin
@Inject(method = "render", at = @At("RETURN"))
public void iris$displayBigSodiumWarning(PoseStack poseStack, float tickDelta, CallbackInfo ci) {
if (Iris.isSodiumInstalled()
|| Minecraft.getInstance().options.renderDebug
|| !Iris.getCurrentPack().isPresent()) {
return;
}

Font font = Minecraft.getInstance().font;

List<String> warningLines = new ArrayList<>();
warningLines.add("[" + Iris.MODNAME + "] Sodium isn't installed; you will have poor performance.");
warningLines.add("[" + Iris.MODNAME + "] Install Sodium if you want to run benchmarks or get higher FPS!");

for (int i = 0; i < warningLines.size(); ++i) {
String string = warningLines.get(i);

final int lineHeight = 9;
final int lineWidth = font.width(string);
final int y = 2 + lineHeight * i;

GuiComponent.fill(poseStack, 1, y - 1, 2 + lineWidth + 1, y + lineHeight - 1, 0x9050504E);
font.draw(poseStack, string, 2.0F, y, 0xFFFF55);
}
}

@Inject(method = "renderVignette", at = @At("HEAD"), cancellable = true)
private void iris$disableVignetteRendering(Entity entity, CallbackInfo ci) {
WorldRenderingPipeline pipeline = Iris.getPipelineManager().getPipelineNullable();
Expand Down

0 comments on commit 0d33d99

Please sign in to comment.