diff --git a/package.yaml b/package.yaml index 7f9f448d5..b757866e7 100644 --- a/package.yaml +++ b/package.yaml @@ -81,7 +81,7 @@ executables: - -fno-state-hack - -funfolding-use-threshold1000 #- -funfolding-keeness-factor1000 - - -fllvm +# - -fllvm - -optlo-O3 - -Wall #- -Wcompat @@ -121,7 +121,7 @@ benchmarks: - -fno-state-hack - -funfolding-use-threshold1000 # - -funfolding-keeness-factor1000 - - -fllvm +# - -fllvm #- -optlo-O3 main: Bench.hs source-dirs: bench diff --git a/src/Dodge/Base/Coordinate.hs b/src/Dodge/Base/Coordinate.hs index ec69cea0d..3d75c4fbe 100644 --- a/src/Dodge/Base/Coordinate.hs +++ b/src/Dodge/Base/Coordinate.hs @@ -31,7 +31,7 @@ worldPosToResOffset cfig cam p = (worldPosToScreen cam p & each %~ f) + 0.5 *^ ((getWindowSize _gr_world_res cfig :: V2 Int) & each %~ fromIntegral) where - f x = applyResFactorF (cfig ^. gr_world_res) x + f = applyResFactorF (cfig ^. gr_world_res) -- | The mouse position in world coordinates. mouseWorldPos :: Input -> Camera -> Point2 diff --git a/src/Dodge/Debug/Picture.hs b/src/Dodge/Debug/Picture.hs index 33fd0b88e..584d6c686 100644 --- a/src/Dodge/Debug/Picture.hs +++ b/src/Dodge/Debug/Picture.hs @@ -214,8 +214,8 @@ drawPathBetween u = concat $ do color rose (foldMap (arrowPath . map nodepos) nodelist) <> drawCrossCol green sp <> drawCrossCol cyan ep - <> foldMap (color green . arrow sp) (nodepos <$> walkableNodeNear w sp) - <> foldMap (color cyan . flip arrow ep) (nodepos <$> walkableNodeNear w ep) + <> foldMap ((color green . arrow sp) . nodepos) (walkableNodeNear w sp) + <> foldMap ((color cyan . flip arrow ep) . nodepos) (walkableNodeNear w ep) <> foldMap (color orange . arrow sp) (pointTowardsImpulse sp ep w) where w = u ^. uvWorld diff --git a/src/Dodge/Item/AmmoSlots.hs b/src/Dodge/Item/AmmoSlots.hs index 01ed08f0c..bc7fe1ea0 100644 --- a/src/Dodge/Item/AmmoSlots.hs +++ b/src/Dodge/Item/AmmoSlots.hs @@ -1,4 +1,5 @@ {-# LANGUAGE LambdaCase #-} +{-# LANGUAGE TupleSections #-} module Dodge.Item.AmmoSlots ( itemAmmoSlots, @@ -29,14 +30,15 @@ heldItemAmmoSlots = \case RIFLE -> singleAmmo BulletAmmo AUTORIFLE -> singleAmmo BulletAmmo BURSTRIFLE -> singleAmmo BulletAmmo - ALTERIFLE -> IM.fromList (zip [0..1] $ repeat BulletAmmo) + --ALTERIFLE -> IM.fromList (zip [0..1] $ repeat BulletAmmo) + ALTERIFLE -> IM.fromList $ [0..1] <&> (,BulletAmmo) BANGROD -> singleAmmo BulletAmmo ELEPHANTGUN -> singleAmmo BulletAmmo AMR -> singleAmmo BulletAmmo AUTOAMR -> singleAmmo BulletAmmo SNIPERRIFLE -> singleAmmo BulletAmmo MINIGUNX _ -> singleAmmo BeltBulletAmmo - VOLLEYGUN i -> IM.fromList (zip [0..i-1] $ repeat BulletAmmo) + VOLLEYGUN i -> IM.fromList $ [0..i-1] <&> (,BulletAmmo) POISONSPRAYER -> singleAmmo GasAmmo FLAMETHROWER -> singleAmmo GasAmmo FLAMETORRENT -> singleAmmo GasAmmo diff --git a/src/Dodge/Item/Grammar.hs b/src/Dodge/Item/Grammar.hs index ec920fbff..7786eb891 100644 --- a/src/Dodge/Item/Grammar.hs +++ b/src/Dodge/Item/Grammar.hs @@ -197,11 +197,12 @@ rightChildList t = foldl' f l (reverse $ t ^.. dtRight . each . dtValue . _2) leftRightCombine :: DTComb a -> DTComb a -> DTree a -> DTree a -> Maybe (DTree a) leftRightCombine f f' t1 t2 = f t1 t2 <|> checkdepth t1 t2 where - checkdepth t t'@(DT x ls rs) = fromMaybe (checktop t t') $ do + --checkdepth t t'@(DT x ls rs) = fromMaybe (checktop t t') $ do + checkdepth t t'@(DT x ls rs) = fromMaybe (f' t t') $ do t'' <- safeHead ls tx <- checkdepth t t'' return $ Just $ DT x (tx : tail ls) rs - checktop t t' = f' t t' + --checktop t t' = f' t t' joinItemsInList :: (a -> a -> Maybe a) -> [a] -> [a] joinItemsInList f = fst . h . ([],) diff --git a/src/Dodge/Render.hs b/src/Dodge/Render.hs index 75558a09f..14e2220dc 100644 --- a/src/Dodge/Render.hs +++ b/src/Dodge/Render.hs @@ -385,7 +385,7 @@ doDrawing' win pdata u = do -- glBindTextureUnit 0 $ pdata ^. fboBase . _2 . _1 . unTO glBindTextureUnit 0 $ pdata ^. fboFullscreen . _2 . unTO glBindFramebuffer GL_FRAMEBUFFER 0 - if (cfig ^. gr_upscale_filter) then do + if cfig ^. gr_upscale_filter then do glUseProgram (pdata ^. textureAntiaShader) glGenerateTextureMipmap (pdata ^. fboBase . _2 . _1 . unTO) glUniform2f 0 (windowXFloat cfig) (windowYFloat cfig) diff --git a/src/Polyhedra.hs b/src/Polyhedra.hs index ce1e2b542..70d3d3277 100644 --- a/src/Polyhedra.hs +++ b/src/Polyhedra.hs @@ -128,7 +128,7 @@ helpPoly3D = picFormat . map f . polyToTris f (pos,col) = Verx pos col [] minBound PolyShad polysToPic :: [Polyhedra] -> Picture -polysToPic = fold . concatMap polyToPics +polysToPic = foldMap (fold . polyToPics) polyToEdges :: Polyhedra -> [(Point3,Point3,Point3,Point3)] polyToEdges = map denormalEdges . constructEdges . map (map fst) . _pyFaces