Browse Source

Reduce double scans in GetSizeForThemeRoom

This takes it from 200% to just 110% tiles scanned during the processes
pull/5018/head
Anders Jenbo 4 years ago
parent
commit
bd175f1c53
  1. 4
      Source/levels/gendung.cpp

4
Source/levels/gendung.cpp

@ -105,7 +105,7 @@ std::optional<Size> GetSizeForThemeRoom(int floor, Point origin, int minSize, in
Size room { maxWidth, maxHeight };
for (int i = 0; i < maxSize; i++) {
int width = 0;
int width = i < room.height ? i : 0;
if (i < maxHeight) {
while (width < room.width) {
if (dungeon[origin.x + width][origin.y + i] != floor)
@ -115,7 +115,7 @@ std::optional<Size> GetSizeForThemeRoom(int floor, Point origin, int minSize, in
}
}
int height = 0;
int height = i < room.width ? i : 0;
if (i < maxWidth) {
while (height < room.height) {
if (dungeon[origin.x + i][origin.y + height] != floor)

Loading…
Cancel
Save