Skip to content

Commit 3049ad2

Browse files
committed
Added an enum for more common smart_zl screen resolutions
1 parent ad368ad commit 3049ad2

File tree

2 files changed

+21
-5
lines changed

2 files changed

+21
-5
lines changed

src/O4_GUI_Utils.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -633,11 +633,11 @@ def show_tile_preview(self,filepreview,lat,lon):
633633

634634
def _tmp_smart_zones_list():
635635
return TILE.smart_zone_list_1(tile_lat_lon=(self.lat, self.lon),
636-
screen_res=2560,
636+
screen_res=TILE.ScreenRes.OcculusRift,
637637
fov=60,
638638
fpa=10,
639639
provider='GO2',
640-
max_zl=20,
640+
max_zl=19,
641641
min_zl=16,
642642
greediness=3,
643643
greediness_threshold=0.70)

src/O4_Tile_Utils.py

+19-3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import enum
12
import datetime
23
import math
34
import os
@@ -154,11 +155,11 @@ def build_tile_list(tile,list_lat_lon,do_osm,do_mesh,do_mask,do_dsf,do_ovl,do_pt
154155
wall_time = time.clock()
155156
UI.lvprint(0,"Auto-generating a list of ZL zones around the airports of each tile.")
156157
zone_lists = smart_zone_list(list_lat_lon=list_lat_lon,
157-
screen_res=2560,
158+
screen_res=ScreenRes.OcculusRift,
158159
fov=60,
159160
fpa=10,
160161
provider='GO2',
161-
max_zl=20,
162+
max_zl=19,
162163
min_zl=16,
163164
greediness=3,
164165
greediness_threshold=0.70)
@@ -214,6 +215,21 @@ def remove_unwanted_textures(tile):
214215
except:pass
215216
##############################################################################
216217

218+
219+
class ScreenRes(enum.Enum):
220+
_720p = (1280, 720)
221+
SD = _720p
222+
_1080p = (1920, 1080)
223+
HD = _1080p
224+
_1440p = (2560, 1440)
225+
QHD = _1440p
226+
_2160p = (3840, 2160)
227+
_4K = _2160p
228+
_4320p = (7680, 4320)
229+
_8K = _4320p
230+
OcculusRift = (1080, 1200) # Per eye
231+
232+
217233
def smart_zone_list(list_lat_lon, screen_res, fov, fpa, provider, max_zl, min_zl, greediness=1, greediness_threshold=0.70):
218234
tiles_to_build = [XPlaneTile(lat, lon) for (lat, lon) in list_lat_lon]
219235
airport_collection = AirportDataSource().airports_in(tiles_to_build, include_surrounding_tiles=True)
@@ -225,7 +241,7 @@ def smart_zone_list(list_lat_lon, screen_res, fov, fpa, provider, max_zl, min_zl
225241
for zl in range(max_zl, min_zl - 1, -1):
226242
for polygon in airport_collection.polygons(zl,
227243
max_zl,
228-
screen_res,
244+
screen_res.value[0] if isinstance(screen_res, ScreenRes) else screen_res,
229245
fov,
230246
fpa,
231247
greediness,

0 commit comments

Comments
 (0)