X-Git-Url: https://git.localhorst.tv/?a=blobdiff_plain;ds=sidebyside;f=src%2Fmap%2FMapState.cpp;h=350a1f48f8be2813585fef2fbc8233b5f4f06000;hb=07cdc452aeaad73ca9f8f9a3cf9868d2b6c9d5b3;hp=108d97c123c7d4e9f60b81170fcd3019ff0002f9;hpb=aa1a197e532673f0c4d33dee5bed27298c050d38;p=l2e.git diff --git a/src/map/MapState.cpp b/src/map/MapState.cpp index 108d97c..350a1f4 100644 --- a/src/map/MapState.cpp +++ b/src/map/MapState.cpp @@ -27,7 +27,8 @@ MapState::MapState(Map *map) , camera(100, 100, &tempTarget) , walkingSpeed(64) , nextDirection(-1) -, afterLock(false) { +, afterLock(false) +, debug(false) { } @@ -67,6 +68,10 @@ void MapState::HandleEvents(const Input &input) { } else { nextDirection = -1; } + + if (input.JustPressed(Input::DEBUG_1)) { + debug = !debug; + } } void MapState::UpdateWorld(float deltaT) { @@ -278,6 +283,10 @@ void MapState::Render(SDL_Surface *screen) { Vector offset(camera.CalculateOffset()); map->Render(screen, offset); + if (debug) { + map->RenderDebug(screen, offset); + } + std::sort(entities.begin(), entities.end(), ZCompare); for (std::vector::iterator i(entities.begin()), end(entities.end()); i != end; ++i) { (*i)->Render(screen, offset);