fixed dumb MargaretImgAllocator bug

This commit is contained in:
Андреев Григорий 2026-01-01 03:09:46 +03:00
parent dd2d3c6575
commit 91f6b8e2f6

View File

@ -3,7 +3,14 @@ import Geom
import Control.Monad (forM_, when)
import Data.Char (ord)
import Data.IORef (newIORef, readIORef, writeIORef, modifyIORef)
import Data.Word(Word32, Word64)
lucyFaceAddGlyphRange :: LucyFaceFixedSize -> Char -> Char -> IO ()
lucyFaceAddGlyphRange ffs a b = lucyFaceAddGlyphs ffs A (B - A + 1) where
A = ((fromIntegral $ ord a) :: Word32)
B = ((fromIntegral $ ord b) :: Word32)
-- Game configurable
goodColorOfCube :: (Integral a) => a -> Vec3
goodColorOfCube i = ((Vec3 100 0 0) ^*^ t) ^+^ ((Vec3 0 50 90) ^*^ (1 - t)) where t = ((fromIntegral i :: Float) / 4)
@ -34,6 +41,7 @@ main = do
face <- aliceNewLucyFace alice "src/l3/fonts/DMSerifText-Regular.ttf"
faceOf40 <- aliceLucyFaceOfSize face 40
lucyFaceAddGlyphs faceOf40 32 (126 - 32 + 1)
lucyFaceAddGlyphs faceOf40 (fromIntegral) (126 - 32 + 1)
aliceAddText alice faceOf40 (Vec4 1 1 0 1) "Privet" 100 200
weirdStructure <- aliceAddGenericMeshHand alice "gen/l2/models/log_10_2_6.AliceGenericMesh"
@ -67,6 +75,7 @@ main = do
heroPos <- newIORef (Vec2 0 0)
puckRotation <- newIORef (0 :: Float)
-- Create the Callbacks structure.
let callbacks = Callbacks myonKeyboardKey myonAnotherFrame where
myonKeyboardKey keysym keyAction = do