summary refs log tree commit diff stats
path: root/src/camera_system.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/camera_system.cpp')
-rw-r--r--src/camera_system.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/camera_system.cpp b/src/camera_system.cpp index 4709d01..991d096 100644 --- a/src/camera_system.cpp +++ b/src/camera_system.cpp
@@ -4,7 +4,7 @@
4#include "map.h" 4#include "map.h"
5 5
6void CameraSystem::tick(double dt) { 6void CameraSystem::tick(double dt) {
7 if (!locked_) { 7 if (!locked_ && followingSprite_ != -1) {
8 const Sprite& follow = game_.getSprite(followingSprite_); 8 const Sprite& follow = game_.getSprite(followingSprite_);
9 const Map& map = game_.getMap(); 9 const Map& map = game_.getMap();
10 vec2i mapBounds = map.getMapSize() * map.getTileSize(); 10 vec2i mapBounds = map.getMapSize() * map.getTileSize();
@@ -25,3 +25,7 @@ void CameraSystem::tick(double dt) {
25 } 25 }
26 } 26 }
27} 27}
28
29void CameraSystem::clearSpriteCache() {
30 followingSprite_ = -1;
31}