a little optimization
This commit is contained in:
parent
a028bb4204
commit
379a571147
1 changed files with 18 additions and 14 deletions
|
@ -117,21 +117,25 @@ updateParticleSystem
|
||||||
-> Affection us ParticleSystem
|
-> Affection us ParticleSystem
|
||||||
updateParticleSystem sys sec upd draw = do
|
updateParticleSystem sys sec upd draw = do
|
||||||
x <- catMaybes <$> mapM (updateParticle sec upd) (partStorList $ partSysParts sys)
|
x <- catMaybes <$> mapM (updateParticle sec upd) (partStorList $ partSysParts sys)
|
||||||
|
-- liftIO $ traceIO $ show $ length x
|
||||||
-- x <- catMaybes <$> foldM (updateParticle sec upd) [] (reverse $ psParts sys)
|
-- x <- catMaybes <$> foldM (updateParticle sec upd) [] (reverse $ psParts sys)
|
||||||
when (not $ null x) $ do
|
if (not $ null x)
|
||||||
-- liftIO $ G.gegl_node_link_many $ map particleStackCont (partStorList $ partSysParts sys)
|
then do
|
||||||
-- liftIO $ traceIO "linking last node to output"
|
-- liftIO $ G.gegl_node_link_many $ map particleStackCont (partStorList $ partSysParts sys)
|
||||||
liftIO $ G.gegl_node_link (particleStackCont $ head x) (partSysNode sys)
|
-- liftIO $ traceIO "linking last node to output"
|
||||||
mapM_ (draw (partSysBuffer sys) (partSysNode sys)) x
|
liftIO $ G.gegl_node_link (particleStackCont $ head x) (partSysNode sys)
|
||||||
return $ sys
|
mapM_ (draw (partSysBuffer sys) (partSysNode sys)) x
|
||||||
{ partSysParts = (partSysParts sys)
|
return $ sys
|
||||||
{ partStorList = x
|
{ partSysParts = (partSysParts sys)
|
||||||
, partStorLatest =
|
{ partStorList = x
|
||||||
if null x
|
, partStorLatest =
|
||||||
then Nothing
|
if null x
|
||||||
else partStorLatest (partSysParts sys)
|
then Nothing
|
||||||
}
|
else partStorLatest (partSysParts sys)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
return sys
|
||||||
|
|
||||||
-- | Function for inserting a new 'Particle' into its 'PartileSystem'
|
-- | Function for inserting a new 'Particle' into its 'PartileSystem'
|
||||||
insertParticle
|
insertParticle
|
||||||
|
|
Loading…
Reference in a new issue