Tweak wall cutting, removes inverse walls

This commit is contained in:
2021-04-23 21:17:37 +02:00
parent 4c611ba4aa
commit 108b66f3ad
7 changed files with 289 additions and 121 deletions
+4 -1
View File
@@ -5,6 +5,7 @@ module Dodge.Layout
where
import Dodge.Data
import Dodge.LevelGen
import Dodge.LevelGen.StaticWalls
import Dodge.LevelGen.Data
import Dodge.Base
import Dodge.RandomHelp
@@ -77,6 +78,7 @@ wallsFromTree t =
-- createInnerWalls
divideWalls
. assignKeys
. removeInverseWalls
. foldr cutWalls [] -- map (map (g . roundPoint2))
-- . map (map roundPoint2)
$ (concatMap _rmPolys $ flatten t)
@@ -88,7 +90,8 @@ wallsFromTree t =
wallsFromRooms :: [Room] -> IM.IntMap Wall
wallsFromRooms =
-- divideWalls .
IM.fromList . zip [0..] . zipWith f [0..] . foldr cutWalls [] . concatMap _rmPolys
IM.fromList . zip [0..] . zipWith f [0..] . removeInverseWalls
. foldr cutWalls [] . concatMap _rmPolys
where
f i (x,y) = defaultWall {_wlLine = [x,y] , _wlID = i}