Fix tile drawing bug
This commit is contained in:
@@ -75,14 +75,20 @@ combineRooms :: Room -> Room -> Room
|
||||
combineRooms r r' = defaultRoom
|
||||
{ _rmPolys = _rmPolys r ++ _rmPolys r'
|
||||
, _rmLinks = _rmLinks r ++ _rmLinks r'
|
||||
, _rmPath = (_rmPath r )
|
||||
++ (_rmPath r')
|
||||
, _rmPath = map clampPath $ _rmPath r
|
||||
++ _rmPath r'
|
||||
, _rmPS = map (shiftPlacement $ _rmShift r) (_rmPS r)
|
||||
++ map (shiftPlacement $ _rmShift r') (_rmPS r')
|
||||
, _rmBound = _rmBound r ++ _rmBound r'
|
||||
, _rmFloor = _rmFloor r ++ _rmFloor r'
|
||||
, _rmShift = (V2 0 0 , 0)
|
||||
}
|
||||
-- not that this assumes that any link paths are integral
|
||||
clampPath :: (Point2,Point2) -> (Point2, Point2)
|
||||
clampPath = bimap f f
|
||||
where
|
||||
f (V2 x y) = V2 (g x) (g y)
|
||||
g = (fromIntegral :: Int -> Float) . floor
|
||||
{- Randomly generate a top fourth of a room possibly with a wall.
|
||||
Add a light and a 'PutNothing' placement. -}
|
||||
quarterRoomFlat :: RandomGen g => Float -> State g Room
|
||||
|
||||
Reference in New Issue
Block a user