Cleanup
This commit is contained in:
+5
-4
@@ -80,20 +80,21 @@ debugMenu = slTitleOptions
|
||||
"OPTIONS:GAMEPLAY"
|
||||
debugMenuOptions
|
||||
debugMenuOptions :: [MenuOption]
|
||||
debugMenuOptions = zipWith f [minBound..] $ map Scancode [4..]
|
||||
debugMenuOptions = zipWith ($)
|
||||
(map f [minBound..] ++ [makeEnumOption debug_view_clip_bounds "SHOW ROOM CLIP" return] )
|
||||
$ map Scancode [4..]
|
||||
where
|
||||
f :: DebugBool -> Scancode -> MenuOption
|
||||
f bd = Toggle (return . Just . (config . debug_booleans . at bd %~ toggleJust))
|
||||
(Right . g bd . (^? config . debug_booleans . ix bd))
|
||||
g bd Nothing = (show bd, "FALSE")
|
||||
g bd _ = (show bd, "TRUE")
|
||||
g bd Nothing = (show bd, "False")
|
||||
g bd _ = (show bd, "True")
|
||||
-- zipWith ($)
|
||||
-- [ makeBoolOption debug_seconds_frame "SHOW SECONDS/FRAME"
|
||||
-- , makeBoolOption debug_noclip "NOCLIP"
|
||||
-- , makeBoolOption debug_cr_status "SHOW CREATURE STATUS"
|
||||
-- , makeBoolOption debug_cr_awareness "SHOW CREATURE AWARENESS"
|
||||
-- , makeBoolOption debug_view_boundaries "SHOW VIEW BOUNDARIES"
|
||||
-- , makeEnumOption debug_view_clip_bounds "SHOW ROOM CLIP" return
|
||||
-- , makeBoolOption debug_pathing "SHOW PATHING"
|
||||
-- , makeBoolOption debug_show_sound "SHOW VISUAL SOUNDS"
|
||||
-- , makeBoolOption debug_mouse_position "SHOW MOUSE POSITION"
|
||||
|
||||
+4
-6
@@ -107,12 +107,10 @@ doDrawing pdata u = do
|
||||
currentProgram $= Just (_shadProg lwShad)
|
||||
uniform (head $ _shadUnis lwShad) $= viewFrom3d
|
||||
bindVertexArrayObject $= Just (_vao $ _shadVAO lwShad)
|
||||
if not (debugOn Remove_LOS cfig)
|
||||
then glDrawArrays
|
||||
(marshalEPrimitiveMode $ _shadPrim lwShad)
|
||||
0
|
||||
(fromIntegral nWalls)
|
||||
else return ()
|
||||
when (not (debugOn Remove_LOS cfig)) $ glDrawArrays
|
||||
(marshalEPrimitiveMode $ _shadPrim lwShad)
|
||||
0
|
||||
(fromIntegral nWalls)
|
||||
--draw walls onto base buffer
|
||||
if cfig ^. graphics_wall_textured
|
||||
then renderTextureWalls pdata nWalls
|
||||
|
||||
@@ -24,4 +24,4 @@ lightsForGloom cfig w = mapMaybe getLS (IM.elems $ _lightSources w)
|
||||
rad = _lsRad ls
|
||||
extraculltest
|
||||
| debugOn Cull_more_lights cfig = True
|
||||
| otherwise = isNothing (intersectSegPolyFirst lpos (lpos +.+ rad *.* (normalizeV (cpos -.- lpos))) cbox)
|
||||
| otherwise = isNothing (intersectSegPolyFirst lpos (lpos +.+ rad *.* normalizeV (cpos -.- lpos)) cbox)
|
||||
|
||||
@@ -43,7 +43,7 @@ worldSPic cfig w =
|
||||
filtOn f g = IM.filter (pointIsClose . f) (g w)
|
||||
--pointIsClose p = dist camCen p < _viewDistance w
|
||||
pointIsClose = cullPoint w
|
||||
camCen = _cameraCenter w
|
||||
--camCen = _cameraCenter w
|
||||
|
||||
cullPoint :: World -> Point2 -> Bool
|
||||
cullPoint w p = pointInPolygon p (_boundBox w)
|
||||
|
||||
@@ -208,7 +208,7 @@ farWallDist p cfig w = (winFac /)
|
||||
|
||||
farWallDistDirection :: Point2 -> Configuration -> World -> (Float,Float,Float,Float)
|
||||
--farWallDist p cfig w = (winFac /) . min maxViewDistance $ ssfold (> maxViewDistance) findMax 1 vps
|
||||
farWallDistDirection p cfig w = foldr m (0,0,0,0) $ map f vps
|
||||
farWallDistDirection p cfig w = foldr (m . f) (0,0,0,0) vps
|
||||
where
|
||||
f q = g $ rotateV (negate $ _cameraRot w) $ collidePointWallsFilter wlIsOpaque p q wos -.- p
|
||||
g (V2 x y) = (y, negate y, x, negate x)
|
||||
|
||||
Reference in New Issue
Block a user