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.cpp16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/camera_system.cpp b/src/camera_system.cpp index 0ef3c36..ac89a78 100644 --- a/src/camera_system.cpp +++ b/src/camera_system.cpp
@@ -41,6 +41,22 @@ void CameraSystem::panToSprite(int targetId, int length) {
41 } 41 }
42} 42}
43 43
44void CameraSystem::panToWarpPoint(std::string_view warpPoint, int length) {
45 locked_ = true;
46
47 vec2i center = game_.getMap().getWarpPoint(warpPoint);
48
49 if (length > 0) {
50 panning_ = true;
51 panStart_ = pos_;
52 panEnd_ = calculatePosWithCenter(center);
53 panLength_ = length;
54 panThus_ = 0.0;
55 } else {
56 pos_ = calculatePosWithCenter(center);
57 }
58}
59
44void CameraSystem::destroySprite(int spriteId) { 60void CameraSystem::destroySprite(int spriteId) {
45 if (followingSprite_ == spriteId) { 61 if (followingSprite_ == spriteId) {
46 followingSprite_ = -1; 62 followingSprite_ = -1;