X-Git-Url: http://git.localhorst.tv/?a=blobdiff_plain;f=src%2Fmap%2FMapState.cpp;h=b8b5eb629d8601a2de2ce2a4a03044df9b28fcad;hb=5f9a1893c0db8f53889a390e4c4b95d57abd4384;hp=ca1dafb0542691556627858c482d755de24005ee;hpb=d7d5ff97b2e4136141f5603d0ec9cef1d4467749;p=l2e.git diff --git a/src/map/MapState.cpp b/src/map/MapState.cpp index ca1dafb..b8b5eb6 100644 --- a/src/map/MapState.cpp +++ b/src/map/MapState.cpp @@ -44,6 +44,7 @@ MapState::MapState(GameConfig *g, Map *map) void MapState::OnEnterState(SDL_Surface *screen) { camera.Resize(screen->w, screen->h); + tileAnimation = GraphicsTimers().StartInterval(512); LoadMap(map); } @@ -299,6 +300,7 @@ bool MapState::CheckMonster() { for (std::vector::iterator e(entities.begin()), end(entities.end()); e != end; ++e) { if ((*e)->Hostile() && map->TileCoordinates(ToInt((*e)->Position())) == neighbor[i]) { // TODO: move entity erase to happen after the transition or battle + LoadBattle(*controlled, **e); entities.erase(e); return true; } @@ -462,7 +464,7 @@ void MapState::Render(SDL_Surface *screen) { SDL_FillRect(screen, 0, SDL_MapRGB(screen->format, 0, 0, 0)); Vector offset(camera.CalculateOffset()); - map->Render(screen, offset); + map->Render(screen, offset, tileAnimation.Iteration()); if (debug) { map->RenderDebug(screen, offset);