From 87c63ffb345f0408243a348bd4f8225c324c1cb4 Mon Sep 17 00:00:00 2001 From: galaxyhaxz Date: Sun, 26 May 2019 21:39:17 -0500 Subject: [PATCH] DRLG_HoldThemeRooms --- Source/gendung.cpp | 53 +++++++++++----------------------------------- 1 file changed, 12 insertions(+), 41 deletions(-) diff --git a/Source/gendung.cpp b/Source/gendung.cpp index fa91f5605..ea85561d3 100644 --- a/Source/gendung.cpp +++ b/Source/gendung.cpp @@ -975,48 +975,19 @@ void DRLG_PlaceThemeRooms(int minSize, int maxSize, int floor, int freq, int rnd void DRLG_HoldThemeRooms() { - int *v0; // esi - int v1; // edi - int v2; // edx - int v3; // ebx - int v4; // edi - int v5; // ecx - int v6; // eax - int v7; // [esp+0h] [ebp-Ch] - int v8; // [esp+4h] [ebp-8h] - int v9; // [esp+8h] [ebp-4h] - - if (themeCount > 0) { - v0 = &themeLoc[0].height; - v8 = themeCount; - do { - v1 = *(v0 - 3); - if (v1 < v1 + *v0 - 1) { - v2 = *(v0 - 4); - v3 = 2 * v1 + 16; - v7 = v2 + *(v0 - 1) - 1; - v9 = *v0 - 1; - do { - if (v2 < v7) { - v4 = 224 * (v2 + 8); - v5 = v7 - v2; - do { - v6 = v3 + v4; - v4 += 224; - dFlags[0][v6] |= DFLAG_POPULATED; - dFlags[1][v6] |= DFLAG_POPULATED; - dFlags[0][v6 + 1] |= DFLAG_POPULATED; - dFlags[1][v6 + 1] |= DFLAG_POPULATED; - --v5; - } while (v5); - } - v3 += 2; - --v9; - } while (v9); + int i, x, y, xx, yy; + + for(i = 0; i < themeCount; i++) { + for(y = themeLoc[i].y; y < themeLoc[i].y + themeLoc[i].height - 1; y++) { + for(x = themeLoc[i].x; x < themeLoc[i].x + themeLoc[i].width - 1; x++) { + xx = 2 * x + 16; + yy = 2 * y + 16; + dFlags[xx][yy] |= DFLAG_POPULATED; + dFlags[xx + 1][yy] |= DFLAG_POPULATED; + dFlags[xx][yy + 1] |= DFLAG_POPULATED; + dFlags[xx + 1][yy + 1] |= DFLAG_POPULATED; } - v0 += 5; - --v8; - } while (v8); + } } }