diff options
author | Matthias Schiffer <mschiffer@universe-factory.net> | 2014-09-24 01:38:30 +0200 |
---|---|---|
committer | Matthias Schiffer <mschiffer@universe-factory.net> | 2014-09-24 01:38:30 +0200 |
commit | ea8840291cdf66784c6a2cb465b63ccfb5483c38 (patch) | |
tree | 0ab1e059c3b798d27f8d9a15816c7beb0dd236e8 /src/view | |
parent | 24ae84861379f2f878804b53a457153ad1ad6c1e (diff) | |
download | rpgedit-ea8840291cdf66784c6a2cb465b63ccfb5483c38.tar rpgedit-ea8840291cdf66784c6a2cb465b63ccfb5483c38.zip |
New event-driven goodness
Diffstat (limited to 'src/view')
-rw-r--r-- | src/view/MapView.cpp | 6 | ||||
-rw-r--r-- | src/view/MapView.hpp | 2 |
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); }; } |