Move configuration from world to universe

This commit is contained in:
2021-11-28 22:30:47 +00:00
parent 45ba120796
commit 8c5777a1af
29 changed files with 343 additions and 300 deletions
+7 -6
View File
@@ -33,13 +33,14 @@ import Graphics.GL.Core43
doDrawing :: RenderData -> Universe -> IO Word32
doDrawing pdata u = do
let w = _uvWorld u
cfig = _config u
sTicks <- SDL.ticks
let rot = _cameraRot w
camzoom = _cameraZoom w
trans = _cameraCenter w
wins@(V2 winx winy) = V2 (getWindowX w) (getWindowY w)
resFact = w ^. config . resolution_factor
(wallPointsCol,windowPoints) = wallsAndWindows w
wins@(V2 winx winy) = V2 (_windowX cfig) (_windowY cfig)
resFact = cfig ^. resolution_factor
(wallPointsCol,windowPoints) = wallsAndWindows cfig w
lightPoints = lightsForGloom w
viewFroms@(V2 vfx vfy) = _cameraViewFrom w
viewFrom3d = Vector3 vfx vfy 20
@@ -51,7 +52,7 @@ doDrawing pdata u = do
shapeCounts <- UMV.replicate 3 (0 :: Int)
wlwiflCounts <- UMV.replicate 3 (0 :: Int)
-- attempt to poke in parallel
let (ws,wp) = worldSPic w
let (ws,wp) = worldSPic cfig w
MP.bindM3 (\ _ _ _ -> return ())
( pokeBindFoldableLayer shadV layerCounts wp)
( pokeWallsWindowsFloor
@@ -113,7 +114,7 @@ doDrawing pdata u = do
0
(fromIntegral nWalls)
--draw walls onto base buffer
if w ^. config . wall_textured
if cfig ^. wall_textured
then renderTextureWalls pdata nWalls
else renderBlankWalls pdata nWalls
--draw object pictures onto base buffer
@@ -175,7 +176,7 @@ doDrawing pdata u = do
renderLayer 2 shadV layerCounts
--renderWindows pdata windowPoints
drawShader (_windowShader pdata) nWins
when (_cloud_shadows $ _config w) $ do
when (_cloud_shadows cfig) $ do
----render transparency depths
depthMask $= Enabled
blend $= Disabled