Move the camera object out of the game map object

TODO: this commit impacts the performance.
FPS decreased from ~60 to ~24, it should be immediately fixed.
This commit is contained in:
2021-02-15 13:12:40 +01:00
parent 15549930e0
commit 499e232e17
12 changed files with 43 additions and 30 deletions

View File

@@ -9,6 +9,7 @@ import com.bartlomiejpluta.base.core.profiling.fps.FPSMonitor;
import com.bartlomiejpluta.base.core.profiling.time.TimeProfilerService;
import com.bartlomiejpluta.base.core.ui.Window;
import com.bartlomiejpluta.base.core.util.mesh.MeshManager;
import com.bartlomiejpluta.base.core.world.camera.Camera;
import com.bartlomiejpluta.base.core.world.map.GameMap;
import com.bartlomiejpluta.base.core.world.tileset.manager.TileSetManager;
import com.bartlomiejpluta.base.game.world.entity.manager.EntityManager;
@@ -30,6 +31,8 @@ public class DefaultGameLogic implements GameLogic {
private final TimeProfilerService profiler;
private final FPSMonitor fpsMonitor;
private final Camera camera = new Camera();
private GameMap map;
@Override
@@ -52,7 +55,7 @@ public class DefaultGameLogic implements GameLogic {
@Override
public void render(Window window) {
renderer.render(window, map);
renderer.render(window, camera, map);
}
@Override