Fix laser targeting draw when creature offscreen
This commit is contained in:
@@ -28,7 +28,8 @@ import qualified SDL
|
||||
{- Update the screen camera rotation and position, including any in rold scope/remote camera modifiers;
|
||||
update where your avatar's view is from. -}
|
||||
updateCamera :: Configuration -> World -> World
|
||||
updateCamera cfig = rotateCamera cfig . autoZoomCamera cfig . moveCamera . updateScopeZoom
|
||||
updateCamera cfig = rotateCamera cfig . setViewDistance cfig
|
||||
. autoZoomCamera cfig . moveCamera . updateScopeZoom
|
||||
{- Updte the center of the screen camera center and where your avatar's view is from in world. -}
|
||||
moveCamera :: World -> World
|
||||
moveCamera w = w
|
||||
@@ -169,6 +170,10 @@ autoZoomCamera cfig w = w & cameraZoom %~ changeZoom
|
||||
zoomOutSpeed = 15
|
||||
theScopeZoom = fromMaybe 1 $ yourItem w ^? _Just . itScope . scopeZoom
|
||||
|
||||
setViewDistance :: Configuration -> World -> World
|
||||
setViewDistance cfig w = w & viewDistance
|
||||
.~ sqrt (halfWidth cfig ** 2 + halfHeight cfig ** 2) / _cameraZoom w
|
||||
|
||||
farWallDist :: Point2 -> Configuration -> World -> Float
|
||||
farWallDist p cfig w = (winFac /) . min maxViewDistance $ ssfold (> maxViewDistance) findMax 1 vps
|
||||
where
|
||||
|
||||
Reference in New Issue
Block a user