Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DRAFT: Overlay performance improvements #333

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ private enum RenderMode {
SOFTWARE
}

private static final RenderMode mode = RenderMode.SOFTWARE;
private static final RenderMode mode = RenderMode.D3D_HWSCALE;
private static final int GUI_WARN_MS = 200;

private CommonGuiSetup() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,14 @@ public ExampleOverlayWithLotsOfButtons(PersistenceProvider persistence, OverlayC
panel.add(reset);
JButton nothing = new JButton("Nothing");
panel.add(nothing);
panel.setBackground(new Color(200, 100, 0, 255));
panel.setBackground(new Color(200, 100, 0, 128));
getPanel().add(panel);
JPanel topPanel = new JPanel();
topPanel.setBackground(new Color(0, 255, 0, 100));
getFrame().setGlassPane(topPanel);
topPanel.setOpaque(false);
topPanel.setVisible(true);
new RefreshLoop<>("ExampleOverlayRefresh", this, item -> item.getPanel().repaint(), item -> 40L).start();
}

private void dummyMethodForBreakpoint() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,15 @@ public static void main(String[] args) throws InterruptedException {
pico.addComponent(OverlayMain.class);
pico.addComponent(OverlayConfig.class);
OverlayConfig oc = pico.getComponent(OverlayConfig.class);
oc.getBufferSetting().set(3);
PersistenceProvider pers = pico.getComponent(PersistenceProvider.class);
{
XivOverlay overlay = new ExampleOverlayWithLotsOfButtons(new InMemoryMapPersistenceProvider(), oc);
overlay.finishInit();
overlay.setVisible(true);
overlay.setEditMode(true);
overlay.getEnabled().set(true);
double scaleFactor = 1.8;
double scaleFactor = 3.9;
overlay.setScale(scaleFactor);
}
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ public XivOverlay(String title, String settingKeyBase, OverlayConfig oc, Persist
this.oc = oc;
xSetting = new LongSetting(persistence, String.format("xiv-overlay.window-pos.%s.x", settingKeyBase), nextDefaultPos.get());
ySetting = new LongSetting(persistence, String.format("xiv-overlay.window-pos.%s.y", settingKeyBase), nextDefaultPos.getAndAdd(80));
int numBuffers = new IntSetting(persistence, bufferNumSettingKey, 0).get();
int numBuffers = oc.getBufferSetting().get();
scaleFactor = new DoubleSetting(persistence, String.format("xiv-overlay.window-pos.%s.scale", settingKeyBase), 1.0d, 0.8d, 8);
if (Platform.isWindows()) {
opacity = new DoubleSetting(persistence, String.format("xiv-overlay.window-pos.%s.opacity", settingKeyBase), 1.0d, 0.0, 1.0);
Expand Down