Cleanup, stop drawing space characters

This commit is contained in:
2023-05-19 18:24:53 +01:00
parent 448669cd83
commit 03b793802f
5 changed files with 9 additions and 14 deletions
+3 -1
View File
@@ -329,7 +329,9 @@ stringToList gap = concatMap (uncurry charToTuple) . zip [0, 100 + gap ..]
charToTuple :: Float -> Char -> [(Point3, Point4, Point3)]
{-# INLINE charToTuple #-}
charToTuple xoff c = [f 0 0, f 1 0, f 1 1, f 0 0, f 1 1, f 0 1]
charToTuple xoff c
| fromEnum c == 32 = [] -- don't draw space characters
| otherwise = [f 0 0, f 1 0, f 1 1, f 0 0, f 1 1, f 0 1]
where
f x y = (V3 (xoff + x * 100) (y * 200) 0, white, V3 x (1 - y) charnum)
-- textures in opengl have origins at the lower left, my char array has its