Implement different shadow resolutions

This commit is contained in:
jgk
2021-04-28 23:16:42 +02:00
parent 8cb177a21c
commit 750a67ea6e
8 changed files with 63 additions and 42 deletions
+8 -2
View File
@@ -20,6 +20,7 @@ import Dodge.Base
import Dodge.Creature.Action
import Dodge.SoundLogic
import Dodge.Inventory
import Dodge.Config.Data
import Geometry
import Preload.Update
@@ -66,13 +67,18 @@ handleMouseWheelEvent mwev w = case _menuLayers w of
| otherwise -> Just w
_ -> Just w
{-
Resets the world window size, and resizes the fbo that gets the light map drawn into it.
-}
handleResizeEvent :: WindowSizeChangedEventData -> World -> Maybe World
handleResizeEvent sev = Just
handleResizeEvent sev w = Just
. set windowX (fromIntegral x)
. set windowY (fromIntegral y)
. over sideEffects ( resizeSpareFBO (fromIntegral x) (fromIntegral y) : )
$ over sideEffects ( resizeSpareFBO (fromIntegral x `div` divRes) (fromIntegral y `div` divRes) : )
w
where
V2 x y = windowSizeChangedEventSize sev
divRes = w ^. config . shadow_resolution
handlePressedMouseButton :: MouseButton -> World -> Maybe World
handlePressedMouseButton but w