Rethink item ammo to item consumables, start item type datatype

This commit is contained in:
2021-11-29 16:22:31 +00:00
parent 3a605b8156
commit f40d486d68
31 changed files with 238 additions and 193 deletions
+12
View File
@@ -15,3 +15,15 @@ sideEffectUpdatePreload :: Int -> Int -> Int -> (Universe -> IO Universe) -> Uni
sideEffectUpdatePreload divRes x y f u = do
pdata <- pdataResizeUpdate (x `div` divRes) (y `div` divRes) x y (_preloadData u)
f $ u & preloadData .~ pdata
updatePreload :: Int -> Int -> Int -> Universe -> IO Universe
updatePreload divRes x y u = do
pdata <- pdataResizeUpdate (x `div` divRes) (y `div` divRes) x y (_preloadData u)
return $ u & preloadData .~ pdata
updateFramebufferSize :: Universe -> IO Universe
updateFramebufferSize u = updatePreload divRes x y u
where
(x,y) = (round $ _windowX cfig, round $ _windowY cfig)
cfig = _config u
divRes = resFactorNum $ u ^. config . resolution_factor