Ver código fonte

fix topoloader

Malf 2 anos atrás
pai
commit
0421572411
1 arquivos alterados com 3 adições e 3 exclusões
  1. 3 3
      TopoLoader.gd

+ 3 - 3
TopoLoader.gd

@@ -2,10 +2,10 @@ extends Node
 
 var Downloader = preload("res://downloader.gd")
 
-var datafile = "height/SLDEM2015_512_30N_60N_000_045_FLOAT.IMG"
+var datafile = "height/SLDEM2015_512_00N_30N_000_045_FLOAT.IMG"
 var samplesPerLine = 23040
 var lines = 15360
-var offset = 1737.4
+var offset = 1737.4#*1000
 var scaleFact = 1
 var resolution = 512
 
@@ -39,7 +39,7 @@ func cacheArea(latMinIN, latMaxIN, lonMinIN, lonMaxIN):
 	var lat = latMinIN
 	while lat <= latMaxIN:
 		cache[lat]={}
-		file.seek(lat*resolution*samplesPerLine*4 + lonMinIN*resolution*4)
+		file.seek((latMax*resolution*samplesPerLine*4 - lat*resolution*samplesPerLine*4) + lonMinIN*resolution*4)
 		var lon = lonMinIN
 		while lon <= lonMaxIN:
 			cache[lat][lon] = file.get_float()