|
@@ -1,7 +1,8 @@
|
|
|
extends Node
|
|
|
|
|
|
+var Downloader = preload("res://downloader.gd")
|
|
|
|
|
|
-var datafile = "user://sldem2015_512_00n_30n_000_045_float.img"
|
|
|
+var datafile = "height/SLDEM2015_512_30N_60N_000_045_FLOAT.IMG"
|
|
|
var samplesPerLine = 23040
|
|
|
var lines = 15360
|
|
|
var offset = 1737.4
|
|
@@ -19,7 +20,12 @@ var file: File
|
|
|
# Called when the node enters the scene tree for the first time.
|
|
|
func open():
|
|
|
file = File.new()
|
|
|
- file.open(datafile, File.READ)
|
|
|
+ if not file.file_exists("user://"+datafile):
|
|
|
+ var downloader = Downloader.new()
|
|
|
+ add_child(downloader)
|
|
|
+ downloader.load(datafile, "height")
|
|
|
+ yield(downloader, "request_completed")
|
|
|
+ file.open("user://"+datafile, File.READ)
|
|
|
|
|
|
func close():
|
|
|
file.close()
|