deparallelize
This commit is contained in:
parent
08c28fe686
commit
f7dac3e0b6
1 changed files with 2 additions and 3 deletions
|
@ -13,7 +13,6 @@ import Affection.Types
|
||||||
|
|
||||||
import Control.Monad
|
import Control.Monad
|
||||||
import Control.Monad.State (get)
|
import Control.Monad.State (get)
|
||||||
import qualified Control.Monad.Parallel as MP
|
|
||||||
|
|
||||||
import Data.Maybe
|
import Data.Maybe
|
||||||
|
|
||||||
|
@ -34,7 +33,7 @@ updateParticle
|
||||||
-> Affection us [Particle]
|
-> Affection us [Particle]
|
||||||
-- ^ processed 'Particle's
|
-- ^ processed 'Particle's
|
||||||
updateParticle time func l =
|
updateParticle time func l =
|
||||||
catMaybes <$> MP.mapM (\p -> do
|
catMaybes <$> mapM (\p -> do
|
||||||
now <- elapsedTime <$> get
|
now <- elapsedTime <$> get
|
||||||
if particleCreation p + particleTimeToLive p < now
|
if particleCreation p + particleTimeToLive p < now
|
||||||
then do
|
then do
|
||||||
|
@ -124,7 +123,7 @@ drawParticleSystem sys draw =
|
||||||
if not (null parts)
|
if not (null parts)
|
||||||
then do
|
then do
|
||||||
liftIO $ G.gegl_node_link (particleStackCont $ head parts) (partSysNode sys)
|
liftIO $ G.gegl_node_link (particleStackCont $ head parts) (partSysNode sys)
|
||||||
MP.mapM_ (draw (partSysBuffer sys) (partSysNode sys)) parts
|
mapM_ (draw (partSysBuffer sys) (partSysNode sys)) parts
|
||||||
else do
|
else do
|
||||||
_ <- liftIO $ G.gegl_node_disconnect (partSysNode sys) "input"
|
_ <- liftIO $ G.gegl_node_disconnect (partSysNode sys) "input"
|
||||||
return ()
|
return ()
|
||||||
|
|
Loading…
Reference in a new issue