Implemented render Prediction
This commit is contained in:
@@ -67,7 +67,7 @@ public class DarkRP2D extends Game {
|
||||
@Override
|
||||
// GameLoop
|
||||
public void render () {
|
||||
accumulator += Gdx.graphics.getDeltaTime(); //Seconds to milliseconds
|
||||
accumulator += Gdx.graphics.getRawDeltaTime(); //Seconds to milliseconds
|
||||
|
||||
//Process Input
|
||||
Command currentCommand = CommandStream.pollCommand();
|
||||
@@ -84,7 +84,7 @@ public class DarkRP2D extends Game {
|
||||
skippedFrames++;
|
||||
}
|
||||
|
||||
trueRender();
|
||||
trueRender(accumulator / MS_PER_UPDATE);
|
||||
}
|
||||
|
||||
public void update(float deltaTime) {
|
||||
@@ -92,7 +92,7 @@ public class DarkRP2D extends Game {
|
||||
engine.update(deltaTime);
|
||||
}
|
||||
|
||||
public void trueRender() {
|
||||
public void trueRender(float delta) {
|
||||
Gdx.gl.glClearColor(0.f, 0.f, 0.f, 1.f);
|
||||
Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT);
|
||||
|
||||
@@ -108,7 +108,7 @@ public class DarkRP2D extends Game {
|
||||
b2dbr.render(world, debugMatrix);
|
||||
|
||||
//TODO: will be later moved to Gamescreen
|
||||
engine.getSystem(RenderSystem.class).render(batch);
|
||||
engine.getSystem(RenderSystem.class).render(delta, batch);
|
||||
|
||||
//some testdrawing
|
||||
batch.begin();
|
||||
|
||||
Reference in New Issue
Block a user