Added region highlighting

This commit is contained in:
Kayne Ruse
2013-10-06 19:22:26 +11:00
parent 29928c0b92
commit 719c8f49a6
4 changed files with 51 additions and 22 deletions
+10
View File
@@ -85,6 +85,16 @@ void RegionPager::DrawTo(SDL_Surface* const dest, std::list<TileSheet>* const sh
*/
for (auto& regionIter : regionList) {
//draw the region's location
SDL_Rect box = {
Sint16(regionIter.GetX() + camX),
Sint16(regionIter.GetY() + camY),
Uint16(regionIter.GetWidth()),
Uint16(regionIter.GetHeight())
};
SDL_FillRect(dest, &box, SDL_MapRGB(dest->format, 10, 10, 20));
//draw each tile
for (auto& tileIter : *regionIter.GetTiles()) {
for (auto& sheetIter : *sheetList) {
if (sheetIter.InRange(tileIter.tileIndex)) {