more easier access to common variables
This commit is contained in:
@@ -69,9 +69,6 @@ public class DisplayContainer implements ErrorDumpable, SkinChangedListener {
|
||||
|
||||
private Graphics graphics;
|
||||
|
||||
public int mouseX;
|
||||
public int mouseY;
|
||||
|
||||
private int targetUpdatesPerSecond;
|
||||
public int targetUpdateInterval;
|
||||
private int targetRendersPerSecond;
|
||||
@@ -79,7 +76,6 @@ public class DisplayContainer implements ErrorDumpable, SkinChangedListener {
|
||||
public int targetBackgroundRenderInterval;
|
||||
|
||||
private boolean rendering;
|
||||
public int renderDelta;
|
||||
public int delta;
|
||||
|
||||
public boolean exitRequested;
|
||||
@@ -230,7 +226,7 @@ public class DisplayContainer implements ErrorDumpable, SkinChangedListener {
|
||||
bubNotifs.render(graphics);
|
||||
barNotifs.render(graphics);
|
||||
|
||||
cursor.updateAngle(renderDelta);
|
||||
cursor.updateAngle();
|
||||
if (drawCursor) {
|
||||
cursor.draw(Mouse.isButtonDown(Input.MOUSE_LEFT_BUTTON) ||
|
||||
Mouse.isButtonDown(Input.MOUSE_RIGHT_BUTTON));
|
||||
|
||||
@@ -76,6 +76,8 @@ public class InstanceContainer {
|
||||
public static GamePauseMenu pauseState;
|
||||
|
||||
public static int width, width2, height, height2;
|
||||
public static int mouseX, mouseY;
|
||||
public static int renderDelta;
|
||||
|
||||
public static void kickstart() {
|
||||
updater = new Updater();
|
||||
|
||||
@@ -130,7 +130,7 @@ public abstract class ComplexOpsuState extends BaseOpsuState {
|
||||
public void preRenderUpdate() {
|
||||
super.preRenderUpdate();
|
||||
for (Component component : components) {
|
||||
component.updateHover(displayContainer.mouseX, displayContainer.mouseY);
|
||||
component.updateHover(mouseX, mouseY);
|
||||
component.preRenderUpdate();
|
||||
}
|
||||
for (OverlayOpsuState overlay : overlays) {
|
||||
|
||||
@@ -57,7 +57,7 @@ public class BarNotificationState implements ResolutionChangedListener {
|
||||
if (timeShown >= TOTAL_TIME) {
|
||||
return;
|
||||
}
|
||||
timeShown += displayContainer.renderDelta;
|
||||
timeShown += renderDelta;
|
||||
processAnimations();
|
||||
g.setColor(bgcol);
|
||||
g.fillRect(0, height2 - barHalfHeight, width, barHalfHeight * 2);
|
||||
|
||||
@@ -53,7 +53,7 @@ public class BubNotifState implements MouseListener, ResolutionChangedListener {
|
||||
if (!iter.hasNext()) {
|
||||
return;
|
||||
}
|
||||
addAnimationTime += displayContainer.renderDelta;
|
||||
addAnimationTime += renderDelta;
|
||||
if (addAnimationTime > IN_TIME) {
|
||||
finishAddAnimation();
|
||||
}
|
||||
@@ -63,7 +63,7 @@ public class BubNotifState implements MouseListener, ResolutionChangedListener {
|
||||
if (animateUp && addAnimationTime < IN_TIME) {
|
||||
next.y = next.baseY - (int) (addAnimationHeight * AnimationEquation.OUT_QUINT.calc((float) addAnimationTime / IN_TIME));
|
||||
}
|
||||
if (next.render(g, displayContainer.mouseX, displayContainer.mouseY, displayContainer.renderDelta)) {
|
||||
if (next.render(g, mouseX, mouseY, renderDelta)) {
|
||||
iter.remove();
|
||||
}
|
||||
animateUp = true;
|
||||
|
||||
@@ -49,7 +49,7 @@ public class FpsRenderState implements ResolutionChangedListener {
|
||||
}
|
||||
|
||||
public void render(Graphics g) {
|
||||
fpsMeter.update(displayContainer.renderDelta);
|
||||
fpsMeter.update(renderDelta);
|
||||
if (!OPTION_SHOW_FPS.state) {
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user