summaryrefslogtreecommitdiffstats
path: root/src/view
diff options
context:
space:
mode:
Diffstat (limited to 'src/view')
-rw-r--r--src/view/MapView.cpp6
-rw-r--r--src/view/MapView.hpp2
2 files changed, 3 insertions, 5 deletions
diff --git a/src/view/MapView.cpp b/src/view/MapView.cpp
index 580014e..5e55290 100644
--- a/src/view/MapView.cpp
+++ b/src/view/MapView.cpp
@@ -79,7 +79,7 @@ MapView::~MapView() {
SDL_DestroyTexture(entity.second);
}
-void MapView::render(float centerX, float centerY) {
+void MapView::render(float centerX, float centerY, uint64_t time) {
SDL_RenderClear(window->getRenderer());
std::pair<int, int> viewport = window->getViewport();
@@ -120,7 +120,7 @@ void MapView::render(float centerX, float centerY) {
}
for (const std::shared_ptr<Model::Entity> &entity : map->getEntities()) {
- Model::Position pos = entity->getPosition();
+ Model::Position pos = entity->getPosition(time);
Model::Direction dir = entity->getDirection();
SDL_Rect src = {
@@ -139,8 +139,6 @@ void MapView::render(float centerX, float centerY) {
SDL_RenderCopy(window->getRenderer(), entityTextures[entity->getName()], &src, &dst);
}
-
- SDL_RenderPresent(window->getRenderer());
}
}
diff --git a/src/view/MapView.hpp b/src/view/MapView.hpp
index 98dfe56..7f83006 100644
--- a/src/view/MapView.hpp
+++ b/src/view/MapView.hpp
@@ -55,7 +55,7 @@ public:
const std::map<std::string, SDL_Surface *> &entities);
~MapView();
- void render(float centerX, float centerY);
+ void render(float centerX, float centerY, uint64_t time);
};
}