mirror of
https://github.com/reanimate/reanimate.git
synced 2026-09-12 00:23:08 +00:00
Disable hashing for now.
This commit is contained in:
parent
4481f10ebf
commit
e369dbec36
1 changed files with 3 additions and 8 deletions
|
|
@ -64,20 +64,15 @@ renderSvgs :: FilePath -> Int -> Bool -> Animation -> IO ()
|
|||
renderSvgs folder offset _prettyPrint ani = do
|
||||
print frameCount
|
||||
lock <- newMVar ()
|
||||
hashedFrames <- newMVar M.empty
|
||||
handle errHandler $ concurrentForM_ (frameOrder rate frameCount) $ \nth' -> do
|
||||
let nth = (nth'+offset) `mod` frameCount
|
||||
now = (duration ani / (fromIntegral frameCount - 1)) * fromIntegral nth
|
||||
frame = frameAt (if frameCount <= 1 then 0 else now) ani
|
||||
path = folder </> show nth <.> "svg"
|
||||
cachedFrame <- M.lookup frame <$> readMVar hashedFrames
|
||||
~svg = renderSvg Nothing Nothing frame
|
||||
|
||||
idempotentFile path $
|
||||
case cachedFrame of
|
||||
Nothing -> do
|
||||
let svg = renderSvg Nothing Nothing frame
|
||||
writeFile path svg
|
||||
modifyMVar_ hashedFrames $ \hm -> pure $ M.insert frame path hm
|
||||
Just frameFile -> copyFile frameFile path
|
||||
writeFile path svg
|
||||
withMVar lock $ \_ -> do
|
||||
print nth
|
||||
hFlush stdout
|
||||
|
|
|
|||
Loading…
Reference in a new issue