diff --git a/src/Dodge/Menu.hs b/src/Dodge/Menu.hs index 9bc5cce58..eea37811b 100644 --- a/src/Dodge/Menu.hs +++ b/src/Dodge/Menu.hs @@ -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" diff --git a/src/Dodge/Render.hs b/src/Dodge/Render.hs index f2189b6cd..c3e923c4b 100644 --- a/src/Dodge/Render.hs +++ b/src/Dodge/Render.hs @@ -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 diff --git a/src/Dodge/Render/Lights.hs b/src/Dodge/Render/Lights.hs index aed9c0b10..02a8f33b0 100644 --- a/src/Dodge/Render/Lights.hs +++ b/src/Dodge/Render/Lights.hs @@ -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) diff --git a/src/Dodge/Render/ShapePicture.hs b/src/Dodge/Render/ShapePicture.hs index 8cae77a98..9e2c9e1b5 100644 --- a/src/Dodge/Render/ShapePicture.hs +++ b/src/Dodge/Render/ShapePicture.hs @@ -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) diff --git a/src/Dodge/Update/Camera.hs b/src/Dodge/Update/Camera.hs index ed3bf7640..58f684064 100644 --- a/src/Dodge/Update/Camera.hs +++ b/src/Dodge/Update/Camera.hs @@ -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)