From af955100d23d81e16d7dd69b574657b36debe221 Mon Sep 17 00:00:00 2001 From: fl4shk Date: Mon, 14 Nov 2022 13:59:18 -0600 Subject: [PATCH] `wfc::Wfc::_add_constraint()`: change `to_erase_uset` to `to_erase_darr` --- GNUmakefile | 1 + dungeon.txt | 42 +++++++++++++++++++++++++----------------- src/wfc_class.cpp | 36 ++++++++++++++++++------------------ 3 files changed, 44 insertions(+), 35 deletions(-) diff --git a/GNUmakefile b/GNUmakefile index f10c2ef..a55819a 100644 --- a/GNUmakefile +++ b/GNUmakefile @@ -13,6 +13,7 @@ CXX_DIRS:=$(SHARED_SRC_DIRS) # Whether or not to do debugging stuff #DEBUG:=yeah do debug +#DEBUG_OPTIMIZATION_LEVEL:=-O2 DEBUG_OPTIMIZATION_LEVEL:=-Og #DEBUG_OPTIMIZATION_LEVEL:=-O1 #DEBUG_OPTIMIZATION_LEVEL:=-O0 diff --git a/dungeon.txt b/dungeon.txt index 9efd4d5..fdcb8d8 100644 --- a/dungeon.txt +++ b/dungeon.txt @@ -1,17 +1,25 @@ - - ######### ########### - #.......# #.........# - #.......+,,,,,,,+.........# - #.......# #.........# - #####+### ######+#### - , , - , , - ,,,,,,,,,,,,,,,,,, - , , - , , - #####+###### #####+### - #..........# #.......# - #..........+,,,,,+.......# - #..........# #.......# - ############ #.......# - ######### + + + + ######### ############# + #.......# #...........# + #.......+,,,,,+...........# + #.......# #...........# + #.......# #...........# + #.......# #...........# + #.......# #...........# + #####+### ########+#### + , , + , , + ,,,,,,,,,,,,,,,,,, + , , + , , + #####+##### #####+### + #.........## ##.......# + #..........+,,,,+........# + #.........## #........# + ########### #........# + ########## + + + diff --git a/src/wfc_class.cpp b/src/wfc_class.cpp index 1f8f02b..0f4e893 100644 --- a/src/wfc_class.cpp +++ b/src/wfc_class.cpp @@ -845,11 +845,11 @@ void Wfc::_add_constraint( = potential.at(neighbor.pos.y).at(neighbor.pos.x); //printout("debug: _add_constraint(): tiles: ", tiles, "\n"); - std::unordered_set - //tiles, - //other_tiles, - to_erase_uset; - //std::vector to_erase_darr; + //std::unordered_set + // //tiles, + // //other_tiles, + // to_erase_uset; + std::vector to_erase_darr; //for (size_t i=0; i