Skip to content
This repository has been archived by the owner on May 12, 2024. It is now read-only.

Commit

Permalink
Fixed Anti Alias
Browse files Browse the repository at this point in the history
  • Loading branch information
Luna5ama committed Jul 29, 2023
1 parent 287a0d5 commit 484fde6
Showing 1 changed file with 2 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,6 @@

@Mixin(GlStateManager.class)
abstract class MixinGlStateManager<T extends Entity> {
@Shadow
public static void viewport(int x, int y, int width, int height) {
}

@Inject(method = "viewport", at = @At("HEAD"), cancellable = true)
private static void viewport$Inject$HEAD(int x, int y, int width, int height, CallbackInfo ci) {
float sampleLevel = AntiAlias.INSTANCE.getSampleLevel();
Expand All @@ -29,9 +25,9 @@ public static void viewport(int x, int y, int width, int height) {
if (GL11.glGetInteger(GL_FRAMEBUFFER_BINDING) == Minecraft.getMinecraft().getFramebuffer().framebufferObject) {
ci.cancel();
if (x == 0 && y == 0) {
viewport(x, y, framebuffer.framebufferWidth, framebuffer.framebufferHeight);
GL11.glViewport(x, y, framebuffer.framebufferWidth, framebuffer.framebufferHeight);
} else {
viewport(
GL11.glViewport(
(int) (x * sampleLevel),
(int) (y * sampleLevel),
(int) (width * sampleLevel),
Expand Down

0 comments on commit 484fde6

Please sign in to comment.