This commit is contained in:
2023-03-24 12:06:54 +00:00
parent d524a14da4
commit bd9f32875e
7 changed files with 21 additions and 36 deletions
+3 -5
View File
@@ -2,9 +2,7 @@ module Dodge.WindowSize where
import Dodge.Data.Config
getWindowSize :: Configuration -> (Int, Int)
getWindowSize cfig = (x `div` divRes,y `div` divRes)
getWindowSize :: Integral a => (Configuration -> ResFactor) -> Configuration -> (a,a)
getWindowSize f cfig = (g _windowX,g _windowY)
where
x = round $ _windowX cfig
y = round $ _windowY cfig
divRes = resFactorNum $ _graphics_world_resolution cfig
g h = fromIntegral $ round (h cfig) `div` resFactorNum (f cfig)