diff options
author | Star Rauchenberger <fefferburbia@gmail.com> | 2022-03-15 09:54:34 -0400 |
---|---|---|
committer | Star Rauchenberger <fefferburbia@gmail.com> | 2022-03-15 09:54:34 -0400 |
commit | 5ab72bf802e7a79d6eacded4e985740324c4faa7 (patch) | |
tree | 69eebbde57275632cc2b7b08f5bfd70506d5e25f /src/game.cpp | |
parent | 83ac4c41bc447a3372769f2b3ef6e3119d2717a2 (diff) | |
download | ether-5ab72bf802e7a79d6eacded4e985740324c4faa7.tar.gz ether-5ab72bf802e7a79d6eacded4e985740324c4faa7.tar.bz2 ether-5ab72bf802e7a79d6eacded4e985740324c4faa7.zip |
started adding zooming anim, looks weird esp when moving
Diffstat (limited to 'src/game.cpp')
-rw-r--r-- | src/game.cpp | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/src/game.cpp b/src/game.cpp index beabc55..fc57acc 100644 --- a/src/game.cpp +++ b/src/game.cpp | |||
@@ -523,8 +523,10 @@ void Game::setZoom(size_t zoom) | |||
523 | return; | 523 | return; |
524 | } | 524 | } |
525 | 525 | ||
526 | zoomProgress = 0; | 526 | /*zoomProgress = 0; |
527 | zoomLength = std::abs(static_cast<long>(zoom - curZoom)) * TILE_WIDTH; | 527 | zoomLength = std::abs(static_cast<long>(zoom - curZoom)) * TILE_WIDTH;*/ |
528 | zoomProgress.start(62 * std::abs(static_cast<long>(zoom - curZoom)) * TILE_WIDTH); | ||
529 | oldZoom = curZoom; | ||
528 | curZoom = zoom; | 530 | curZoom = zoom; |
529 | zooming = true; | 531 | zooming = true; |
530 | loadMap(); | 532 | loadMap(); |
@@ -824,7 +826,7 @@ void Game::update(size_t frameTime) { | |||
824 | recalculateRender(); | 826 | recalculateRender(); |
825 | } | 827 | } |
826 | 828 | ||
827 | zoomTimer.accumulate(frameTime); | 829 | /*zoomTimer.accumulate(frameTime); |
828 | while (zoomTimer.step()) | 830 | while (zoomTimer.step()) |
829 | { | 831 | { |
830 | if (zooming) | 832 | if (zooming) |
@@ -836,6 +838,12 @@ void Game::update(size_t frameTime) { | |||
836 | zooming = false; | 838 | zooming = false; |
837 | } | 839 | } |
838 | } | 840 | } |
841 | }*/ | ||
842 | if (zooming) { | ||
843 | zoomProgress.tick(frameTime); | ||
844 | if (zoomProgress.isComplete()) { | ||
845 | zooming = false; | ||
846 | } | ||
839 | } | 847 | } |
840 | 848 | ||
841 | playerAnim.update(frameTime); | 849 | playerAnim.update(frameTime); |