Cleanup
This commit is contained in:
+7
-6
@@ -16,10 +16,10 @@ module Dodge.Event (
|
||||
) where
|
||||
|
||||
import Dodge.Concurrent
|
||||
import LensHelp
|
||||
import Dodge.Data.Universe
|
||||
import Dodge.Event.Input
|
||||
import Dodge.PreloadData
|
||||
import LensHelp
|
||||
import SDL
|
||||
|
||||
handleEvent :: Event -> Universe -> Universe
|
||||
@@ -40,7 +40,8 @@ handleEvent e u = case eventPayload e of
|
||||
|
||||
-- | Sets window position in config.
|
||||
handleWindowMoveEvent :: WindowMovedEventData -> Universe -> Universe
|
||||
handleWindowMoveEvent mev = (uvConfig . windowPosX .~ fromIntegral x)
|
||||
handleWindowMoveEvent mev =
|
||||
(uvConfig . windowPosX .~ fromIntegral x)
|
||||
. (uvConfig . windowPosY .~ fromIntegral y)
|
||||
where
|
||||
P (V2 x y) = windowMovedEventPosition mev
|
||||
@@ -51,10 +52,10 @@ handleWindowMoveEvent mev = (uvConfig . windowPosX .~ fromIntegral x)
|
||||
-- later may be a good idea
|
||||
handleResizeEvent :: WindowSizeChangedEventData -> Universe -> Universe
|
||||
handleResizeEvent sev u =
|
||||
u
|
||||
& uvConfig . windowX .~ fromIntegral x
|
||||
& uvConfig . windowY .~ fromIntegral y
|
||||
& uvIOEffects %~ sideEffectUpdatePreload divRes x y
|
||||
u
|
||||
& uvConfig . windowX .~ fromIntegral x
|
||||
& uvConfig . windowY .~ fromIntegral y
|
||||
& uvIOEffects %~ sideEffectUpdatePreload divRes x y
|
||||
where
|
||||
x = fromIntegral x'
|
||||
y = fromIntegral y'
|
||||
|
||||
Reference in New Issue
Block a user