Redo shape vertices as a list, should allow for mirroring

This commit is contained in:
2022-07-04 23:17:53 +01:00
parent 914c452afb
commit 22ac8feb37
6 changed files with 35 additions and 43 deletions
+1 -1
View File
@@ -51,7 +51,7 @@ doDrawing pdata u = do
-- attempt to poke in parallel
-- let (ws,wp) = wallSPics <> worldSPic cfig w
( (nWalls, nWins , nFls),(nShapeVs, nIndices, nSilIndices) )
<- MP.bindM2 (\ wlwifl counts -> return (wlwifl,counts))
<- MP.bindM2 (curry return)
( pokeWallsWindowsFloor
(shadVBOptr $ _wallTextureShader pdata)
(shadVBOptr $ _windowShader pdata)
+11 -11
View File
@@ -43,18 +43,18 @@ import Padding
worldSPic :: Configuration -> World -> Stream (Of SPic) IO ()
worldSPic cfig w
= (S.yield (mempty, extraPics cfig w) )
<> (S.each $ fmap (dbArg _prDraw) (filtOn _prPos _props) )
<> (S.each $ fmap (shiftDraw _blPos _blDir _blDraw) (filtOn _blPos _blocks) )
<> (S.each $ fmap (shiftDraw _fsPos _fsDir (const _fsSPic)) (filtOn _fsPos _shapes) )
<> (S.each $ fmap (dbArg _cpPict) (filtOn _cpPos _corpses) )
<> (S.map (dbArg _crPict) (filtOn' _crPos _creatures) )
<> (S.each $ fmap floorItemSPic (filtOn _flItPos _floorItems) )
<> (S.each $ fmap btSPic (filtOn _btPos _buttons) )
<> (S.each $ fmap mcSPic (filtOn _mcPos _machines) )
<> S.yield (anyTargeting cfig w )
= S.yield (mempty, extraPics cfig w)
<> S.map (dbArg _prDraw) (filtOn' _prPos _props)
<> S.map (shiftDraw _blPos _blDir _blDraw) (filtOn' _blPos _blocks)
<> S.map (shiftDraw _fsPos _fsDir (const _fsSPic)) (filtOn' _fsPos _shapes)
<> S.map (dbArg _cpPict) (filtOn' _cpPos _corpses)
<> S.map (dbArg _crPict) (filtOn' _crPos _creatures)
<> S.map floorItemSPic (filtOn' _flItPos _floorItems)
<> S.map btSPic (filtOn' _btPos _buttons)
<> S.map mcSPic (filtOn' _mcPos _machines)
<> S.yield (anyTargeting cfig w)
where
filtOn f g = IM.filter (pointIsClose . f) (g w)
--filtOn f g = IM.filter (pointIsClose . f) (g w)
filtOn' f g = S.filter (pointIsClose . f) $ S.each (g w)
pointIsClose = cullPoint cfig w