gloss-raster-massiv 0.1.0.2 → 0.1.0.3
raw patch · 3 files changed
+12/−4 lines, 3 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
Files
- CHANGELOG.md +4/−0
- gloss-raster-massiv.cabal +1/−1
- src/Graphics/Gloss/Raster/Array.hs +7/−3
CHANGELOG.md view
@@ -12,3 +12,7 @@ ## 0.1.0.2 -- 2023-07-25 * Added homepage and bug-reports fields to the cabal file.++## 0.1.0.3 -- 2023-07-25++* Fixed bug with makeFrame function in Graphics.Gloss.Raster.Array.
gloss-raster-massiv.cabal view
@@ -20,7 +20,7 @@ -- PVP summary: +-+------- breaking API changes -- | | +----- non-breaking API additions -- | | | +--- code changes with no API change-version: 0.1.0.2+version: 0.1.0.3 -- A short (one-line) description of the package. synopsis: Massiv-based alternative for gloss-raster
src/Graphics/Gloss/Raster/Array.hs view
@@ -188,18 +188,22 @@ -- Define the image, and extract out just the RGB color components. -- We don't need the alpha because we're only drawing one image. traceEventIO "Gloss.Raster.Massiv[makeFrame]: start frame evaluation."- let arrRGB = DMA.map convColor array :: Array DMA.D Ix2 Word32+ (arrRGB :: Array DMA.S Ix2 Word32) <- DMA.traversePrim (\x -> return $ convColor x) array traceEventIO "Gloss.Raster.Massiv[makeFrame]: done, returning picture." + let arrRGBC = unsafeCoerce arrRGB :: Array DMA.S Ix2 Word8+ let arrRGBCFP = (\(a,_) -> a) $+ DMAU.unsafeArrayToForeignPtr arrRGBC -- Wrap the ForeignPtr from the Array as a gloss picture. let picture = Scale (fromIntegral scaleX) (fromIntegral scaleY) $ bitmapOfForeignPtr sizeX sizeY -- raw image size (BitmapFormat BottomToTop PxABGR)- ((\(a,_) -> a) $ DMAU.unsafeArrayToForeignPtr $ (unsafeCoerce arrRGB :: Array DMA.S Ix2 Word8)) - -- the image data.+ arrRGBCFP -- the image data. False -- don't cache this in texture memory.++ _ <- print "picture success" return picture {-# INLINE makeFrame #-}