Optimisation

Little optimisation by Michael Vogel, see https://www.purebasic.fr/english/viewtopic.php?p=523247#p523247
This commit is contained in:
djes
2018-06-11 23:23:48 +02:00
parent 55bc5c8f78
commit 864d1e33f5

View File

@@ -515,7 +515,7 @@ Module PBMap
Protected *PBMap.PBMap = PBMaps(Str(MapGadget)) Protected *PBMap.PBMap = PBMaps(Str(MapGadget))
Protected n.d = *PBMap\TileSize * Pow(2.0, Zoom) Protected n.d = *PBMap\TileSize * Pow(2.0, Zoom)
; Ensures the longitude to be in the range [-180; 180[ ; Ensures the longitude to be in the range [-180; 180[
*Location\Longitude = Mod(Mod(*Coords\x / n * 360.0, 360.0) + 360.0, 360.0) - 180 *Location\Longitude = Mod((1 + *Coords\x / n) * 360, 360) - 180 ; Mod(Mod(*Coords\x / n * 360.0, 360.0) + 360.0, 360.0) - 180
*Location\Latitude = Degree(ATan(SinH(#PI * (1.0 - 2.0 * *Coords\y / n)))) *Location\Latitude = Degree(ATan(SinH(#PI * (1.0 - 2.0 * *Coords\y / n))))
If *Location\Latitude <= -89 If *Location\Latitude <= -89
*Location\Latitude = -89 *Location\Latitude = -89
@@ -3141,9 +3141,9 @@ CompilerIf #PB_Compiler_IsMainFile
CompilerEndIf CompilerEndIf
; IDE Options = PureBasic 5.61 (Windows - x64) ; IDE Options = PureBasic 5.61 (Windows - x86)
; CursorPosition = 2751 ; CursorPosition = 517
; FirstLine = 2744 ; FirstLine = 513
; Folding = --------------------- ; Folding = ---------------------
; EnableThread ; EnableThread
; EnableXP ; EnableXP