sdl2 2.5.3.2 → 2.5.3.3
raw patch · 5 files changed
+39/−46 lines, 5 files
Files
- ChangeLog.md +5/−0
- sdl2.cabal +2/−2
- src/SDL/Input/Mouse.hs +5/−17
- src/SDL/Raw/Types.hsc +26/−26
- src/SDL/Video/Renderer.hs +1/−1
ChangeLog.md view
@@ -1,3 +1,8 @@+2.5.3.3+=======++* Alignment in hsc files is now provided by hsc2c.+ 2.5.3.2 =======
sdl2.cabal view
@@ -1,5 +1,5 @@ name: sdl2-version: 2.5.3.2+version: 2.5.3.3 synopsis: Both high- and low-level bindings to the SDL library (version 2.0.6+). description: This package contains bindings to the SDL 2 library, in both high- and@@ -142,7 +142,7 @@ exceptions >= 0.4 && < 0.11, StateVar >= 1.1.0.0 && < 1.3, text >= 1.1.0.0 && < 2.1,- transformers >= 0.2 && < 0.6,+ transformers >= 0.2 && < 0.7, vector >= 0.10.9.0 && < 0.13 if flag(no-linear)
src/SDL/Input/Mouse.hs view
@@ -258,32 +258,20 @@ -- | Create a cursor using the specified bitmap data and mask (in MSB format). ----- Use binary literals to set the masks: ----- @--- box8x8 =--- [ 0b11111111--- , 0b10000001--- , 0b10000001--- , 0b10000001--- , 0b10000001--- , 0b10000001--- , 0b10000001--- , 0b11111111--- ]--- @ createCursor :: MonadIO m- => V.Vector Word8 -- ^ Whether this part of the cursor is black. Use 'False' for white and 'True' for black.- -> V.Vector Word8 -- ^ Whether or not pixels are visible. Use 'True' for visible and 'False' for transparent.+ => V.Vector Bool -- ^ Whether this part of the cursor is black. Use 'False' for white and 'True' for black.+ -> V.Vector Bool -- ^ Whether or not pixels are visible. Use 'True' for visible and 'False' for transparent. -> V2 CInt -- ^ The width and height of the cursor. -> Point V2 CInt -- ^ The X- and Y-axis location of the upper left corner of the cursor relative to the actual mouse position -> m Cursor createCursor dta msk (V2 w h) (P (V2 hx hy)) = liftIO . fmap Cursor $ throwIfNull "SDL.Input.Mouse.createCursor" "SDL_createCursor" $- V.unsafeWith dta $ \unsafeDta ->- V.unsafeWith msk $ \unsafeMsk ->+ V.unsafeWith (V.map (bool 0 1) dta) $ \unsafeDta ->+ V.unsafeWith (V.map (bool 0 1) msk) $ \unsafeMsk -> Raw.createCursor unsafeDta unsafeMsk w h hx hy+ -- | Free a cursor created with 'createCursor', 'createColorCusor' and 'createSystemCursor'. --
src/SDL/Raw/Types.hsc view
@@ -162,7 +162,7 @@ instance Storable Atomic where sizeOf _ = (#size SDL_atomic_t)- alignment = sizeOf+ alignment _ = (#alignment SDL_atomic_t) peek ptr = do value <- (#peek SDL_atomic_t, value) ptr return $! Atomic value@@ -183,7 +183,7 @@ instance Storable AudioCVT where sizeOf _ = (#size SDL_AudioCVT)- alignment = sizeOf+ alignment _ = (#alignment SDL_AudioCVT) peek ptr = do needed <- (#peek SDL_AudioCVT, needed) ptr src_format <- (#peek SDL_AudioCVT, src_format) ptr@@ -219,7 +219,7 @@ instance Storable AudioSpec where sizeOf _ = (#size SDL_AudioSpec)- alignment = sizeOf+ alignment _ = (#alignment SDL_AudioSpec) peek ptr = do freq <- (#peek SDL_AudioSpec, freq) ptr format <- (#peek SDL_AudioSpec, format) ptr@@ -249,7 +249,7 @@ instance Storable Color where sizeOf _ = (#size SDL_Color)- alignment = sizeOf+ alignment _ = (#alignment SDL_Color) peek ptr = do r <- (#peek SDL_Color, r) ptr g <- (#peek SDL_Color, g) ptr@@ -272,7 +272,7 @@ instance Storable DisplayMode where sizeOf _ = (#size SDL_DisplayMode)- alignment = sizeOf+ alignment _ = (#alignment SDL_DisplayMode) peek ptr = do format <- (#peek SDL_DisplayMode, format) ptr w <- (#peek SDL_DisplayMode, w) ptr@@ -477,7 +477,7 @@ instance Storable Event where sizeOf _ = (#size SDL_Event)- alignment _ = 16+ alignment _ = (#alignment SDL_Event) peek ptr = do typ <- (#peek SDL_Event, common.type) ptr timestamp <- (#peek SDL_Event, common.timestamp) ptr@@ -815,7 +815,7 @@ instance Storable Finger where sizeOf _ = (#size SDL_Finger)- alignment = sizeOf+ alignment _ = (#alignment SDL_Finger) peek ptr = do fingerId <- (#peek SDL_Finger, id) ptr x <- (#peek SDL_Finger, x) ptr@@ -844,7 +844,7 @@ instance Storable GameControllerButtonBind where sizeOf _ = (#size SDL_GameControllerButtonBind)- alignment = sizeOf+ alignment _ = (#alignment SDL_GameControllerButtonBind) peek ptr = do bind_type <- (#peek SDL_GameControllerButtonBind, bindType) ptr case bind_type :: (#type SDL_GameControllerBindType) of@@ -884,7 +884,7 @@ instance Storable HapticDirection where sizeOf _ = (#size SDL_HapticDirection)- alignment = sizeOf+ alignment _ = (#alignment SDL_HapticDirection) peek ptr = do typ <- (#peek SDL_HapticDirection, type) ptr x <- (#peek SDL_HapticDirection, dir[0]) ptr@@ -980,7 +980,7 @@ instance Storable HapticEffect where sizeOf _ = (#size SDL_HapticEffect)- alignment = sizeOf+ alignment _ = (#alignment SDL_HapticEffect) peek ptr = do typ <- (#peek SDL_HapticEffect, type) ptr case typ of@@ -1152,7 +1152,7 @@ instance Storable JoystickGUID where sizeOf _ = (#size SDL_JoystickGUID)- alignment = sizeOf+ alignment _ = (#alignment SDL_JoystickGUID) peek ptr = do guid <- peekArray 16 $ (#ptr SDL_JoystickGUID, data) ptr return $! JoystickGUID guid@@ -1167,7 +1167,7 @@ instance Storable Keysym where sizeOf _ = (#size SDL_Keysym)- alignment = sizeOf+ alignment _ = (#alignment SDL_Keysym) peek ptr = do scancode <- (#peek SDL_Keysym, scancode) ptr sym <- (#peek SDL_Keysym, sym) ptr@@ -1186,7 +1186,7 @@ instance Storable MessageBoxButtonData where sizeOf _ = (#size SDL_MessageBoxButtonData)- alignment = sizeOf+ alignment _ = (#alignment SDL_MessageBoxButtonData) peek ptr = do flags <- (#peek SDL_MessageBoxButtonData, flags) ptr buttonid <- (#peek SDL_MessageBoxButtonData, buttonid) ptr@@ -1205,7 +1205,7 @@ instance Storable MessageBoxColor where sizeOf _ = (#size SDL_MessageBoxColor)- alignment = sizeOf+ alignment _ = (#alignment SDL_MessageBoxColor) peek ptr = do r <- (#peek SDL_MessageBoxColor, r) ptr g <- (#peek SDL_MessageBoxColor, g) ptr@@ -1226,7 +1226,7 @@ instance Storable MessageBoxColorScheme where sizeOf _ = (#size SDL_MessageBoxColorScheme)- alignment = sizeOf+ alignment _ = (#alignment SDL_MessageBoxColorScheme) peek ptr = do background <- (#peek SDL_MessageBoxColorScheme, colors[SDL_MESSAGEBOX_COLOR_BACKGROUND]) ptr text <- (#peek SDL_MessageBoxColorScheme, colors[SDL_MESSAGEBOX_COLOR_TEXT]) ptr@@ -1253,7 +1253,7 @@ instance Storable MessageBoxData where sizeOf _ = (#size SDL_MessageBoxData)- alignment = sizeOf+ alignment _ = (#alignment SDL_MessageBoxData) peek ptr = do flags <- (#peek SDL_MessageBoxData, flags) ptr window <- (#peek SDL_MessageBoxData, window) ptr@@ -1279,7 +1279,7 @@ instance Storable Palette where sizeOf _ = (#size SDL_Palette)- alignment = sizeOf+ alignment _ = (#alignment SDL_Palette) peek ptr = do ncolors <- (#peek SDL_Palette, ncolors) ptr colors <- (#peek SDL_Palette, colors) ptr@@ -1301,7 +1301,7 @@ instance Storable PixelFormat where sizeOf _ = (#size SDL_PixelFormat)- alignment = sizeOf+ alignment _ = (#alignment SDL_PixelFormat) peek ptr = do format <- (#peek SDL_PixelFormat, format) ptr palette <- (#peek SDL_PixelFormat, palette) ptr@@ -1329,7 +1329,7 @@ instance Storable Point where sizeOf _ = (#size SDL_Point)- alignment = sizeOf+ alignment _ = (#alignment SDL_Point) peek ptr = do x <- (#peek SDL_Point, x) ptr y <- (#peek SDL_Point, y) ptr@@ -1347,7 +1347,7 @@ instance Storable Rect where sizeOf _ = (#size SDL_Rect)- alignment = sizeOf+ alignment _ = (#alignment SDL_Rect) peek ptr = do x <- (#peek SDL_Rect, x) ptr y <- (#peek SDL_Rect, y) ptr@@ -1369,7 +1369,7 @@ instance Storable FPoint where sizeOf _ = (#size SDL_FPoint)- alignment = sizeOf+ alignment _ = (#alignment SDL_FPoint) peek ptr = do x <- (#peek SDL_FPoint, x) ptr y <- (#peek SDL_FPoint, y) ptr@@ -1387,7 +1387,7 @@ instance Storable FRect where sizeOf _ = (#size SDL_FRect)- alignment = sizeOf+ alignment _ = (#alignment SDL_FRect) peek ptr = do x <- (#peek SDL_FRect, x) ptr y <- (#peek SDL_FRect, y) ptr@@ -1413,7 +1413,7 @@ instance Storable RendererInfo where sizeOf _ = (#size SDL_RendererInfo)- alignment = sizeOf+ alignment _ = (#alignment SDL_RendererInfo) peek ptr = do name <- (#peek SDL_RendererInfo, name) ptr flags <- (#peek SDL_RendererInfo, flags) ptr@@ -1441,7 +1441,7 @@ instance Storable RWops where sizeOf _ = (#size SDL_RWops)- alignment = sizeOf+ alignment _ = (#alignment SDL_RWops) peek ptr = do size <- (#peek SDL_RWops, size) ptr seek <- (#peek SDL_RWops, seek) ptr@@ -1470,7 +1470,7 @@ instance Storable Surface where sizeOf _ = (#size SDL_Surface)- alignment = sizeOf+ alignment _ = (#alignment SDL_Surface) peek ptr = do format <- (#peek SDL_Surface, format) ptr w <- (#peek SDL_Surface, w) ptr@@ -1497,7 +1497,7 @@ instance Storable Version where sizeOf _ = (#size SDL_version)- alignment = sizeOf+ alignment _ = (#alignment SDL_version) peek ptr = do major <- (#peek SDL_version, major) ptr minor <- (#peek SDL_version, minor) ptr
src/SDL/Video/Renderer.hs view
@@ -580,7 +580,7 @@ instance Storable a => Storable (Rectangle a) where sizeOf ~(Rectangle o s) = sizeOf o + sizeOf s- alignment _ = 0+ alignment _ = alignment (undefined :: a) peek ptr = do o <- peek (castPtr ptr) s <- peek (castPtr (ptr `plusPtr` sizeOf o))