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 -->
<region include="Materials/regions/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/indonesia.xml"/>
<region include="Materials/regions/southeast_asia.xml"/>
<region include="Materials/regions/hawaii.xml"/>
<region include="Materials/regions/oahu.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
#
var canvas_livery = {
new: func(liveriesdir, interval = 10.01, callback = nili, resolution=4096) {
var m = { parents: [canvas_livery, overlay_update.new()] };
m.parents[1].add(getprop("/sim/aircraft-dir") ~ "/" ~ liveriesdir, "sim/model/livery/file", callback);
m.parents[1].interval = interval;
m.liveriesdir = liveriesdir;
init: func(dir, nameprop = "sim/model/livery/name", sortprop = nil, resolution=4096) {
var m = { parents: [canvas_livery, gui.OverlaySelector.new("Select Livery", dir, nameprop,
sortprop, "sim/model/livery/file")] };
m.dialog = m.parents[1];
m.liveriesdir = dir;
m.resolution = resolution;
m.targets = {};
return m;
},
stop: func {
me.parents[1].stop();
},
setResolution: func(resolution) {
},
createTarget: func(name, objects, property, resolution=4096) {
@ -646,15 +643,22 @@ var canvas_livery = {
resolution: resolution,
};
maxRes = getprop("/sim/model/livery/max-resolution");
# Make sure we never load too large textures
if (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({
"name": name,
"size": [resolution, resolution],
"view": [resolution, resolution],
"mipmapping": 1
"mipmapping": 1,
# "anisotropy": 1.0
});
foreach (var object; objects) {
me.targets[name].canvas.addPlacement({"node": object});