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