diff options
| author | Star Rauchenberger <fefferburbia@gmail.com> | 2022-03-19 10:09:14 -0400 |
|---|---|---|
| committer | Star Rauchenberger <fefferburbia@gmail.com> | 2022-03-19 10:09:14 -0400 |
| commit | 6cfe247b362106543bbb1a835dde9e7da9128fee (patch) | |
| tree | 76a24a4b241df6f6dea9ae6774c80d944062775f /src/renderer.cpp | |
| parent | 0a39ccd0b0c5b855fa7b5dea2082ced774923a62 (diff) | |
| download | ether-6cfe247b362106543bbb1a835dde9e7da9128fee.tar.gz ether-6cfe247b362106543bbb1a835dde9e7da9128fee.tar.bz2 ether-6cfe247b362106543bbb1a835dde9e7da9128fee.zip | |
fixed jitter while moving and zooming
Diffstat (limited to 'src/renderer.cpp')
| -rw-r--r-- | src/renderer.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
| diff --git a/src/renderer.cpp b/src/renderer.cpp index 94be197..b90372e 100644 --- a/src/renderer.cpp +++ b/src/renderer.cpp | |||
| @@ -370,19 +370,19 @@ void Renderer::renderGame( | |||
| 370 | 370 | ||
| 371 | if (game.moving) { | 371 | if (game.moving) { |
| 372 | if (game.player_x > game.player_oldx) { | 372 | if (game.player_x > game.player_oldx) { |
| 373 | oldRect.x += game.moveProgress.getProgress(0, TILE_WIDTH); | ||
| 374 | zoomRect.x += game.moveProgress.getProgress(0, TILE_WIDTH); | ||
| 375 | } else if (game.player_x < game.player_oldx) { | ||
| 376 | oldRect.x -= game.moveProgress.getProgress(TILE_WIDTH, 0); | 373 | oldRect.x -= game.moveProgress.getProgress(TILE_WIDTH, 0); |
| 377 | zoomRect.x -= game.moveProgress.getProgress(TILE_WIDTH, 0); | 374 | zoomRect.x -= game.moveProgress.getProgress(TILE_WIDTH, 0); |
| 375 | } else if (game.player_x < game.player_oldx) { | ||
| 376 | oldRect.x += game.moveProgress.getProgress(TILE_WIDTH, 0); | ||
| 377 | zoomRect.x += game.moveProgress.getProgress(TILE_WIDTH, 0); | ||
| 378 | } | 378 | } |
| 379 | 379 | ||
| 380 | if (game.player_y > game.player_oldy) { | 380 | if (game.player_y > game.player_oldy) { |
| 381 | oldRect.y += game.moveProgress.getProgress(0, TILE_HEIGHT); | ||
| 382 | zoomRect.y += game.moveProgress.getProgress(0, TILE_HEIGHT); | ||
| 383 | } else if (game.player_y < game.player_oldy) { | ||
| 384 | oldRect.y -= game.moveProgress.getProgress(TILE_HEIGHT, 0); | 381 | oldRect.y -= game.moveProgress.getProgress(TILE_HEIGHT, 0); |
| 385 | zoomRect.y -= game.moveProgress.getProgress(TILE_HEIGHT, 0); | 382 | zoomRect.y -= game.moveProgress.getProgress(TILE_HEIGHT, 0); |
| 383 | } else if (game.player_y < game.player_oldy) { | ||
| 384 | oldRect.y += game.moveProgress.getProgress(TILE_HEIGHT, 0); | ||
| 385 | zoomRect.y += game.moveProgress.getProgress(TILE_HEIGHT, 0); | ||
| 386 | } | 386 | } |
| 387 | } | 387 | } |
| 388 | 388 | ||
