From 6cfe247b362106543bbb1a835dde9e7da9128fee Mon Sep 17 00:00:00 2001 From: Star Rauchenberger Date: Sat, 19 Mar 2022 10:09:14 -0400 Subject: fixed jitter while moving and zooming --- src/renderer.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'src/renderer.cpp') 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( if (game.moving) { if (game.player_x > game.player_oldx) { - oldRect.x += game.moveProgress.getProgress(0, TILE_WIDTH); - zoomRect.x += game.moveProgress.getProgress(0, TILE_WIDTH); - } else if (game.player_x < game.player_oldx) { oldRect.x -= game.moveProgress.getProgress(TILE_WIDTH, 0); zoomRect.x -= game.moveProgress.getProgress(TILE_WIDTH, 0); + } else if (game.player_x < game.player_oldx) { + oldRect.x += game.moveProgress.getProgress(TILE_WIDTH, 0); + zoomRect.x += game.moveProgress.getProgress(TILE_WIDTH, 0); } if (game.player_y > game.player_oldy) { - oldRect.y += game.moveProgress.getProgress(0, TILE_HEIGHT); - zoomRect.y += game.moveProgress.getProgress(0, TILE_HEIGHT); - } else if (game.player_y < game.player_oldy) { oldRect.y -= game.moveProgress.getProgress(TILE_HEIGHT, 0); zoomRect.y -= game.moveProgress.getProgress(TILE_HEIGHT, 0); + } else if (game.player_y < game.player_oldy) { + oldRect.y += game.moveProgress.getProgress(TILE_HEIGHT, 0); + zoomRect.y += game.moveProgress.getProgress(TILE_HEIGHT, 0); } } -- cgit 1.4.1