removing old code
This commit is contained in:
parent
7a953b0a8b
commit
29183fb223
1 changed files with 25 additions and 55 deletions
|
@ -36,61 +36,31 @@ updateParticle
|
||||||
-- -> Affection us [Maybe Particle]
|
-- -> Affection us [Maybe Particle]
|
||||||
-> Affection us (Maybe Particle)
|
-> Affection us (Maybe Particle)
|
||||||
-- ^ resulting 'Particle'
|
-- ^ resulting 'Particle'
|
||||||
updateParticle time funct pa = do
|
updateParticle time funct pa =
|
||||||
now <- elapsedTime <$> get
|
do
|
||||||
if particleCreation pa + particleTimeToLive pa < now
|
now <- elapsedTime <$> get
|
||||||
then do
|
if particleCreation pa + particleTimeToLive pa < now
|
||||||
mproducer <- liftIO $ G.gegl_node_get_producer
|
then do
|
||||||
(particleStackCont pa)
|
mproducer <- liftIO $ G.gegl_node_get_producer
|
||||||
"input"
|
(particleStackCont pa)
|
||||||
case mproducer of
|
"input"
|
||||||
Just (producer, padname) -> do
|
case mproducer of
|
||||||
consumers <- liftIO $ G.gegl_node_get_consumers
|
Just (producer, padname) -> do
|
||||||
(particleStackCont pa)
|
consumers <- liftIO $ G.gegl_node_get_consumers
|
||||||
"output"
|
(particleStackCont pa)
|
||||||
liftIO $ mapM_ (\(node, inpad)-> G.gegl_node_connect_to
|
"output"
|
||||||
producer
|
liftIO $ mapM_ (\(node, inpad)-> G.gegl_node_connect_to
|
||||||
padname
|
producer
|
||||||
node
|
padname
|
||||||
inpad
|
node
|
||||||
) consumers
|
inpad
|
||||||
Nothing -> return ()
|
) consumers
|
||||||
liftIO $ G.gegl_node_drop $ particleRootNode pa
|
Nothing -> return ()
|
||||||
return $ Nothing
|
liftIO $ G.gegl_node_drop $ particleRootNode pa
|
||||||
else do
|
return $ Nothing
|
||||||
np <- Just <$> funct time pa
|
else do
|
||||||
return $ np
|
np <- Just <$> funct time pa
|
||||||
-- updateParticle time funct acc@[p] pa = do
|
return $ np
|
||||||
-- now <- elapsedTime <$> get
|
|
||||||
-- if particleCreation pa + particleTimeToLive pa > now
|
|
||||||
-- then do
|
|
||||||
-- liftIO $ G.gegl_node_drop $ particleRootNode pa
|
|
||||||
-- return $ Nothing : acc
|
|
||||||
-- else do
|
|
||||||
-- when (not $ isNothing p) $ do
|
|
||||||
-- -- liftIO $ traceIO "linking second node in list"
|
|
||||||
-- liftIO $ G.gegl_node_link
|
|
||||||
-- (particleStackCont pa)
|
|
||||||
-- (particleStackCont $ fromJust p)
|
|
||||||
-- np <- Just <$> funct time pa
|
|
||||||
-- return $ np : acc
|
|
||||||
-- updateParticle time funct acc@(p:ps) pa = do
|
|
||||||
-- now <- elapsedTime <$> get
|
|
||||||
-- if particleCreation pa + particleTimeToLive pa > now
|
|
||||||
-- then do
|
|
||||||
-- liftIO $ G.gegl_node_drop $ particleRootNode pa
|
|
||||||
-- return $ Nothing : acc
|
|
||||||
-- else do
|
|
||||||
-- when (isNothing p) $ do
|
|
||||||
-- let mnl = nextLiving ps
|
|
||||||
-- maybe
|
|
||||||
-- (return ())
|
|
||||||
-- (\nl -> do
|
|
||||||
-- -- liftIO $ traceIO "linking nth node on list"
|
|
||||||
-- liftIO $ G.gegl_node_link (particleStackCont pa) (particleStackCont nl))
|
|
||||||
-- mnl
|
|
||||||
-- np <- Just <$> funct time pa
|
|
||||||
-- return $ np : acc
|
|
||||||
|
|
||||||
-- | Get the next living particle from a list
|
-- | Get the next living particle from a list
|
||||||
nextLiving
|
nextLiving
|
||||||
|
|
Loading…
Reference in a new issue