diff --git a/moduleFlow.dia b/moduleFlow.dia index b42527724..e9cca2216 100644 Binary files a/moduleFlow.dia and b/moduleFlow.dia differ diff --git a/src/Dodge/Rendering.hs b/src/Dodge/Rendering.hs index e6f53922b..a75699626 100644 --- a/src/Dodge/Rendering.hs +++ b/src/Dodge/Rendering.hs @@ -393,11 +393,6 @@ drawItemName w flIt | magV (_crPos (you w) -.- _flItPos flIt) < 100 nameOfItem = _itName $ _flIt flIt zoom = _cameraZoom w -ringPict :: Drawing -ringPict = onLayer LabelLayer $ dShadCol white $ pictures [line [(-8,10),(-15,10),(-15,-10),(-8,-10)] - ,line [( 8,10),( 15,10),( 15,-10),( 8,-10)] - ] - dShadCol :: Color -> Picture -> Picture dShadCol c p = pictures $ [ color black $ uncurry translate (1.2,-1.2) p diff --git a/src/Dodge/Update.hs b/src/Dodge/Update.hs index 211436eb4..e1c1e4f20 100644 --- a/src/Dodge/Update.hs +++ b/src/Dodge/Update.hs @@ -4,7 +4,7 @@ import Dodge.Data import Dodge.Base import Dodge.WallCreatureCollisions import Dodge.LevelGen.Block -import Dodge.Camera +import Dodge.Update.Camera import Dodge.SoundLogic import Dodge.Inventory diff --git a/src/Dodge/Camera.hs b/src/Dodge/Update/Camera.hs similarity index 92% rename from src/Dodge/Camera.hs rename to src/Dodge/Update/Camera.hs index 033c056e1..dd265d3c0 100644 --- a/src/Dodge/Camera.hs +++ b/src/Dodge/Update/Camera.hs @@ -1,4 +1,4 @@ -module Dodge.Camera where +module Dodge.Update.Camera where import Dodge.Data import Dodge.Base @@ -45,9 +45,6 @@ moveCamera w = w & cameraPos .~ idealPos sightFrom | isCam = camCenter | otherwise = ypos - - - updateScopeZoom :: World -> World updateScopeZoom w | SDL.ButtonRight `S.member` _mouseButtons w = case w ^? scppoint of @@ -122,16 +119,13 @@ zoomCamOut w | SDL.KeycodeK `S.member` _keys w = w {_cameraZoom = max (_cameraZoom w - 0.01) 0.01} | otherwise = w --- the 395 here limits the max zoom out, is 25 less than the current screen --- size, thus matches up with it zoomCam :: World -> World ---zoomCam w = w zoomCam w = over cameraZoom changeZoom w where maxViewDistance = 800 camPos = _cameraCenter w camRot = _cameraRot w - wallZoom = min (halfWidth w / (horizontalMax+10) ) - (halfHeight w / (verticalMax+10) ) + wallZoom = min (halfWidth w / (horizontalMax+50) ) + (halfHeight w / (verticalMax+50) ) idealZoom | SDL.ButtonRight `S.member` _mouseButtons w = scZoom * ( @@ -143,10 +137,13 @@ zoomCam w = over cameraZoom changeZoom w = min (fromMaybe 20 $ yourItem w ^? itZoom . itZoomMax) $ max (fromMaybe 0.2 (yourItem w ^? itZoom . itZoomMin)) (wallZoom * fromMaybe 1 (yourItem w ^? itZoom . itZoomFac)) - changeZoom curZoom | curZoom > idealZoom + 0.01 = 0.05 * (19*curZoom + idealZoom) - | curZoom < idealZoom - 0.01 = 0.05 * (19*curZoom + idealZoom) - | otherwise = idealZoom --- zs = take 20 [-maxViewDistance,0 - 0.9*maxViewDistance..] + changeZoom curZoom + | curZoom > idealZoom + 0.01 = ((zoomOutSpeed-1)*curZoom + idealZoom) / zoomOutSpeed + | curZoom < idealZoom - 0.01 = ((zoomInSpeed-1)*curZoom + idealZoom) / zoomInSpeed + | otherwise = idealZoom + -- these speeds are inverted, larger means slower + zoomInSpeed = 25 + zoomOutSpeed = 15 zs = take 9 [-maxViewDistance,0 - 0.8*maxViewDistance..] rRays = rotF [( maxViewDistance,y) | y <- zs] lRays = rotF [(-maxViewDistance,y) | y <- zs]