1
0
Fork 0
Signed-off-by: fly <merspieler@airmail.cc>
This commit is contained in:
fly 2020-11-30 09:39:42 +11:00
parent 422f63b076
commit f0124e6e2a
2 changed files with 23 additions and 13 deletions

View file

@ -43,10 +43,16 @@
<!-- Asia --> <!-- Asia -->
<region include="Materials/regions/asia.xml"/> <region include="Materials/regions/asia.xml"/>
<!-- Pacific-->
<region include="Materials/regions/indonesia.xml"/>
<region include="Materials/regions/southeast_asia.xml"/> <region include="Materials/regions/southeast_asia.xml"/>
<region include="Materials/regions/indonesia.xml"/>
<!-- Australia -->
<region include="Materials/regions/australia.xml"/>
<region include="Materials/regions/australia_south_east.xml"/>
<region include="Materials/regions/australia_south_west.xml"/>
<region include="Materials/regions/australia_top_end.xml"/>
<!-- Pacific -->
<region include="Materials/regions/hawaii.xml"/> <region include="Materials/regions/hawaii.xml"/>
<region include="Materials/regions/oahu.xml"/> <region include="Materials/regions/oahu.xml"/>
<region include="Materials/regions/hawaii_big_island.xml"/> <region include="Materials/regions/hawaii_big_island.xml"/>

View file

@ -623,18 +623,15 @@ var findTexByRes = func(path, file, maxRes) {
# Class for Canvas based liveries # Class for Canvas based liveries
# #
var canvas_livery = { var canvas_livery = {
new: func(liveriesdir, interval = 10.01, callback = nili, resolution=4096) { init: func(dir, nameprop = "sim/model/livery/name", sortprop = nil, resolution=4096) {
var m = { parents: [canvas_livery, overlay_update.new()] }; var m = { parents: [canvas_livery, gui.OverlaySelector.new("Select Livery", dir, nameprop,
m.parents[1].add(getprop("/sim/aircraft-dir") ~ "/" ~ liveriesdir, "sim/model/livery/file", callback); sortprop, "sim/model/livery/file")] };
m.parents[1].interval = interval; m.dialog = m.parents[1];
m.liveriesdir = liveriesdir; m.liveriesdir = dir;
m.resolution = resolution; m.resolution = resolution;
m.targets = {}; m.targets = {};
return m; return m;
}, },
stop: func {
me.parents[1].stop();
},
setResolution: func(resolution) { setResolution: func(resolution) {
}, },
createTarget: func(name, objects, property, resolution=4096) { createTarget: func(name, objects, property, resolution=4096) {
@ -646,15 +643,22 @@ var canvas_livery = {
resolution: resolution, resolution: resolution,
}; };
maxRes = getprop("/sim/model/livery/max-resolution"); maxRes = getprop("/sim/model/livery/max-resolution");
# Make sure we never load too large textures
if (resolution > maxRes) { if (resolution > maxRes) {
resolution = maxRes; resolution = maxRes;
me.targets[name].resolution = maxRes;
}
# Make sure we never load too large textures
maxSupportedRes = getprop("/sim/rendering/max-texture-size");
if (resolution > maxSupportedRes) {
resolution = maxSupportedRes;
me.targets[name].resolution = maxSupportedRes;
} }
me.targets[name].canvas = canvas.new({ me.targets[name].canvas = canvas.new({
"name": name, "name": name,
"size": [resolution, resolution], "size": [resolution, resolution],
"view": [resolution, resolution], "view": [resolution, resolution],
"mipmapping": 1 "mipmapping": 1,
# "anisotropy": 1.0
}); });
foreach (var object; objects) { foreach (var object; objects) {
me.targets[name].canvas.addPlacement({"node": object}); me.targets[name].canvas.addPlacement({"node": object});