Use texture array for character rendering, condense rendering

This commit is contained in:
2023-03-23 14:08:07 +00:00
parent 68b43f29ff
commit 3350a8dc30
9 changed files with 80 additions and 42 deletions
+20
View File
@@ -17,9 +17,29 @@ fixedCoordPictures u = drawMenuOrHUD cfig u
<> drawConcurrentMessage u
<> customMouseCursor cfig (u ^. uvWorld . input)
<> listPicturesAt (halfWidth cfig) 0 cfig (map text (_uvTestString u u))
<> displayFrameTicks u
where
cfig = _uvConfig u
displayFrameTicks :: Universe -> Picture
displayFrameTicks u = if (debugOn Show_ms_frame $ _uvConfig u) then
( setDepth (-1)
. translate (-0.5) (-0.8)
. scale 0.0005 0.0005
$ fpsText (u ^. uvFrameTicks - u ^. uvLastFrameTicks)
)
else mempty
fpsText :: (Show a, Ord a, Num a) => a -> Picture
fpsText x = color col $ text $ "ms/frame " ++ show x
where
col
| x < 22 = blue
| x < 30 = green
| x < 40 = yellow
| x < 50 = orange
| otherwise = red
drawMenuOrHUD :: Configuration -> Universe -> Picture
drawMenuOrHUD cfig u = case u ^. uvScreenLayers of
[] -> drawHUD (u ^. uvConfig) (u ^. uvWorld)