]> git.localhorst.tv Git - l2e.git/blobdiff - src/map/MapState.cpp
fix gcc memcpy warning
[l2e.git] / src / map / MapState.cpp
index 9bae990ce6d72c053ce1b252a48a121cf49d0f67..0e0a3ee44ea7e916ef0cb026c8f1428bf5dca257 100644 (file)
@@ -43,7 +43,8 @@ MapState::MapState(GameConfig *g, Map *map)
 
 
 void MapState::OnEnterState(SDL_Surface *screen) {
-       camera.Resize(screen->w, screen->h);
+       OnResize(screen->w, screen->h);
+       tileAnimation = GraphicsTimers().StartInterval(512);
        LoadMap(map);
 }
 
@@ -52,7 +53,7 @@ void MapState::OnExitState(SDL_Surface *screen) {
 }
 
 void MapState::OnResumeState(SDL_Surface *screen) {
-       camera.Resize(screen->w, screen->h);
+       OnResize(screen->w, screen->h);
 }
 
 void MapState::OnPauseState(SDL_Surface *screen) {
@@ -463,7 +464,7 @@ void MapState::Render(SDL_Surface *screen) {
        SDL_FillRect(screen, 0, SDL_MapRGB(screen->format, 0, 0, 0));
 
        Vector<int> offset(camera.CalculateOffset());
-       map->Render(screen, offset);
+       map->Render(screen, offset, tileAnimation.Iteration());
 
        if (debug) {
                map->RenderDebug(screen, offset);