Skip to content

Commit 67b2ff9

Browse files
committed
Remove deprecated mapRGB
1 parent 7bc2ff9 commit 67b2ff9

File tree

2 files changed

+3
-23
lines changed

2 files changed

+3
-23
lines changed

ChangeLog.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,9 @@
33

44
* Add `SDL.Exception` module, exposing `SDLException`
55
* Add joystick POV hat support
6-
* Remove deprecated `InitEverything` enumeration
6+
* Remove deprecated functionality:
7+
* `InitEverything` enumeration in `SDL.Init`
8+
* `mapRGB` in `SDL.Video.Renderer`
79
* Merge `isScreenSaverEnabled, `enableScreenSaver`, and `disableScreenSaver`
810
into a `screenSaverEnabled` StateVar.
911
* Fix issue with `setWindowMode` transitions not working properly between

src/SDL/Video/Renderer.hs

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,6 @@ module SDL.Video.Renderer
7676
, PixelFormat(..)
7777
, SurfacePixelFormat
7878
, formatPalette
79-
, mapRGB
8079
, setPaletteColors
8180
, pixelFormatToMasks
8281
, masksToPixelFormat
@@ -406,27 +405,6 @@ loadBMP filePath = liftIO $
406405
newtype SurfacePixelFormat = SurfacePixelFormat (Ptr Raw.PixelFormat)
407406
deriving (Eq, Typeable)
408407

409-
-- It's possible we could use unsafePerformIO here, but I'm not
410-
-- sure. De need to guarantee that pointers aren't reused?
411-
-- | Map an RGB triple to an opaque pixel value for a given pixel format.
412-
--
413-
-- This function maps the RGB color value to the specified pixel format and returns the pixel value best approximating the given RGB color value for the given pixel format.
414-
--
415-
-- If the format has a palette (8-bit) the index of the closest matching color in the palette will be returned.
416-
--
417-
-- If the specified pixel format has an alpha component it will be returned as all 1 bits (fully opaque).
418-
--
419-
-- If the pixel format bpp (color depth) is less than 32-bpp then the unused upper bits of the return value can safely be ignored (e.g., with a 16-bpp format the return value can be assigned to a 'Word16', and similarly a 'Word8' for an 8-bpp format).
420-
--
421-
-- See @<https://wiki.libsdl.org/SDL_MapRGB SDL_MapRGB>@ for C documentation.
422-
mapRGB :: MonadIO m
423-
=> SurfacePixelFormat -- ^ The format of the pixel
424-
-> V3 Word8 -- ^ The color to map
425-
-> m Word32
426-
mapRGB (SurfacePixelFormat fmt) (V3 r g b) = Raw.mapRGB fmt r g b
427-
428-
{-# DEPRECATED mapRGB "mapRGB is no longer needed, as it called implictly. If you still need this, use SDL.Raw.mapRGB" #-}
429-
430408
-- It's possible we could use unsafePerformIO here, but I'm not
431409
-- sure. surface->{w,h} are immutable, but do we need to guarantee that pointers
432410
-- aren't reused by *different* surfaces.

0 commit comments

Comments
 (0)