Refactor window size, update selection cursor on new screen

This commit is contained in:
2023-03-25 09:27:27 +00:00
parent 20c05be23f
commit ea0c942887
57 changed files with 346 additions and 310 deletions
+24 -10
View File
@@ -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 =