X-Git-Url: http://git.localhorst.tv/?a=blobdiff_plain;f=src%2Fmap%2FArea.cpp;h=84dc8a6a527747fce948b6dffb289bc60ee55f0c;hb=3b5b2b79db22ef40c031d791a976310ea49e0d8e;hp=0b25a04bd7b512e9ca1f913856ff410f602b5667;hpb=07cdc452aeaad73ca9f8f9a3cf9868d2b6c9d5b3;p=l2e.git diff --git a/src/map/Area.cpp b/src/map/Area.cpp index 0b25a04..84dc8a6 100644 --- a/src/map/Area.cpp +++ b/src/map/Area.cpp @@ -45,6 +45,21 @@ void Area::Render(SDL_Surface *dest, const graphics::Sprite *tileset, const Vect } void Area::RenderDebug(SDL_Surface *dest, const graphics::Sprite *tileset, const Vector &inOffset) const { + SDL_Rect destRect; + destRect.x = inOffset.X(); + destRect.y = inOffset.Y(); + destRect.w = Width() * tileset->Width(); + destRect.h = 1; + SDL_FillRect(dest, &destRect, SDL_MapRGB(dest->format, 0x00, 0x00, 0xFF)); + destRect.y += Height() * tileset->Height() - 1; + SDL_FillRect(dest, &destRect, SDL_MapRGB(dest->format, 0x00, 0x00, 0xFF)); + destRect.y = inOffset.Y(); + destRect.w = 1; + destRect.h = Height() * tileset->Height(); + SDL_FillRect(dest, &destRect, SDL_MapRGB(dest->format, 0x00, 0x00, 0xFF)); + destRect.x += Width() * tileset->Width() - 1; + SDL_FillRect(dest, &destRect, SDL_MapRGB(dest->format, 0x00, 0x00, 0xFF)); + for (int i(0); i < numTiles; ++i) { Vector offset( inOffset.X() + (i % width) * tileset->Width(), @@ -52,7 +67,6 @@ void Area::RenderDebug(SDL_Surface *dest, const graphics::Sprite *tileset, const const Tile &tile(tiles[i]); if (tile.BlocksNorth()) { - SDL_Rect destRect; destRect.x = offset.X(); destRect.y = offset.Y(); destRect.w = tileset->Width(); @@ -61,7 +75,6 @@ void Area::RenderDebug(SDL_Surface *dest, const graphics::Sprite *tileset, const } if (tile.BlocksEast()) { - SDL_Rect destRect; destRect.x = offset.X() + tileset->Width() - 1; destRect.y = offset.Y(); destRect.w = 1; @@ -70,7 +83,6 @@ void Area::RenderDebug(SDL_Surface *dest, const graphics::Sprite *tileset, const } if (tile.BlocksSouth()) { - SDL_Rect destRect; destRect.x = offset.X(); destRect.y = offset.Y() + tileset->Height() - 1; destRect.w = tileset->Width(); @@ -79,7 +91,6 @@ void Area::RenderDebug(SDL_Surface *dest, const graphics::Sprite *tileset, const } if (tile.BlocksWest()) { - SDL_Rect destRect; destRect.x = offset.X(); destRect.y = offset.Y(); destRect.w = 1;