Browse Source

Merge pull request #1216 from galaxyhaxz/ThemeRoom

DRLG_HoldThemeRooms
pull/124/head
Robin Eklind 7 years ago committed by GitHub
parent
commit
b820f073ef
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 53
      Source/gendung.cpp

53
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);
}
}
}

Loading…
Cancel
Save