Fix tile rendering
This commit is contained in:
@@ -9,7 +9,7 @@ import Control.Lens
|
||||
addTile :: Float -> Room -> Room
|
||||
addTile z r
|
||||
| not (null (_rmFloor r)) || null rp = r
|
||||
| otherwise = r & rmFloor .~ [oTile poly z]
|
||||
| otherwise = r & rmFloor .~ [makeTileFromPoly poly z]
|
||||
where
|
||||
rp = _rmPolys r
|
||||
poly = convexHull $ concat rp
|
||||
poly = orderPolygon . convexHull $ concat rp
|
||||
|
||||
@@ -16,7 +16,7 @@ corridor = defaultRoom
|
||||
, _rmPath = concatMap (doublePair . (,) (V2 20 60) . fst) lnks
|
||||
, _rmPS = []
|
||||
, _rmBound = [ rectNSWE 50 30 0 40 ]
|
||||
, _rmFloor = [oTile poly 2]
|
||||
, _rmFloor = [makeTileFromPoly poly 2]
|
||||
}
|
||||
where
|
||||
poly = rectNSWE 80 0 0 40
|
||||
|
||||
@@ -73,9 +73,8 @@ shiftRoomBy shift r = r
|
||||
& rmBound %~ fmap (map (shiftPointBy shift))
|
||||
& rmFloor %~ map
|
||||
( (tilePoly %~ map (shiftPointBy shift))
|
||||
. (tileCenter %~ shiftPointBy shift )
|
||||
. (tileX %~ shiftPointBy shift )
|
||||
. (tileY %~ shiftPointBy shift )
|
||||
. (tileZero %~ shiftPointBy shift )
|
||||
. (tileX %~ shiftPointBy shift )
|
||||
)
|
||||
|
||||
shiftLinkBy
|
||||
|
||||
@@ -53,10 +53,9 @@ roomRect x y xn yn = defaultRoom
|
||||
, _rmBound = [rectNSWE (y+5) (-5) (-5) (x+5)]
|
||||
, _rmFloor = [Tile
|
||||
{ _tilePoly = rectNSWE y 0 0 x
|
||||
, _tileCenter = V2 0 0
|
||||
, _tileX = V2 50 0
|
||||
, _tileY = V2 0 50
|
||||
, _tileZ = 16
|
||||
, _tileZero = V2 0 0
|
||||
, _tileX = V2 1 0
|
||||
, _tileZ = 16
|
||||
} ]
|
||||
}
|
||||
where
|
||||
|
||||
Reference in New Issue
Block a user