HD Resize redraw

This commit is contained in:
downthecrop 2024-10-25 21:22:16 -07:00
parent b3c2adc51f
commit 4f8bf464c5
3 changed files with 14 additions and 19 deletions

View file

@ -182,6 +182,7 @@ public abstract class GameShell extends Applet implements Runnable, FocusListene
@OriginalMember(owner = "client!qh", name = "a", descriptor = "(Z)V") @OriginalMember(owner = "client!qh", name = "a", descriptor = "(Z)V")
public static void method3662() { public static void method3662() {
System.out.println("Moving...");
@Pc(8) Container local8; @Pc(8) Container local8;
if (fullScreenFrame != null) { if (fullScreenFrame != null) {
local8 = fullScreenFrame; local8 = fullScreenFrame;
@ -514,9 +515,10 @@ public abstract class GameShell extends Applet implements Runnable, FocusListene
canvasScale = getCurrentDevice().getDefaultConfiguration().getDefaultTransform().getScaleX(); canvasScale = getCurrentDevice().getDefaultConfiguration().getDefaultTransform().getScaleX();
if (frame != null && fullScreenFrame == null) { if (frame != null && fullScreenFrame == null) {
@Pc(84) Insets insets = frame.getInsets(); @Pc(84) Insets insets = frame.getInsets();
canvas.setLocation(insets.left + leftMargin, topMargin + insets.top); // TODO: Add a flag to ignore this.
//canvas.setLocation(insets.left + leftMargin, topMargin + insets.top);
} else { } else {
canvas.setLocation(leftMargin, topMargin); //canvas.setLocation(leftMargin, topMargin);
} }
} }
this.mainRedraw(); this.mainRedraw();

View file

@ -203,7 +203,7 @@ public final class GlRenderer {
try { try {
pixelData = readPixels(); pixelData = readPixels();
drawable.swapBuffers(); drawable.swapBuffers();
} catch (@Pc(3) Exception local3) {*, } catch (@Pc(3) Exception local3) {
} }
} }

View file

@ -44,8 +44,6 @@ import java.awt.Font
import java.awt.event.* import java.awt.event.*
import java.awt.image.BufferedImage import java.awt.image.BufferedImage
import java.awt.image.VolatileImage import java.awt.image.VolatileImage
import java.util.*
import java.util.Timer
import javax.swing.* import javax.swing.*
@ -449,20 +447,6 @@ class plugin : Plugin() {
frame.layout = BorderLayout() frame.layout = BorderLayout()
frame.add(rightPanelWrapper, BorderLayout.EAST) frame.add(rightPanelWrapper, BorderLayout.EAST)
// Create a timer to delay execution by 2 seconds
Timer().schedule(object : TimerTask() {
override fun run() {
println("mode is: " + GetWindowMode().toString())
if (GetWindowMode() != WindowMode.FIXED) {
// Perform any actions needed for non-fixed mode
} else {
//if (canvas.isShowing) {
// frame.remove(canvas)
// }
}
}
}, 2000) // 2000 milliseconds = 2 seconds
frame.revalidate() frame.revalidate()
frame.repaint() frame.repaint()
pluginsReloaded = true pluginsReloaded = true
@ -540,6 +524,15 @@ class plugin : Plugin() {
override fun LateDraw(timeDelta: Long){ override fun LateDraw(timeDelta: Long){
// Clear original canvas for scaled // Clear original canvas for scaled
if(!initialized) return if(!initialized) return
SwingUtilities.invokeLater {
if (GetWindowMode() == WindowMode.FIXED) {
if (canvas.isShowing) {
canvas.setLocation(-1000,-1000)
}
} else {
}
}
altCanvas?.updateGameImage() altCanvas?.updateGameImage()
} }