From 112eff446280adbe9eaeec66c08296fad713e452 Mon Sep 17 00:00:00 2001 From: Inuyaksa Date: Sat, 13 Feb 2021 23:57:09 +0100 Subject: [PATCH] skip not visible ft tiles and minor range zoom out --- .../Instruments/ND/canvas/map/TERRAIN.symbol | 32 +++++++++++++------ 1 file changed, 23 insertions(+), 9 deletions(-) diff --git a/Models/Instruments/ND/canvas/map/TERRAIN.symbol b/Models/Instruments/ND/canvas/map/TERRAIN.symbol index 01668c33..48c384d9 100644 --- a/Models/Instruments/ND/canvas/map/TERRAIN.symbol +++ b/Models/Instruments/ND/canvas/map/TERRAIN.symbol @@ -67,15 +67,20 @@ var updateTerrain = func(r_scaled){ var tiles = me.tile_list; - var proj_lon = pos_lon + ((col * (range/30) * math.sin(DEG2RAD * (heading - 90))) / 30); - var proj_lat = pos_lat + ((col * (range/30) * math.cos(DEG2RAD * (heading - 90))) / 30); + var proj_lon = pos_lon + ((col * (range/30) * math.sin(DEG2RAD * (heading - 90))) / 40); + var proj_lat = pos_lat + ((col * (range/30) * math.cos(DEG2RAD * (heading - 90))) / 40); var elevft = []; - for (var row = 0; row <= len; row += 1) { + for (var row = 0; row < len; row += 1) { - var point_lon = proj_lon + ((row * (range/30) / 30) * math.sin(DEG2RAD * heading)); - var point_lat = proj_lat + ((row * (range/30) / 30) * math.cos(DEG2RAD * heading)); + if (trn[row] == nil) { + append(elevft,-1); + continue; + } + + var point_lon = proj_lon + ((row * (range/30) / 40) * math.sin(DEG2RAD * heading)); + var point_lat = proj_lat + ((row * (range/30) / 40) * math.cos(DEG2RAD * heading)); var elev = me.get_elevation(point_lat, point_lon); var grad = 0; #black @@ -104,6 +109,7 @@ var updateTerrain = func(r_scaled){ for (var r=0; r < len; r+=1) { var imgx = elevft[r]; + if (imgx == -1) continue; if (imgx < 1) trn[r].hide(); else trn[r].setFile(me.imgpath ~ me.tile_list[imgx]).show(); #trnR[r].setFile(me.imgpath ~ me.tile_list[2-imgx]).show(); @@ -151,14 +157,20 @@ var init = func { for (var c=0; c