Improve level generation speed
This commit is contained in:
@@ -2,6 +2,9 @@ module Dodge.Debug where
|
||||
import Dodge.Data
|
||||
import Dodge.Picture
|
||||
import Dodge.Picture.Layer
|
||||
import Dodge.Base.Zone
|
||||
import Dodge.Base
|
||||
import Geometry.Zone
|
||||
import Geometry.Data
|
||||
import Geometry
|
||||
import Picture
|
||||
@@ -58,3 +61,14 @@ drawDDA = setLayer 1 . color (withAlpha 0.5 green) . IM.foldlWithKey' f []
|
||||
where
|
||||
x = 50 * fromIntegral x'
|
||||
ys = map ((50 *) . fromIntegral) $ IS.toList ys'
|
||||
|
||||
debugWallZoningPic :: World -> Picture
|
||||
debugWallZoningPic w = setLayer 1 $ zonesPic ++ wallsPic
|
||||
where
|
||||
wallsPic = setDepth 25 . color yellow . concatMap (drawTheWall . _wlLine) $ IM.elems theWalls
|
||||
drawTheWall (a,b) = lineOfThickness 20 [a,b]
|
||||
theWalls = wallsAlongLine sp ep w
|
||||
zonesPic = setDepth 20 $ drawDDA zones
|
||||
zones = ddaExt zoneSize sp ep
|
||||
sp = _crPos $ you w
|
||||
ep = mouseWorldPos w
|
||||
|
||||
Reference in New Issue
Block a user