1
0
Fork 0

Add version check

This commit is contained in:
legoboyvdlp R 2021-07-31 19:27:05 +01:00
parent c5a1c89a09
commit a61978bb64

View file

@ -79,6 +79,15 @@ var canvas_livery = {
resolution = maxSupportedRes;
me.targets[name].resolution = maxSupportedRes;
}
var (major, minor, patch) = split(".", getprop("/sim/version/flightgear"));
if (num(major) == 2020 and num(minor) < 4) {
me.targets[name].canvas = canvas.new({
"name": name,
"size": [resolution, resolution],
"view": [resolution, resolution],
"mipmapping": 1,
});
} else {
me.targets[name].canvas = canvas.new({
"name": name,
"size": [resolution, resolution],
@ -86,6 +95,7 @@ var canvas_livery = {
"mipmapping": 1,
"anisotropy": 32.0
});
}
foreach (var object; objects) {
me.targets[name].canvas.addPlacement({"node": object});
}
@ -158,6 +168,15 @@ var canvas_livery_update = {
resolution = maxSupportedRes;
me.targets[name].resolution = maxSupportedRes;
}
var (major, minor, patch) = split(".", getprop("/sim/version/flightgear"));
if (num(major) == 2020 and num(minor) < 4) {
me.targets[name].canvas = canvas.new({
"name": name,
"size": [resolution, resolution],
"view": [resolution, resolution],
"mipmapping": 1,
});
} else {
me.targets[name].canvas = canvas.new({
"name": name,
"size": [resolution, resolution],
@ -165,6 +184,7 @@ var canvas_livery_update = {
"mipmapping": 1,
"anisotropy": 32.0
});
}
foreach (var object; objects) {
me.targets[name].canvas.addPlacement({"module-id": me.module_id, "type": "scenery-object", "node": object});
}