diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/renderer.cpp | 26 | ||||
-rw-r--r-- | src/renderer.h | 2 |
2 files changed, 2 insertions, 26 deletions
diff --git a/src/renderer.cpp b/src/renderer.cpp index 139b493..87e6553 100644 --- a/src/renderer.cpp +++ b/src/renderer.cpp | |||
@@ -299,8 +299,8 @@ void Renderer::renderGame( | |||
299 | if (!game.map.at(x,y).litTiles.count({sx, sy})) | 299 | if (!game.map.at(x,y).litTiles.count({sx, sy})) |
300 | { | 300 | { |
301 | SDL_Rect rect { | 301 | SDL_Rect rect { |
302 | (sx - leftmost) * TILE_WIDTH + xInterp, | 302 | (sx - leftmost) * TILE_WIDTH, |
303 | (sy - topmost) * TILE_HEIGHT + yInterp, | 303 | (sy - topmost) * TILE_HEIGHT, |
304 | TILE_WIDTH, | 304 | TILE_WIDTH, |
305 | TILE_HEIGHT}; | 305 | TILE_HEIGHT}; |
306 | 306 | ||
@@ -390,28 +390,6 @@ void Renderer::renderTitle(int num, double fade) { | |||
390 | SDL_RenderPresent(ren_.get()); | 390 | SDL_RenderPresent(ren_.get()); |
391 | } | 391 | } |
392 | 392 | ||
393 | std::tuple<int, int, int, int> Renderer::calculateZoomRect(const Game& game) | ||
394 | { | ||
395 | int w = game.curZoom * TILE_WIDTH * ZOOM_X_FACTOR; | ||
396 | int h = game.curZoom * TILE_HEIGHT * ZOOM_Y_FACTOR; | ||
397 | int x = (game.map.getTrueX(game.player_x) * TILE_WIDTH) - (w / 2); | ||
398 | int y = (game.map.getTrueY(game.player_y) * TILE_HEIGHT) - (h / 2); | ||
399 | |||
400 | /*if (game.zooming) | ||
401 | { | ||
402 | double interp = | ||
403 | static_cast<double>(game.zoomProgress) / | ||
404 | static_cast<double>(game.zoomLength); | ||
405 | |||
406 | x = (x - game.lastZoomLeft) * interp + game.lastZoomLeft; | ||
407 | y = (y - game.lastZoomTop) * interp + game.lastZoomTop; | ||
408 | w = (w - game.lastZoomWidth) * interp + game.lastZoomWidth; | ||
409 | h = (h - game.lastZoomHeight) * interp + game.lastZoomHeight; | ||
410 | }*/ | ||
411 | |||
412 | return {x, y, w, h}; | ||
413 | } | ||
414 | |||
415 | void Renderer::loadTextureFromFile(std::string_view path, texture_ptr& texture) { | 393 | void Renderer::loadTextureFromFile(std::string_view path, texture_ptr& texture) { |
416 | surface_ptr pfs(IMG_Load(path.data())); | 394 | surface_ptr pfs(IMG_Load(path.data())); |
417 | if (!pfs) | 395 | if (!pfs) |
diff --git a/src/renderer.h b/src/renderer.h index 4d5484c..1364550 100644 --- a/src/renderer.h +++ b/src/renderer.h | |||
@@ -122,8 +122,6 @@ public: | |||
122 | 122 | ||
123 | void renderTitle(int num, double fade); | 123 | void renderTitle(int num, double fade); |
124 | 124 | ||
125 | static std::tuple<int, int, int, int> calculateZoomRect(const Game& game); | ||
126 | |||
127 | private: | 125 | private: |
128 | 126 | ||
129 | void loadTextureFromFile(std::string_view path, texture_ptr& texture); | 127 | void loadTextureFromFile(std::string_view path, texture_ptr& texture); |