From 91f6b8e2f63498053752397fa114c7034ef8f972 Mon Sep 17 00:00:00 2001 From: Andreew Gregory Date: Thu, 1 Jan 2026 03:09:46 +0300 Subject: [PATCH] fixed dumb MargaretImgAllocator bug --- src/l3/r4/R4.hs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/l3/r4/R4.hs b/src/l3/r4/R4.hs index 9a620d0..94ef4c2 100644 --- a/src/l3/r4/R4.hs +++ b/src/l3/r4/R4.hs @@ -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