Fix bloom resize bug, bloom itself could use improvement

This commit is contained in:
jgk
2021-08-19 23:39:12 +02:00
parent 9ef1f9b574
commit 6933d610cd
9 changed files with 214 additions and 48 deletions
+2 -2
View File
@@ -7,7 +7,7 @@ import Dodge.Data.SoundOrigin
import Dodge.Config.Data
import Sound
import Data.Preload
import Framebuffer.Update
import Preload.Update
import Data.Aeson (encodeFile)
--import Control.Monad (when)
@@ -37,7 +37,7 @@ applyWorldConfig
-> PreloadData SoundOrigin
-> IO (PreloadData SoundOrigin)
applyWorldConfig cfig pdata = do
setVol cfig pdata >>= sizeFBOs (x `div` divRes) (y `div` divRes) x y
setVol cfig pdata >>= pdataResizeUpdate (x `div` divRes) (y `div` divRes) x y
where
x = round $ _windowX cfig
y = round $ _windowY cfig
+2 -2
View File
@@ -23,7 +23,7 @@ import Dodge.SoundLogic
import Dodge.Inventory
import Dodge.Config.Data
--import Geometry
import Framebuffer.Update
import Preload.Update
import qualified IntMapHelp as IM
import Control.Lens
@@ -65,7 +65,7 @@ handleResizeEvent :: WindowSizeChangedEventData -> World -> Maybe World
handleResizeEvent sev w = Just
. set (config . windowX) (fromIntegral x)
. set (config . windowY) (fromIntegral y)
$ over sideEffects ( sizeFBOs (x `div` divRes) (y `div` divRes) x y : )
$ over sideEffects (pdataResizeUpdate (x `div` divRes) (y `div` divRes) x y : )
w
where
x = fromIntegral x'
+2 -2
View File
@@ -10,7 +10,7 @@ import Dodge.SoundLogic
import Dodge.Config.Data
import Dodge.Config.Update
import Dodge.Layout
import Framebuffer.Update
import Preload.Update
import Dodge.Debug.Terminal
import Data.Maybe
@@ -90,7 +90,7 @@ scodeToChar = toEnum . (+ 61) . fromIntegral . toNumber
updateFramebufferSize :: World -> World
updateFramebufferSize w = w & sideEffects
%~ (sizeFBOs (x `div` divRes) (y `div` divRes) x y : )
%~ (pdataResizeUpdate (x `div` divRes) (y `div` divRes) x y : )
where
(x,y) = (round $ getWindowX w, round $ getWindowY w)
divRes = w ^. config . shadow_resolution