a little optimization

This commit is contained in:
nek0 2017-02-22 18:03:16 +01:00
parent a028bb4204
commit 379a571147

View file

@ -117,8 +117,10 @@ 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)
then do
-- liftIO $ G.gegl_node_link_many $ map particleStackCont (partStorList $ partSysParts sys) -- liftIO $ G.gegl_node_link_many $ map particleStackCont (partStorList $ partSysParts sys)
-- liftIO $ traceIO "linking last node to output" -- liftIO $ traceIO "linking last node to output"
liftIO $ G.gegl_node_link (particleStackCont $ head x) (partSysNode sys) liftIO $ G.gegl_node_link (particleStackCont $ head x) (partSysNode sys)
@ -132,6 +134,8 @@ updateParticleSystem sys sec upd draw = do
else partStorLatest (partSysParts sys) 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