Refactor differing resolutions somewhat

This commit is contained in:
2023-03-24 11:14:49 +00:00
parent cd224437e7
commit 4b92a43535
11 changed files with 69 additions and 52 deletions
+7 -4
View File
@@ -4,6 +4,7 @@ module Preload.Update (
pdataResizeUpdate,
) where
import Dodge.Data.Config
import Control.Lens
import qualified Data.ByteString as BS
import qualified Data.ByteString.Char8 as BSC
@@ -14,6 +15,7 @@ import Shader.Compile
import Shader.Data
pdataResizeUpdate ::
Configuration ->
-- | Scaled width
Int ->
-- | Scaled height
@@ -24,11 +26,12 @@ pdataResizeUpdate ::
Int ->
PreloadData ->
IO PreloadData
pdataResizeUpdate xsize ysize xfull yfull pdata = do
rd <- renderDataResizeUpdate xsize ysize xfull yfull (_renderData pdata)
pdataResizeUpdate cfig xsize ysize xfull yfull pdata = do
rd <- renderDataResizeUpdate cfig xsize ysize xfull yfull (_renderData pdata)
return (pdata{_renderData = rd})
renderDataResizeUpdate ::
Configuration ->
-- | Scaled width
Int ->
-- | Scaled height
@@ -39,8 +42,8 @@ renderDataResizeUpdate ::
Int ->
RenderData ->
IO RenderData
renderDataResizeUpdate xsize ysize xfull yfull rdata = do
rdata' <- sizeFBOs xsize ysize xfull yfull rdata
renderDataResizeUpdate cfig xsize ysize xfull yfull rdata = do
rdata' <- sizeFBOs cfig rdata
bbVert <- BS.readFile "shader/texture/bloomBlur.vert"
bbFrag <- BS.readFile "shader/texture/bloomBlur.frag"
let (bh, bmid) = BS.breakSubstring "(" bbFrag