don't pass deltas as param

This commit is contained in:
yugecin
2017-01-17 18:45:17 +01:00
parent f0883ff1af
commit 580b4142f6
8 changed files with 27 additions and 25 deletions

View File

@@ -84,7 +84,7 @@ public class DisplayContainer implements ErrorDumpable, KeyListener, MouseListen
public int targetRenderInterval;
public int targetBackgroundRenderInterval;
public int realRenderInterval;
public int renderDelta;
public int delta;
public int timeSinceLastRender;
@@ -122,7 +122,7 @@ public class DisplayContainer implements ErrorDumpable, KeyListener, MouseListen
targetBackgroundRenderInterval = 41; // ~24 fps
lastFrame = getTime();
delta = 1;
realRenderInterval = 1;
renderDelta = 1;
}
public void init(Class<? extends OpsuState> startingState) {
@@ -144,7 +144,7 @@ public class DisplayContainer implements ErrorDumpable, KeyListener, MouseListen
input.poll(width, height);
mouseX = input.getMouseX();
mouseY = input.getMouseY();
state.update(delta);
state.update();
int maxRenderInterval;
if (Display.isVisible() && Display.isActive()) {
@@ -163,13 +163,14 @@ public class DisplayContainer implements ErrorDumpable, KeyListener, MouseListen
graphics.resetTransform();
*/
state.preRenderUpdate(timeSinceLastRender);
renderDelta = timeSinceLastRender;
state.preRenderUpdate();
state.render(graphics);
fpsState.render(graphics);
bubNotifState.render(graphics, timeSinceLastRender);
barNotifState.render(graphics, timeSinceLastRender);
bubNotifState.render(graphics);
barNotifState.render(graphics);
realRenderInterval = timeSinceLastRender;
timeSinceLastRender = 0;
Display.update(false);