X-Git-Url: https://git.localhorst.tv/?a=blobdiff_plain;f=src%2Fmap%2FMap.cpp;h=b87cd03cb5674a2333f3b78315d1e4c03e01cf5d;hb=d7694cc492924fad379e8886e9e23606960717c1;hp=20f2fa575585eebd8cc0fe070d4fafb50f2b1a00;hpb=be3b4e75c82b6e9d2b5c4300138d490ec1a4932a;p=l2e.git diff --git a/src/map/Map.cpp b/src/map/Map.cpp index 20f2fa5..b87cd03 100644 --- a/src/map/Map.cpp +++ b/src/map/Map.cpp @@ -71,4 +71,22 @@ void Map::Render(SDL_Surface *dest, const Vector &inOffset) const { } } +void Map::RenderDebug(SDL_Surface *dest, const Vector &inOffset) const { + // TODO: skip invisible areas + for (int i(0); i < numAreas; ++i) { + const Area &area(areas[i]); + Vector offset(inOffset + Vector::FromIndex(i, width) * area.Size() * tileset->Size()); + area.RenderDebug(dest, tileset, offset); + } + for (int i(0); i < numTriggers; ++i) { + Vector offset((triggers[i].TilePosition() * tileset->Size()) + inOffset); + SDL_Rect destRect; + destRect.x = offset.X() + (tileset->Width() / 4); + destRect.y = offset.Y() + (tileset->Height() / 4); + destRect.w = tileset->Width() / 2; + destRect.h = tileset->Height() / 2; + SDL_FillRect(dest, &destRect, SDL_MapRGB(dest->format, 0x00, 0xFF, 0xFF)); + } +} + }