Refactor window size, update selection cursor on new screen
This commit is contained in:
@@ -24,7 +24,7 @@ import Data.Graph.Inductive
|
||||
|
||||
data CWorld = CWorld
|
||||
{ _lWorld :: LWorld
|
||||
, _camPos :: CamPos
|
||||
, _cwCamPos :: CamPos
|
||||
, _cwGen :: CWGen
|
||||
, _cClock :: Int
|
||||
, _pastWorlds :: [LWorld]
|
||||
|
||||
+24
-10
@@ -46,8 +46,8 @@ data Configuration = Configuration
|
||||
, _graphics_world_resolution :: ResFactor
|
||||
, _graphics_overlay_resolution :: ResFactor
|
||||
, _graphics_num_shadow_casters :: NumShadowCasters
|
||||
, _windowX :: Float
|
||||
, _windowY :: Float
|
||||
, _windowX :: Int
|
||||
, _windowY :: Int
|
||||
, _windowPosX :: Int
|
||||
, _windowPosY :: Int
|
||||
, _gameplay_rotate_to_wall :: Bool
|
||||
@@ -56,6 +56,11 @@ data Configuration = Configuration
|
||||
}
|
||||
deriving (Show)
|
||||
|
||||
windowXFloat :: Configuration -> Float
|
||||
windowXFloat = fromIntegral . _windowX
|
||||
windowYFloat :: Configuration -> Float
|
||||
windowYFloat = fromIntegral . _windowY
|
||||
|
||||
data DebugBool
|
||||
= Show_ms_frame
|
||||
| Show_debug
|
||||
@@ -85,7 +90,7 @@ data DebugBool
|
||||
| Show_path_between
|
||||
deriving (Eq, Ord, Bounded, Enum, Show)
|
||||
|
||||
data ResFactor = FullRes | HalfRes | QuarterRes | EighthRes | SixteenthRes
|
||||
data ResFactor = DoubleRes | FullRes | HalfRes | QuarterRes | EighthRes | SixteenthRes
|
||||
deriving (Show, Eq, Ord, Enum, Bounded)
|
||||
|
||||
data ShadowRendering
|
||||
@@ -99,13 +104,22 @@ data ShadowRendering
|
||||
data RoomClipping = NoRoomClipBoundaries | AllRoomClipBoundaries | IntersectingRoomClipBoundaries
|
||||
deriving (Show, Eq, Ord, Enum, Bounded)
|
||||
|
||||
resFactorNum :: ResFactor -> Int
|
||||
resFactorNum rf = case rf of
|
||||
FullRes -> 1
|
||||
HalfRes -> 2
|
||||
QuarterRes -> 4
|
||||
EighthRes -> 8
|
||||
SixteenthRes -> 16
|
||||
applyResFactor :: ResFactor -> Int -> Int
|
||||
applyResFactor rf = case rf of
|
||||
DoubleRes -> (2*)
|
||||
FullRes -> id
|
||||
HalfRes -> (`div` 2)
|
||||
QuarterRes -> (`div` 4)
|
||||
EighthRes -> (`div` 8)
|
||||
SixteenthRes -> (`div` 16)
|
||||
|
||||
--resFactorNum :: ResFactor -> Int
|
||||
--resFactorNum rf = case rf of
|
||||
-- FullRes -> 1
|
||||
-- HalfRes -> 2
|
||||
-- QuarterRes -> 4
|
||||
-- EighthRes -> 8
|
||||
-- SixteenthRes -> 16
|
||||
|
||||
defaultConfig :: Configuration
|
||||
defaultConfig =
|
||||
|
||||
@@ -14,7 +14,7 @@ data PressType = InitialPress
|
||||
deriving (Eq,Show)
|
||||
|
||||
data Input = Input
|
||||
{ _mousePos :: Point2
|
||||
{ _mousePos :: Point2 -- in pixels, from the center of the screen
|
||||
, _mouseMoving :: Bool
|
||||
, _pressedKeys :: M.Map Scancode PressType
|
||||
, _mouseButtons :: M.Map MouseButton Bool -- shortpress False, repeatpress True
|
||||
|
||||
@@ -66,6 +66,7 @@ data ScreenLayer
|
||||
, _scSelectionList :: SelectionList (Universe -> Universe,Universe->Universe)
|
||||
, _scAvailableLines :: Int
|
||||
, _scListDisplayParams :: ListDisplayParams
|
||||
, _scDisplayTime :: Int
|
||||
}
|
||||
| InputScreen
|
||||
{ _scInput :: String
|
||||
|
||||
Reference in New Issue
Block a user