stabilizing

This commit is contained in:
nek0 2016-12-29 20:15:09 +01:00
parent 84b1a86f22
commit 18f61d37af
2 changed files with 17 additions and 16 deletions

View file

@ -46,7 +46,7 @@ drawRect node color Fill rect@GeglRectangle{..} buf = do
, G.Property "color" $ G.PropertyColor color
]
diw <- liftIO $ G.gegl_node_connect_to opNode "output" node "input"
unless diw $ error "Affection.Draw.drawRect': connect failed"
unless diw $ error "Affection.Draw.drawRect: connect failed"
put $ ad
{ drawStack = (DrawRequest rect buf (Kill (Just tempRoot))) : drawStack ad
}

View file

@ -39,21 +39,21 @@ updateParticle time funct pa = do
now <- elapsedTime <$> get
if particleCreation pa + particleTimeToLive pa < now
then do
mproducer <- liftIO $ G.gegl_node_get_producer
(particleStackCont pa)
"input"
case mproducer of
Just (producer, padname) -> do
consumers <- liftIO $ G.gegl_node_get_consumers
(particleStackCont pa)
"output"
liftIO $ mapM_ (\(node, inpad)-> G.gegl_node_connect_to
producer
padname
node
inpad
) consumers
Nothing -> return ()
-- mproducer <- liftIO $ G.gegl_node_get_producer
-- (particleStackCont pa)
-- "input"
-- case mproducer of
-- Just (producer, padname) -> do
-- consumers <- liftIO $ G.gegl_node_get_consumers
-- (particleStackCont pa)
-- "output"
-- liftIO $ mapM_ (\(node, inpad)-> G.gegl_node_connect_to
-- producer
-- padname
-- node
-- inpad
-- ) consumers
-- Nothing -> return ()
liftIO $ G.gegl_node_drop $ particleRootNode pa
return $ Nothing
else do
@ -119,6 +119,7 @@ updateParticleSystem sys sec upd draw = do
x <- catMaybes <$> mapM (updateParticle sec upd) (partStorList $ partSysParts sys)
-- x <- catMaybes <$> foldM (updateParticle sec upd) [] (reverse $ psParts sys)
when (not $ null x) $ do
liftIO $ G.gegl_node_link_many $ map particleStackCont (partStorList $ partSysParts sys)
-- liftIO $ traceIO "linking last node to output"
liftIO $ G.gegl_node_link (particleStackCont $ last x) (partSysNode sys)
mapM_ (draw (partSysBuffer sys) (partSysNode sys)) x