Skip to content

Commit

Permalink
Prevent mixin conflict
Browse files Browse the repository at this point in the history
  • Loading branch information
xCollateral committed Sep 26, 2024
1 parent a036e46 commit 327d211
Showing 1 changed file with 7 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Overwrite;
import org.spongepowered.asm.mixin.Shadow;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;

@Mixin(RenderTarget.class)
public abstract class RenderTargetMixin implements ExtendedRenderTarget {
Expand Down Expand Up @@ -121,11 +124,8 @@ public void unbindWrite() {
}
}

/**
* @author
*/
@Overwrite
private void _blitToScreen(int width, int height, boolean disableBlend) {
@Inject(method = "_blitToScreen", at = @At("HEAD"), cancellable = true)
private void _blitToScreen(int width, int height, boolean disableBlend, CallbackInfo ci) {
if (needClear) {
// If true it means target has not been used, thus we can skip blit
return;
Expand All @@ -135,6 +135,8 @@ private void _blitToScreen(int width, int height, boolean disableBlend) {
VTextureSelector.bindTexture(0, framebuffer.getColorAttachment());

DrawUtil.blitToScreen();

ci.cancel();
}

@Override
Expand Down

0 comments on commit 327d211

Please sign in to comment.